From e22f94537743c429a3e55faf07a5fa873f32cdbb Mon Sep 17 00:00:00 2001 From: rkapka Date: Mon, 27 May 2024 18:43:58 +0900 Subject: [PATCH 1/9] interface names --- .../beacon_chain_client_factory.go | 2 +- validator/client/iface/BUILD.bazel | 4 ++-- .../iface/{beacon_chain_client.go => chain_client.go} | 0 ...prysm_beacon_chain_client.go => prysm_chain_client.go} | 0 .../client/node-client-factory/node_client_factory.go | 2 +- validator/client/service.go | 8 ++++---- 6 files changed, 8 insertions(+), 8 deletions(-) rename validator/client/iface/{beacon_chain_client.go => chain_client.go} (100%) rename validator/client/iface/{prysm_beacon_chain_client.go => prysm_chain_client.go} (100%) diff --git a/validator/client/beacon-chain-client-factory/beacon_chain_client_factory.go b/validator/client/beacon-chain-client-factory/beacon_chain_client_factory.go index 43e86ad6a7e9..2e74104ce9f1 100644 --- a/validator/client/beacon-chain-client-factory/beacon_chain_client_factory.go +++ b/validator/client/beacon-chain-client-factory/beacon_chain_client_factory.go @@ -1,4 +1,4 @@ -package validator_client_factory +package beacon_chain_client_factory import ( "github.com/prysmaticlabs/prysm/v5/config/features" diff --git a/validator/client/iface/BUILD.bazel b/validator/client/iface/BUILD.bazel index 8c58f7d9da44..f94923543641 100644 --- a/validator/client/iface/BUILD.bazel +++ b/validator/client/iface/BUILD.bazel @@ -3,9 +3,9 @@ load("@prysm//tools/go:def.bzl", "go_library") go_library( name = "go_default_library", srcs = [ - "beacon_chain_client.go", + "chain_client.go", "node_client.go", - "prysm_beacon_chain_client.go", + "prysm_chain_client.go", "validator.go", "validator_client.go", ], diff --git a/validator/client/iface/beacon_chain_client.go b/validator/client/iface/chain_client.go similarity index 100% rename from validator/client/iface/beacon_chain_client.go rename to validator/client/iface/chain_client.go diff --git a/validator/client/iface/prysm_beacon_chain_client.go b/validator/client/iface/prysm_chain_client.go similarity index 100% rename from validator/client/iface/prysm_beacon_chain_client.go rename to validator/client/iface/prysm_chain_client.go diff --git a/validator/client/node-client-factory/node_client_factory.go b/validator/client/node-client-factory/node_client_factory.go index f2c871a8e1b0..c431fb0f6ee8 100644 --- a/validator/client/node-client-factory/node_client_factory.go +++ b/validator/client/node-client-factory/node_client_factory.go @@ -1,4 +1,4 @@ -package validator_client_factory +package node_client_factory import ( "github.com/prysmaticlabs/prysm/v5/config/features" diff --git a/validator/client/service.go b/validator/client/service.go index 6e5a4cd6900a..2b820195c4d9 100644 --- a/validator/client/service.go +++ b/validator/client/service.go @@ -23,8 +23,8 @@ import ( beaconApi "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api" beaconChainClientFactory "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-chain-client-factory" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - nodeClientFactory "github.com/prysmaticlabs/prysm/v5/validator/client/node-client-factory" - validatorClientFactory "github.com/prysmaticlabs/prysm/v5/validator/client/validator-client-factory" + "github.com/prysmaticlabs/prysm/v5/validator/client/node-client-factory" + "github.com/prysmaticlabs/prysm/v5/validator/client/validator-client-factory" "github.com/prysmaticlabs/prysm/v5/validator/db" "github.com/prysmaticlabs/prysm/v5/validator/graffiti" validatorHelpers "github.com/prysmaticlabs/prysm/v5/validator/helpers" @@ -170,7 +170,7 @@ func (v *ValidatorService) Start() { v.conn.GetBeaconApiUrl(), ) - validatorClient := validatorClientFactory.NewValidatorClient(v.conn, restHandler) + validatorClient := validator_client_factory.NewValidatorClient(v.conn, restHandler) valStruct := &validator{ slotFeed: new(event.Feed), @@ -186,7 +186,7 @@ func (v *ValidatorService) Start() { graffitiOrderedIndex: graffitiOrderedIndex, validatorClient: validatorClient, chainClient: beaconChainClientFactory.NewChainClient(v.conn, restHandler), - nodeClient: nodeClientFactory.NewNodeClient(v.conn, restHandler), + nodeClient: node_client_factory.NewNodeClient(v.conn, restHandler), prysmChainClient: beaconChainClientFactory.NewPrysmChainClient(v.conn, restHandler), db: v.db, km: nil, From dba197665a267250a0a76e34fff0ff5f813a6be0 Mon Sep 17 00:00:00 2001 From: rkapka Date: Mon, 27 May 2024 18:53:47 +0900 Subject: [PATCH 2/9] interface method names --- beacon-chain/rpc/core/validator.go | 2 +- beacon-chain/rpc/endpoints.go | 16 +-- beacon-chain/rpc/eth/beacon/handlers.go | 2 +- beacon-chain/rpc/eth/node/handlers.go | 4 +- beacon-chain/rpc/eth/validator/handlers.go | 2 +- .../rpc/prysm/beacon/validator_count.go | 2 +- .../rpc/prysm/v1alpha1/beacon/blocks.go | 2 +- .../rpc/prysm/v1alpha1/beacon/blocks_test.go | 8 +- .../rpc/prysm/v1alpha1/beacon/validators.go | 10 +- .../prysm/v1alpha1/beacon/validators_test.go | 82 ++++++------ .../rpc/prysm/v1alpha1/validator/proposer.go | 2 +- .../prysm/validator/validator_performance.go | 2 +- proto/prysm/v1alpha1/beacon_chain.pb.go | 120 +++++++++--------- proto/prysm/v1alpha1/beacon_chain.pb.gw.go | 36 +++--- proto/prysm/v1alpha1/debug.pb.go | 12 +- proto/prysm/v1alpha1/debug.pb.gw.go | 4 +- proto/prysm/v1alpha1/node.pb.go | 48 +++---- proto/prysm/v1alpha1/node.pb.gw.go | 16 +-- proto/prysm/v1alpha1/validator.pb.go | 84 ++++++------ proto/prysm/v1alpha1/validator.pb.gw.go | 28 ++-- testing/mock/beacon_service_mock.go | 24 ++-- testing/mock/beacon_validator_client_mock.go | 28 ++-- testing/mock/beacon_validator_server_mock.go | 28 ++-- testing/mock/node_service_mock.go | 16 +-- testing/validator-mock/chain_client_mock.go | 36 +++--- testing/validator-mock/node_client_mock.go | 24 ++-- .../validator-mock/prysm_chain_client_mock.go | 6 +- .../validator-mock/validator_client_mock.go | 54 ++++---- validator/accounts/accounts_exit.go | 4 +- validator/accounts/testing/mock.go | 2 +- validator/client/attest.go | 2 +- .../beacon_api_beacon_chain_client.go | 24 ++-- .../beacon_api_beacon_chain_client_test.go | 26 ++-- .../beacon-api/beacon_api_node_client.go | 12 +- .../beacon-api/beacon_api_node_client_test.go | 6 +- .../beacon-api/beacon_api_validator_client.go | 30 ++--- .../beacon_api_validator_client_test.go | 8 +- .../beacon_committee_selections_test.go | 2 +- .../client/beacon-api/domain_data_test.go | 6 +- .../client/beacon-api/mock/genesis_mock.go | 4 +- .../beacon-api/prysm_beacon_chain_client.go | 4 +- validator/client/beacon-api/status.go | 2 +- .../sync_committee_selections_test.go | 2 +- .../client/beacon-api/validator_count_test.go | 2 +- .../grpc-api/grpc_beacon_chain_client.go | 12 +- validator/client/grpc-api/grpc_node_client.go | 8 +- .../grpc_prysm_beacon_chain_client.go | 6 +- .../grpc_prysm_beacon_chain_client_test.go | 2 +- .../client/grpc-api/grpc_validator_client.go | 18 +-- validator/client/iface/chain_client.go | 12 +- validator/client/iface/node_client.go | 8 +- validator/client/iface/prysm_chain_client.go | 2 +- validator/client/iface/validator.go | 2 +- validator/client/iface/validator_client.go | 18 +-- validator/client/key_reload.go | 2 +- validator/client/metrics.go | 2 +- validator/client/propose.go | 6 +- validator/client/propose_test.go | 4 +- validator/client/service.go | 2 +- validator/client/sync_committee.go | 8 +- validator/client/testutil/mock_validator.go | 2 +- validator/client/validator.go | 14 +- validator/client/wait_for_activation.go | 2 +- validator/rpc/handlers_beacon.go | 28 ++-- validator/rpc/handlers_health.go | 4 +- validator/rpc/handlers_keymanager.go | 4 +- validator/rpc/handlers_keymanager_test.go | 2 +- 67 files changed, 501 insertions(+), 501 deletions(-) diff --git a/beacon-chain/rpc/core/validator.go b/beacon-chain/rpc/core/validator.go index 9a5663bbfcad..f59d32068f53 100644 --- a/beacon-chain/rpc/core/validator.go +++ b/beacon-chain/rpc/core/validator.go @@ -327,7 +327,7 @@ func (s *Service) AggregatedSigAndAggregationBits( func (s *Service) GetAttestationData( ctx context.Context, req *ethpb.AttestationDataRequest, ) (*ethpb.AttestationData, *RpcError) { - ctx, span := trace.StartSpan(ctx, "coreService.GetAttestationData") + ctx, span := trace.StartSpan(ctx, "coreService.AttestationData") defer span.End() if req.Slot != s.GenesisTimeFetcher.CurrentSlot() { diff --git a/beacon-chain/rpc/endpoints.go b/beacon-chain/rpc/endpoints.go index 9809833c2338..45681ed028f0 100644 --- a/beacon-chain/rpc/endpoints.go +++ b/beacon-chain/rpc/endpoints.go @@ -192,7 +192,7 @@ func (s *Service) validatorEndpoints( }, { template: "/eth/v1/validator/attestation_data", - name: namespace + ".GetAttestationData", + name: namespace + ".AttestationData", handler: server.GetAttestationData, methods: []string{http.MethodGet}, }, @@ -283,7 +283,7 @@ func (s *Service) nodeEndpoints() []endpoint { return []endpoint{ { template: "/eth/v1/node/syncing", - name: namespace + ".GetSyncStatus", + name: namespace + ".SyncStatus", handler: server.GetSyncStatus, methods: []string{http.MethodGet}, }, @@ -313,7 +313,7 @@ func (s *Service) nodeEndpoints() []endpoint { }, { template: "/eth/v1/node/version", - name: namespace + ".GetVersion", + name: namespace + ".Version", handler: server.GetVersion, methods: []string{http.MethodGet}, }, @@ -520,7 +520,7 @@ func (s *Service) beaconEndpoints( }, { template: "/eth/v1/beacon/genesis", - name: namespace + ".GetGenesis", + name: namespace + ".Genesis", handler: server.GetGenesis, methods: []string{http.MethodGet}, }, @@ -690,13 +690,13 @@ func (s *Service) prysmBeaconEndpoints(ch *stategen.CanonicalHistory, stater loo }, { template: "/eth/v1/beacon/states/{state_id}/validator_count", - name: namespace + ".GetValidatorCount", + name: namespace + ".ValidatorCount", handler: server.GetValidatorCount, methods: []string{http.MethodGet}, }, { template: "/prysm/v1/beacon/states/{state_id}/validator_count", - name: namespace + ".GetValidatorCount", + name: namespace + ".ValidatorCount", handler: server.GetValidatorCount, methods: []string{http.MethodGet}, }, @@ -766,13 +766,13 @@ func (s *Service) prysmValidatorEndpoints(coreService *core.Service, stater look return []endpoint{ { template: "/prysm/validators/performance", - name: namespace + ".GetValidatorPerformance", + name: namespace + ".ValidatorPerformance", handler: server.GetValidatorPerformance, methods: []string{http.MethodPost}, }, { template: "/prysm/v1/validators/performance", - name: namespace + ".GetValidatorPerformance", + name: namespace + ".ValidatorPerformance", handler: server.GetValidatorPerformance, methods: []string{http.MethodPost}, }, diff --git a/beacon-chain/rpc/eth/beacon/handlers.go b/beacon-chain/rpc/eth/beacon/handlers.go index 4fc48d4eac68..16acb45298f2 100644 --- a/beacon-chain/rpc/eth/beacon/handlers.go +++ b/beacon-chain/rpc/eth/beacon/handlers.go @@ -1362,7 +1362,7 @@ func (s *Server) GetFinalityCheckpoints(w http.ResponseWriter, r *http.Request) // GetGenesis retrieves details of the chain's genesis which can be used to identify chain. func (s *Server) GetGenesis(w http.ResponseWriter, r *http.Request) { - _, span := trace.StartSpan(r.Context(), "beacon.GetGenesis") + _, span := trace.StartSpan(r.Context(), "beacon.Genesis") defer span.End() genesisTime := s.GenesisTimeFetcher.GenesisTime() diff --git a/beacon-chain/rpc/eth/node/handlers.go b/beacon-chain/rpc/eth/node/handlers.go index 7ccae43ed4ad..e6f716908389 100644 --- a/beacon-chain/rpc/eth/node/handlers.go +++ b/beacon-chain/rpc/eth/node/handlers.go @@ -28,7 +28,7 @@ var ( // GetSyncStatus requests the beacon node to describe if it's currently syncing or not, and // if it is, what block it is up to. func (s *Server) GetSyncStatus(w http.ResponseWriter, r *http.Request) { - ctx, span := trace.StartSpan(r.Context(), "node.GetSyncStatus") + ctx, span := trace.StartSpan(r.Context(), "node.SyncStatus") defer span.End() isOptimistic, err := s.OptimisticModeFetcher.IsOptimistic(ctx) @@ -94,7 +94,7 @@ func (s *Server) GetIdentity(w http.ResponseWriter, r *http.Request) { // GetVersion requests that the beacon node identify information about its implementation in a // format similar to a HTTP User-Agent field. func (*Server) GetVersion(w http.ResponseWriter, r *http.Request) { - _, span := trace.StartSpan(r.Context(), "node.GetVersion") + _, span := trace.StartSpan(r.Context(), "node.Version") defer span.End() v := fmt.Sprintf("Prysm/%s (%s %s)", version.SemanticVersion(), runtime.GOOS, runtime.GOARCH) diff --git a/beacon-chain/rpc/eth/validator/handlers.go b/beacon-chain/rpc/eth/validator/handlers.go index f10dbb9d2b78..9c24bf9f5e6a 100644 --- a/beacon-chain/rpc/eth/validator/handlers.go +++ b/beacon-chain/rpc/eth/validator/handlers.go @@ -396,7 +396,7 @@ func (s *Server) SubmitBeaconCommitteeSubscription(w http.ResponseWriter, r *htt // GetAttestationData requests that the beacon node produces attestation data for // the requested committee index and slot based on the nodes current head. func (s *Server) GetAttestationData(w http.ResponseWriter, r *http.Request) { - ctx, span := trace.StartSpan(r.Context(), "validator.GetAttestationData") + ctx, span := trace.StartSpan(r.Context(), "validator.AttestationData") defer span.End() if shared.IsSyncing(ctx, w, s.SyncChecker, s.HeadFetcher, s.TimeFetcher, s.OptimisticModeFetcher) { diff --git a/beacon-chain/rpc/prysm/beacon/validator_count.go b/beacon-chain/rpc/prysm/beacon/validator_count.go index 166a8c5c684d..67688938e71d 100644 --- a/beacon-chain/rpc/prysm/beacon/validator_count.go +++ b/beacon-chain/rpc/prysm/beacon/validator_count.go @@ -50,7 +50,7 @@ import ( // ] // } func (s *Server) GetValidatorCount(w http.ResponseWriter, r *http.Request) { - ctx, span := trace.StartSpan(r.Context(), "beacon.GetValidatorCount") + ctx, span := trace.StartSpan(r.Context(), "beacon.ValidatorCount") defer span.End() stateID := mux.Vars(r)["state_id"] diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go index b6315f886698..274bab8c54f7 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go @@ -243,7 +243,7 @@ func (bs *Server) listBlocksForGenesis(ctx context.Context, _ *ethpb.ListBlocksR // This includes the head block slot and root as well as information about // the most recent finalized and justified slots. // DEPRECATED: This endpoint is superseded by the /eth/v1/beacon API endpoint -func (bs *Server) GetChainHead(ctx context.Context, _ *emptypb.Empty) (*ethpb.ChainHead, error) { +func (bs *Server) ChainHead(ctx context.Context, _ *emptypb.Empty) (*ethpb.ChainHead, error) { return bs.chainHeadRetrieval(ctx) } diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go index fb6900d5eed1..756f0d5c84ef 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go @@ -76,7 +76,7 @@ func TestServer_GetChainHead_NoGenesis(t *testing.T) { PreviousJustifiedCheckPoint: s.PreviousJustifiedCheckpoint()}, OptimisticModeFetcher: &chainMock.ChainService{}, } - _, err = bs.GetChainHead(context.Background(), nil) + _, err = bs.ChainHead(context.Background(), nil) require.ErrorContains(t, "Could not get genesis block", err) } } @@ -111,7 +111,7 @@ func TestServer_GetChainHead_NoFinalizedBlock(t *testing.T) { OptimisticModeFetcher: &chainMock.ChainService{}, } - _, err = bs.GetChainHead(context.Background(), nil) + _, err = bs.ChainHead(context.Background(), nil) require.ErrorContains(t, "Could not get finalized block", err) } @@ -120,7 +120,7 @@ func TestServer_GetChainHead_NoHeadBlock(t *testing.T) { HeadFetcher: &chainMock.ChainService{Block: nil}, OptimisticModeFetcher: &chainMock.ChainService{}, } - _, err := bs.GetChainHead(context.Background(), nil) + _, err := bs.ChainHead(context.Background(), nil) assert.ErrorContains(t, "Head block of chain was nil", err) } @@ -181,7 +181,7 @@ func TestServer_GetChainHead(t *testing.T) { PreviousJustifiedCheckPoint: s.PreviousJustifiedCheckpoint()}, } - head, err := bs.GetChainHead(context.Background(), nil) + head, err := bs.ChainHead(context.Background(), nil) require.NoError(t, err) assert.Equal(t, primitives.Epoch(3), head.PreviousJustifiedEpoch, "Unexpected PreviousJustifiedEpoch") assert.Equal(t, primitives.Epoch(2), head.JustifiedEpoch, "Unexpected JustifiedEpoch") diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go index efad2fa89da6..98c70280cae3 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go @@ -30,7 +30,7 @@ import ( // ListValidatorBalances retrieves the validator balances for a given set of public keys. // An optional Epoch parameter is provided to request historical validator balances from // archived, persistent data. -func (bs *Server) ListValidatorBalances( +func (bs *Server) ValidatorBalances( ctx context.Context, req *ethpb.ListValidatorBalancesRequest, ) (*ethpb.ValidatorBalances, error) { @@ -185,7 +185,7 @@ func (bs *Server) ListValidatorBalances( // ListValidators retrieves the current list of active validators with an optional historical epoch flag to // retrieve validator set in time. -func (bs *Server) ListValidators( +func (bs *Server) Validators( ctx context.Context, req *ethpb.ListValidatorsRequest, ) (*ethpb.Validators, error) { @@ -474,7 +474,7 @@ func (bs *Server) GetValidatorActiveSetChanges( // GetValidatorParticipation retrieves the validator participation information for a given epoch, // it returns the information about validator's participation rate in voting on the proof of stake // rules based on their balance compared to the total active validator balance. -func (bs *Server) GetValidatorParticipation( +func (bs *Server) ValidatorParticipation( ctx context.Context, req *ethpb.GetValidatorParticipationRequest, ) (*ethpb.ValidatorParticipationResponse, error) { currentSlot := bs.GenesisTimeFetcher.CurrentSlot() @@ -565,7 +565,7 @@ func (bs *Server) GetValidatorParticipation( } // GetValidatorQueue retrieves the current validator queue information. -func (bs *Server) GetValidatorQueue( +func (bs *Server) ValidatorQueue( ctx context.Context, _ *emptypb.Empty, ) (*ethpb.ValidatorQueue, error) { headState, err := bs.HeadFetcher.HeadState(ctx) @@ -657,7 +657,7 @@ func (bs *Server) GetValidatorQueue( // GetValidatorPerformance reports the validator's latest balance along with other important metrics on // rewards and penalties throughout its lifecycle in the beacon chain. -func (bs *Server) GetValidatorPerformance( +func (bs *Server) ValidatorPerformance( ctx context.Context, req *ethpb.ValidatorPerformanceRequest, ) (*ethpb.ValidatorPerformanceResponse, error) { response, err := bs.CoreService.ComputeValidatorPerformance(ctx, req) diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go index 56a6a3f3e516..d98232818e03 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go @@ -89,7 +89,7 @@ func TestServer_ListValidatorBalances_CannotRequestFutureEpoch(t *testing.T) { } wanted := errNoEpochInfoError - _, err = bs.ListValidatorBalances( + _, err = bs.ValidatorBalances( ctx, ðpb.ListValidatorBalancesRequest{ QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{ @@ -128,7 +128,7 @@ func TestServer_ListValidatorBalances_NoResults(t *testing.T) { TotalSize: int32(0), NextPageToken: strconv.Itoa(0), } - res, err := bs.ListValidatorBalances( + res, err := bs.ValidatorBalances( ctx, ðpb.ListValidatorBalancesRequest{ QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{ @@ -182,7 +182,7 @@ func TestServer_ListValidatorBalances_DefaultResponse_NoArchive(t *testing.T) { }, ReplayerBuilder: mockstategen.NewReplayerBuilder(mockstategen.WithMockState(st)), } - res, err := bs.ListValidatorBalances( + res, err := bs.ValidatorBalances( ctx, ðpb.ListValidatorBalancesRequest{ QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{Epoch: 0}, @@ -213,7 +213,7 @@ func TestServer_ListValidatorBalances_PaginationOutOfRange(t *testing.T) { } wanted := fmt.Sprintf("page start %d >= list %d", 200, len(headState.Balances())) - _, err = bs.ListValidatorBalances(context.Background(), ðpb.ListValidatorBalancesRequest{ + _, err = bs.ValidatorBalances(context.Background(), ðpb.ListValidatorBalancesRequest{ PageToken: strconv.Itoa(2), PageSize: 100, QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{Epoch: 0}, @@ -231,7 +231,7 @@ func TestServer_ListValidatorBalances_ExceedsMaxPageSize(t *testing.T) { cmd.Get().MaxRPCPageSize, ) req := ðpb.ListValidatorBalancesRequest{PageSize: exceedsMax} - _, err := bs.ListValidatorBalances(context.Background(), req) + _, err := bs.ValidatorBalances(context.Background(), req) assert.ErrorContains(t, wanted, err) } @@ -316,7 +316,7 @@ func TestServer_ListValidatorBalances_Pagination_Default(t *testing.T) { }}, } for _, test := range tests { - res, err := bs.ListValidatorBalances(context.Background(), test.req) + res, err := bs.ValidatorBalances(context.Background(), test.req) require.NoError(t, err) if !proto.Equal(res, test.res) { t.Errorf("Expected %v, received %v", test.res, res) @@ -385,7 +385,7 @@ func TestServer_ListValidatorBalances_Pagination_CustomPageSizes(t *testing.T) { TotalSize: int32(count)}}, } for _, test := range tests { - res, err := bs.ListValidatorBalances(context.Background(), test.req) + res, err := bs.ValidatorBalances(context.Background(), test.req) require.NoError(t, err) if !proto.Equal(res, test.res) { t.Errorf("Expected %v, received %v", test.res, res) @@ -415,7 +415,7 @@ func TestServer_ListValidatorBalances_OutOfRange(t *testing.T) { req := ðpb.ListValidatorBalancesRequest{Indices: []primitives.ValidatorIndex{primitives.ValidatorIndex(1)}, QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{Epoch: 0}} wanted := "Validator index 1 >= balance list 1" - _, err = bs.ListValidatorBalances(context.Background(), req) + _, err = bs.ValidatorBalances(context.Background(), req) assert.ErrorContains(t, wanted, err) } @@ -438,7 +438,7 @@ func TestServer_ListValidators_CannotRequestFutureEpoch(t *testing.T) { } wanted := errNoEpochInfoError - _, err = bs.ListValidators( + _, err = bs.Validators( ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Epoch{ @@ -470,7 +470,7 @@ func TestServer_ListValidators_reqStateIsNil(t *testing.T) { // request uses HeadFetcher to get reqState. req1 := ðpb.ListValidatorsRequest{PageToken: strconv.Itoa(1), PageSize: 100} wanted := "Requested state is nil" - _, err := bs.ListValidators(context.Background(), req1) + _, err := bs.Validators(context.Background(), req1) assert.ErrorContains(t, wanted, err) // request uses StateGen to get reqState. @@ -479,7 +479,7 @@ func TestServer_ListValidators_reqStateIsNil(t *testing.T) { PageToken: strconv.Itoa(1), PageSize: 100, } - _, err = bs.ListValidators(context.Background(), req2) + _, err = bs.Validators(context.Background(), req2) assert.ErrorContains(t, wanted, err) } @@ -509,7 +509,7 @@ func TestServer_ListValidators_NoResults(t *testing.T) { TotalSize: int32(0), NextPageToken: strconv.Itoa(0), } - res, err := bs.ListValidators( + res, err := bs.Validators( ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Epoch{ @@ -579,7 +579,7 @@ func TestServer_ListValidators_OnlyActiveValidators(t *testing.T) { require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, gRoot)) require.NoError(t, beaconDB.SaveState(ctx, st, gRoot)) - received, err := bs.ListValidators(ctx, ðpb.ListValidatorsRequest{ + received, err := bs.Validators(ctx, ðpb.ListValidatorsRequest{ Active: true, }) require.NoError(t, err) @@ -647,7 +647,7 @@ func TestServer_ListValidators_InactiveInTheMiddle(t *testing.T) { require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, gRoot)) require.NoError(t, beaconDB.SaveState(ctx, st, gRoot)) - received, err := bs.ListValidators(ctx, ðpb.ListValidatorsRequest{ + received, err := bs.Validators(ctx, ðpb.ListValidatorsRequest{ Active: true, }) require.NoError(t, err) @@ -695,7 +695,7 @@ func TestServer_ListValidatorBalances_UnknownValidatorInResponse(t *testing.T) { NextPageToken: "", TotalSize: 3, } - res, err := bs.ListValidatorBalances(context.Background(), req) + res, err := bs.ValidatorBalances(context.Background(), req) require.NoError(t, err) if !proto.Equal(res, wanted) { t.Errorf("Expected %v, received %v", wanted, res) @@ -730,7 +730,7 @@ func TestServer_ListValidators_NoPagination(t *testing.T) { StateGen: stategen.New(beaconDB, doublylinkedtree.New()), } - received, err := bs.ListValidators(context.Background(), ðpb.ListValidatorsRequest{}) + received, err := bs.Validators(context.Background(), ðpb.ListValidatorsRequest{}) require.NoError(t, err) assert.DeepSSZEqual(t, want, received.ValidatorList, "Incorrect respond of validators") } @@ -757,7 +757,7 @@ func TestServer_ListValidators_StategenNotUsed(t *testing.T) { }, } - received, err := bs.ListValidators(context.Background(), ðpb.ListValidatorsRequest{}) + received, err := bs.Validators(context.Background(), ðpb.ListValidatorsRequest{}) require.NoError(t, err) assert.DeepEqual(t, want, received.ValidatorList, "Incorrect respond of validators") } @@ -804,7 +804,7 @@ func TestServer_ListValidators_IndicesPubKeys(t *testing.T) { Indices: indicesWanted, PublicKeys: pubKeysWanted, } - received, err := bs.ListValidators(context.Background(), req) + received, err := bs.Validators(context.Background(), req) require.NoError(t, err) assert.DeepEqual(t, want, received.ValidatorList, "Incorrect respond of validators") } @@ -939,7 +939,7 @@ func TestServer_ListValidators_Pagination(t *testing.T) { TotalSize: int32(count)}}, } for _, test := range tests { - res, err := bs.ListValidators(context.Background(), test.req) + res, err := bs.Validators(context.Background(), test.req) require.NoError(t, err) if !proto.Equal(res, test.res) { t.Errorf("Incorrect validator response, wanted %v, received %v", test.res, res) @@ -971,7 +971,7 @@ func TestServer_ListValidators_PaginationOutOfRange(t *testing.T) { req := ðpb.ListValidatorsRequest{PageToken: strconv.Itoa(1), PageSize: 100} wanted := fmt.Sprintf("page start %d >= list %d", req.PageSize, len(validators)) - _, err := bs.ListValidators(context.Background(), req) + _, err := bs.Validators(context.Background(), req) assert.ErrorContains(t, wanted, err) } @@ -981,7 +981,7 @@ func TestServer_ListValidators_ExceedsMaxPageSize(t *testing.T) { wanted := fmt.Sprintf("Requested page size %d can not be greater than max size %d", exceedsMax, cmd.Get().MaxRPCPageSize) req := ðpb.ListValidatorsRequest{PageToken: strconv.Itoa(0), PageSize: exceedsMax} - _, err := bs.ListValidators(context.Background(), req) + _, err := bs.Validators(context.Background(), req) assert.ErrorContains(t, wanted, err) } @@ -1014,7 +1014,7 @@ func TestServer_ListValidators_DefaultPageSize(t *testing.T) { } req := ðpb.ListValidatorsRequest{} - res, err := bs.ListValidators(context.Background(), req) + res, err := bs.Validators(context.Background(), req) require.NoError(t, err) i := 0 @@ -1063,7 +1063,7 @@ func TestServer_ListValidators_FromOldEpoch(t *testing.T) { Genesis: true, }, } - res, err := bs.ListValidators(context.Background(), req) + res, err := bs.Validators(context.Background(), req) require.NoError(t, err) assert.Equal(t, epochs, len(res.ValidatorList)) @@ -1080,7 +1080,7 @@ func TestServer_ListValidators_FromOldEpoch(t *testing.T) { Epoch: 10, }, } - res, err = bs.ListValidators(context.Background(), req) + res, err = bs.Validators(context.Background(), req) require.NoError(t, err) require.Equal(t, len(want), len(res.ValidatorList), "incorrect number of validators") @@ -1142,7 +1142,7 @@ func TestServer_ListValidators_ProcessHeadStateSlots(t *testing.T) { Epoch: 1, }, } - res, err := bs.ListValidators(context.Background(), req) + res, err := bs.Validators(context.Background(), req) require.NoError(t, err) assert.Equal(t, len(want), len(res.ValidatorList), "Incorrect number of validators") for i := 0; i < len(res.ValidatorList); i++ { @@ -1360,7 +1360,7 @@ func TestServer_GetValidatorQueue_PendingActivation(t *testing.T) { State: headState, }, } - res, err := bs.GetValidatorQueue(context.Background(), &emptypb.Empty{}) + res, err := bs.ValidatorQueue(context.Background(), &emptypb.Empty{}) require.NoError(t, err) // We verify the keys are properly sorted by the validators' activation eligibility epoch. wanted := [][]byte{ @@ -1404,7 +1404,7 @@ func TestServer_GetValidatorQueue_ExitedValidatorLeavesQueue(t *testing.T) { } // First we check if validator with index 1 is in the exit queue. - res, err := bs.GetValidatorQueue(context.Background(), &emptypb.Empty{}) + res, err := bs.ValidatorQueue(context.Background(), &emptypb.Empty{}) require.NoError(t, err) wanted := [][]byte{ bytesutil.PadTo([]byte("2"), 48), @@ -1420,7 +1420,7 @@ func TestServer_GetValidatorQueue_ExitedValidatorLeavesQueue(t *testing.T) { // Now, we move the state.slot past the exit epoch of the validator, and now // the validator should no longer exist in the queue. require.NoError(t, headState.SetSlot(params.BeaconConfig().SlotsPerEpoch.Mul(uint64(validators[1].ExitEpoch+1)))) - res, err = bs.GetValidatorQueue(context.Background(), &emptypb.Empty{}) + res, err = bs.ValidatorQueue(context.Background(), &emptypb.Empty{}) require.NoError(t, err) assert.Equal(t, 0, len(res.ExitPublicKeys)) } @@ -1460,7 +1460,7 @@ func TestServer_GetValidatorQueue_PendingExit(t *testing.T) { State: headState, }, } - res, err := bs.GetValidatorQueue(context.Background(), &emptypb.Empty{}) + res, err := bs.ValidatorQueue(context.Background(), &emptypb.Empty{}) require.NoError(t, err) // We verify the keys are properly sorted by the validators' withdrawable epoch. wanted := [][]byte{ @@ -1492,7 +1492,7 @@ func TestServer_GetValidatorParticipation_CannotRequestFutureEpoch(t *testing.T) } wanted := "Cannot retrieve information about an epoch" - _, err = bs.GetValidatorParticipation( + _, err = bs.ValidatorParticipation( ctx, ðpb.GetValidatorParticipationRequest{ QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{ @@ -1564,7 +1564,7 @@ func TestServer_GetValidatorParticipation_CurrentAndPrevEpoch(t *testing.T) { } addDefaultReplayerBuilder(bs, beaconDB) - res, err := bs.GetValidatorParticipation(ctx, ðpb.GetValidatorParticipationRequest{QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{Epoch: 1}}) + res, err := bs.ValidatorParticipation(ctx, ðpb.GetValidatorParticipationRequest{QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{Epoch: 1}}) require.NoError(t, err) wanted := ðpb.ValidatorParticipation{ @@ -1643,7 +1643,7 @@ func TestServer_GetValidatorParticipation_OrphanedUntilGenesis(t *testing.T) { } addDefaultReplayerBuilder(bs, beaconDB) - res, err := bs.GetValidatorParticipation(ctx, ðpb.GetValidatorParticipationRequest{QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{Epoch: 1}}) + res, err := bs.ValidatorParticipation(ctx, ðpb.GetValidatorParticipationRequest{QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{Epoch: 1}}) require.NoError(t, err) wanted := ðpb.ValidatorParticipation{ @@ -1754,7 +1754,7 @@ func runGetValidatorParticipationCurrentAndPrevEpoch(t *testing.T, genState stat } addDefaultReplayerBuilder(bs, beaconDB) - res, err := bs.GetValidatorParticipation(ctx, ðpb.GetValidatorParticipationRequest{QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{Epoch: 0}}) + res, err := bs.ValidatorParticipation(ctx, ðpb.GetValidatorParticipationRequest{QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{Epoch: 0}}) require.NoError(t, err) wanted := ðpb.ValidatorParticipation{ @@ -1772,7 +1772,7 @@ func runGetValidatorParticipationCurrentAndPrevEpoch(t *testing.T, genState stat assert.DeepEqual(t, true, res.Finalized, "Incorrect validator participation respond") assert.DeepEqual(t, wanted, res.Participation, "Incorrect validator participation respond") - res, err = bs.GetValidatorParticipation(ctx, ðpb.GetValidatorParticipationRequest{QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{Epoch: 1}}) + res, err = bs.ValidatorParticipation(ctx, ðpb.GetValidatorParticipationRequest{QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{Epoch: 1}}) require.NoError(t, err) wanted = ðpb.ValidatorParticipation{ @@ -1801,7 +1801,7 @@ func TestGetValidatorPerformance_Syncing(t *testing.T) { } wanted := "Syncing to latest head, not ready to respond" - _, err := bs.GetValidatorPerformance(ctx, nil) + _, err := bs.ValidatorPerformance(ctx, nil) assert.ErrorContains(t, wanted, err) } @@ -1876,7 +1876,7 @@ func TestGetValidatorPerformance_OK(t *testing.T) { MissingValidators: [][]byte{publicKey1[:]}, } - res, err := bs.GetValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ + res, err := bs.ValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ PublicKeys: [][]byte{publicKey1[:], publicKey3[:], publicKey2[:]}, }) require.NoError(t, err) @@ -1947,7 +1947,7 @@ func TestGetValidatorPerformance_Indices(t *testing.T) { MissingValidators: [][]byte{publicKey1[:]}, } - res, err := bs.GetValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ + res, err := bs.ValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ Indices: []primitives.ValidatorIndex{2, 1, 0}, }) require.NoError(t, err) @@ -2020,7 +2020,7 @@ func TestGetValidatorPerformance_IndicesPubkeys(t *testing.T) { } // Index 2 and publicKey3 points to the same validator. // Should not return duplicates. - res, err := bs.GetValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ + res, err := bs.ValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ PublicKeys: [][]byte{publicKey1[:], publicKey3[:]}, Indices: []primitives.ValidatorIndex{1, 2}, }) require.NoError(t, err) @@ -2090,7 +2090,7 @@ func TestGetValidatorPerformanceAltair_OK(t *testing.T) { InactivityScores: []uint64{0, 0}, } - res, err := bs.GetValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ + res, err := bs.ValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ PublicKeys: [][]byte{publicKey1[:], publicKey3[:], publicKey2[:]}, }) require.NoError(t, err) @@ -2160,7 +2160,7 @@ func TestGetValidatorPerformanceBellatrix_OK(t *testing.T) { InactivityScores: []uint64{0, 0}, } - res, err := bs.GetValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ + res, err := bs.ValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ PublicKeys: [][]byte{publicKey1[:], publicKey3[:], publicKey2[:]}, }) require.NoError(t, err) @@ -2230,7 +2230,7 @@ func TestGetValidatorPerformanceCapella_OK(t *testing.T) { InactivityScores: []uint64{0, 0}, } - res, err := bs.GetValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ + res, err := bs.ValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ PublicKeys: [][]byte{publicKey1[:], publicKey3[:], publicKey2[:]}, }) require.NoError(t, err) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go index 07bece2470f8..46b233307768 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go @@ -48,7 +48,7 @@ const ( // GetBeaconBlock is called by a proposer during its assigned slot to request a block to sign // by passing in the slot and the signed randao reveal of the slot. func (vs *Server) GetBeaconBlock(ctx context.Context, req *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) { - ctx, span := trace.StartSpan(ctx, "ProposerServer.GetBeaconBlock") + ctx, span := trace.StartSpan(ctx, "ProposerServer.BeaconBlock") defer span.End() span.AddAttributes(trace.Int64Attribute("slot", int64(req.Slot))) diff --git a/beacon-chain/rpc/prysm/validator/validator_performance.go b/beacon-chain/rpc/prysm/validator/validator_performance.go index fbd7547ad273..fb79133842af 100644 --- a/beacon-chain/rpc/prysm/validator/validator_performance.go +++ b/beacon-chain/rpc/prysm/validator/validator_performance.go @@ -13,7 +13,7 @@ import ( // GetValidatorPerformance is an HTTP handler for GetValidatorPerformance. func (s *Server) GetValidatorPerformance(w http.ResponseWriter, r *http.Request) { - ctx, span := trace.StartSpan(r.Context(), "validator.GetValidatorPerformance") + ctx, span := trace.StartSpan(r.Context(), "validator.ValidatorPerformance") defer span.End() var req structs.GetValidatorPerformanceRequest diff --git a/proto/prysm/v1alpha1/beacon_chain.pb.go b/proto/prysm/v1alpha1/beacon_chain.pb.go index b753957c7c6a..f31a9fa5e198 100755 --- a/proto/prysm/v1alpha1/beacon_chain.pb.go +++ b/proto/prysm/v1alpha1/beacon_chain.pb.go @@ -4200,16 +4200,16 @@ var file_proto_prysm_v1alpha1_beacon_chain_proto_depIdxs = []int32{ 0, // 25: ethereum.eth.v1alpha1.BeaconChain.ListIndexedAttestations:input_type -> ethereum.eth.v1alpha1.ListIndexedAttestationsRequest 24, // 26: ethereum.eth.v1alpha1.BeaconChain.AttestationPool:input_type -> ethereum.eth.v1alpha1.AttestationPoolRequest 4, // 27: ethereum.eth.v1alpha1.BeaconChain.ListBeaconBlocks:input_type -> ethereum.eth.v1alpha1.ListBlocksRequest - 52, // 28: ethereum.eth.v1alpha1.BeaconChain.GetChainHead:input_type -> google.protobuf.Empty + 52, // 28: ethereum.eth.v1alpha1.BeaconChain.ChainHead:input_type -> google.protobuf.Empty 8, // 29: ethereum.eth.v1alpha1.BeaconChain.ListBeaconCommittees:input_type -> ethereum.eth.v1alpha1.ListCommitteesRequest - 10, // 30: ethereum.eth.v1alpha1.BeaconChain.ListValidatorBalances:input_type -> ethereum.eth.v1alpha1.ListValidatorBalancesRequest - 12, // 31: ethereum.eth.v1alpha1.BeaconChain.ListValidators:input_type -> ethereum.eth.v1alpha1.ListValidatorsRequest + 10, // 30: ethereum.eth.v1alpha1.BeaconChain.ValidatorBalances:input_type -> ethereum.eth.v1alpha1.ListValidatorBalancesRequest + 12, // 31: ethereum.eth.v1alpha1.BeaconChain.Validators:input_type -> ethereum.eth.v1alpha1.ListValidatorsRequest 13, // 32: ethereum.eth.v1alpha1.BeaconChain.GetValidator:input_type -> ethereum.eth.v1alpha1.GetValidatorRequest 15, // 33: ethereum.eth.v1alpha1.BeaconChain.GetValidatorActiveSetChanges:input_type -> ethereum.eth.v1alpha1.GetValidatorActiveSetChangesRequest - 52, // 34: ethereum.eth.v1alpha1.BeaconChain.GetValidatorQueue:input_type -> google.protobuf.Empty - 17, // 35: ethereum.eth.v1alpha1.BeaconChain.GetValidatorPerformance:input_type -> ethereum.eth.v1alpha1.ValidatorPerformanceRequest + 52, // 34: ethereum.eth.v1alpha1.BeaconChain.ValidatorQueue:input_type -> google.protobuf.Empty + 17, // 35: ethereum.eth.v1alpha1.BeaconChain.ValidatorPerformance:input_type -> ethereum.eth.v1alpha1.ValidatorPerformanceRequest 20, // 36: ethereum.eth.v1alpha1.BeaconChain.ListValidatorAssignments:input_type -> ethereum.eth.v1alpha1.ListValidatorAssignmentsRequest - 22, // 37: ethereum.eth.v1alpha1.BeaconChain.GetValidatorParticipation:input_type -> ethereum.eth.v1alpha1.GetValidatorParticipationRequest + 22, // 37: ethereum.eth.v1alpha1.BeaconChain.ValidatorParticipation:input_type -> ethereum.eth.v1alpha1.GetValidatorParticipationRequest 52, // 38: ethereum.eth.v1alpha1.BeaconChain.GetBeaconConfig:input_type -> google.protobuf.Empty 53, // 39: ethereum.eth.v1alpha1.BeaconChain.SubmitAttesterSlashing:input_type -> ethereum.eth.v1alpha1.AttesterSlashing 54, // 40: ethereum.eth.v1alpha1.BeaconChain.SubmitProposerSlashing:input_type -> ethereum.eth.v1alpha1.ProposerSlashing @@ -4218,16 +4218,16 @@ var file_proto_prysm_v1alpha1_beacon_chain_proto_depIdxs = []int32{ 3, // 43: ethereum.eth.v1alpha1.BeaconChain.ListIndexedAttestations:output_type -> ethereum.eth.v1alpha1.ListIndexedAttestationsResponse 25, // 44: ethereum.eth.v1alpha1.BeaconChain.AttestationPool:output_type -> ethereum.eth.v1alpha1.AttestationPoolResponse 5, // 45: ethereum.eth.v1alpha1.BeaconChain.ListBeaconBlocks:output_type -> ethereum.eth.v1alpha1.ListBeaconBlocksResponse - 7, // 46: ethereum.eth.v1alpha1.BeaconChain.GetChainHead:output_type -> ethereum.eth.v1alpha1.ChainHead + 7, // 46: ethereum.eth.v1alpha1.BeaconChain.ChainHead:output_type -> ethereum.eth.v1alpha1.ChainHead 9, // 47: ethereum.eth.v1alpha1.BeaconChain.ListBeaconCommittees:output_type -> ethereum.eth.v1alpha1.BeaconCommittees - 11, // 48: ethereum.eth.v1alpha1.BeaconChain.ListValidatorBalances:output_type -> ethereum.eth.v1alpha1.ValidatorBalances - 14, // 49: ethereum.eth.v1alpha1.BeaconChain.ListValidators:output_type -> ethereum.eth.v1alpha1.Validators + 11, // 48: ethereum.eth.v1alpha1.BeaconChain.ValidatorBalances:output_type -> ethereum.eth.v1alpha1.ValidatorBalances + 14, // 49: ethereum.eth.v1alpha1.BeaconChain.Validators:output_type -> ethereum.eth.v1alpha1.Validators 51, // 50: ethereum.eth.v1alpha1.BeaconChain.GetValidator:output_type -> ethereum.eth.v1alpha1.Validator 16, // 51: ethereum.eth.v1alpha1.BeaconChain.GetValidatorActiveSetChanges:output_type -> ethereum.eth.v1alpha1.ActiveSetChanges - 19, // 52: ethereum.eth.v1alpha1.BeaconChain.GetValidatorQueue:output_type -> ethereum.eth.v1alpha1.ValidatorQueue - 18, // 53: ethereum.eth.v1alpha1.BeaconChain.GetValidatorPerformance:output_type -> ethereum.eth.v1alpha1.ValidatorPerformanceResponse + 19, // 52: ethereum.eth.v1alpha1.BeaconChain.ValidatorQueue:output_type -> ethereum.eth.v1alpha1.ValidatorQueue + 18, // 53: ethereum.eth.v1alpha1.BeaconChain.ValidatorPerformance:output_type -> ethereum.eth.v1alpha1.ValidatorPerformanceResponse 21, // 54: ethereum.eth.v1alpha1.BeaconChain.ListValidatorAssignments:output_type -> ethereum.eth.v1alpha1.ValidatorAssignments - 23, // 55: ethereum.eth.v1alpha1.BeaconChain.GetValidatorParticipation:output_type -> ethereum.eth.v1alpha1.ValidatorParticipationResponse + 23, // 55: ethereum.eth.v1alpha1.BeaconChain.ValidatorParticipation:output_type -> ethereum.eth.v1alpha1.ValidatorParticipationResponse 26, // 56: ethereum.eth.v1alpha1.BeaconChain.GetBeaconConfig:output_type -> ethereum.eth.v1alpha1.BeaconConfig 27, // 57: ethereum.eth.v1alpha1.BeaconChain.SubmitAttesterSlashing:output_type -> ethereum.eth.v1alpha1.SubmitSlashingResponse 27, // 58: ethereum.eth.v1alpha1.BeaconChain.SubmitProposerSlashing:output_type -> ethereum.eth.v1alpha1.SubmitSlashingResponse @@ -4836,7 +4836,7 @@ func (c *beaconChainClient) ListBeaconBlocks(ctx context.Context, in *ListBlocks // Deprecated: Do not use. func (c *beaconChainClient) GetChainHead(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ChainHead, error) { out := new(ChainHead) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/GetChainHead", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/ChainHead", in, out, opts...) if err != nil { return nil, err } @@ -4854,7 +4854,7 @@ func (c *beaconChainClient) ListBeaconCommittees(ctx context.Context, in *ListCo func (c *beaconChainClient) ListValidatorBalances(ctx context.Context, in *ListValidatorBalancesRequest, opts ...grpc.CallOption) (*ValidatorBalances, error) { out := new(ValidatorBalances) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/ListValidatorBalances", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorBalances", in, out, opts...) if err != nil { return nil, err } @@ -4863,7 +4863,7 @@ func (c *beaconChainClient) ListValidatorBalances(ctx context.Context, in *ListV func (c *beaconChainClient) ListValidators(ctx context.Context, in *ListValidatorsRequest, opts ...grpc.CallOption) (*Validators, error) { out := new(Validators) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/ListValidators", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/Validators", in, out, opts...) if err != nil { return nil, err } @@ -4890,7 +4890,7 @@ func (c *beaconChainClient) GetValidatorActiveSetChanges(ctx context.Context, in func (c *beaconChainClient) GetValidatorQueue(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ValidatorQueue, error) { out := new(ValidatorQueue) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorQueue", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorQueue", in, out, opts...) if err != nil { return nil, err } @@ -4899,7 +4899,7 @@ func (c *beaconChainClient) GetValidatorQueue(ctx context.Context, in *emptypb.E func (c *beaconChainClient) GetValidatorPerformance(ctx context.Context, in *ValidatorPerformanceRequest, opts ...grpc.CallOption) (*ValidatorPerformanceResponse, error) { out := new(ValidatorPerformanceResponse) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorPerformance", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorPerformance", in, out, opts...) if err != nil { return nil, err } @@ -4918,7 +4918,7 @@ func (c *beaconChainClient) ListValidatorAssignments(ctx context.Context, in *Li // Deprecated: Do not use. func (c *beaconChainClient) GetValidatorParticipation(ctx context.Context, in *GetValidatorParticipationRequest, opts ...grpc.CallOption) (*ValidatorParticipationResponse, error) { out := new(ValidatorParticipationResponse) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorParticipation", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorParticipation", in, out, opts...) if err != nil { return nil, err } @@ -4968,17 +4968,17 @@ type BeaconChainServer interface { AttestationPool(context.Context, *AttestationPoolRequest) (*AttestationPoolResponse, error) ListBeaconBlocks(context.Context, *ListBlocksRequest) (*ListBeaconBlocksResponse, error) // Deprecated: Do not use. - GetChainHead(context.Context, *emptypb.Empty) (*ChainHead, error) + ChainHead(context.Context, *emptypb.Empty) (*ChainHead, error) ListBeaconCommittees(context.Context, *ListCommitteesRequest) (*BeaconCommittees, error) - ListValidatorBalances(context.Context, *ListValidatorBalancesRequest) (*ValidatorBalances, error) - ListValidators(context.Context, *ListValidatorsRequest) (*Validators, error) + ValidatorBalances(context.Context, *ListValidatorBalancesRequest) (*ValidatorBalances, error) + Validators(context.Context, *ListValidatorsRequest) (*Validators, error) GetValidator(context.Context, *GetValidatorRequest) (*Validator, error) GetValidatorActiveSetChanges(context.Context, *GetValidatorActiveSetChangesRequest) (*ActiveSetChanges, error) - GetValidatorQueue(context.Context, *emptypb.Empty) (*ValidatorQueue, error) - GetValidatorPerformance(context.Context, *ValidatorPerformanceRequest) (*ValidatorPerformanceResponse, error) + ValidatorQueue(context.Context, *emptypb.Empty) (*ValidatorQueue, error) + ValidatorPerformance(context.Context, *ValidatorPerformanceRequest) (*ValidatorPerformanceResponse, error) ListValidatorAssignments(context.Context, *ListValidatorAssignmentsRequest) (*ValidatorAssignments, error) // Deprecated: Do not use. - GetValidatorParticipation(context.Context, *GetValidatorParticipationRequest) (*ValidatorParticipationResponse, error) + ValidatorParticipation(context.Context, *GetValidatorParticipationRequest) (*ValidatorParticipationResponse, error) GetBeaconConfig(context.Context, *emptypb.Empty) (*BeaconConfig, error) SubmitAttesterSlashing(context.Context, *AttesterSlashing) (*SubmitSlashingResponse, error) SubmitProposerSlashing(context.Context, *ProposerSlashing) (*SubmitSlashingResponse, error) @@ -5001,17 +5001,17 @@ func (*UnimplementedBeaconChainServer) AttestationPool(context.Context, *Attesta func (*UnimplementedBeaconChainServer) ListBeaconBlocks(context.Context, *ListBlocksRequest) (*ListBeaconBlocksResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListBeaconBlocks not implemented") } -func (*UnimplementedBeaconChainServer) GetChainHead(context.Context, *emptypb.Empty) (*ChainHead, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetChainHead not implemented") +func (*UnimplementedBeaconChainServer) ChainHead(context.Context, *emptypb.Empty) (*ChainHead, error) { + return nil, status.Errorf(codes.Unimplemented, "method ChainHead not implemented") } func (*UnimplementedBeaconChainServer) ListBeaconCommittees(context.Context, *ListCommitteesRequest) (*BeaconCommittees, error) { return nil, status.Errorf(codes.Unimplemented, "method ListBeaconCommittees not implemented") } -func (*UnimplementedBeaconChainServer) ListValidatorBalances(context.Context, *ListValidatorBalancesRequest) (*ValidatorBalances, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListValidatorBalances not implemented") +func (*UnimplementedBeaconChainServer) ValidatorBalances(context.Context, *ListValidatorBalancesRequest) (*ValidatorBalances, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidatorBalances not implemented") } -func (*UnimplementedBeaconChainServer) ListValidators(context.Context, *ListValidatorsRequest) (*Validators, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListValidators not implemented") +func (*UnimplementedBeaconChainServer) Validators(context.Context, *ListValidatorsRequest) (*Validators, error) { + return nil, status.Errorf(codes.Unimplemented, "method Validators not implemented") } func (*UnimplementedBeaconChainServer) GetValidator(context.Context, *GetValidatorRequest) (*Validator, error) { return nil, status.Errorf(codes.Unimplemented, "method GetValidator not implemented") @@ -5019,17 +5019,17 @@ func (*UnimplementedBeaconChainServer) GetValidator(context.Context, *GetValidat func (*UnimplementedBeaconChainServer) GetValidatorActiveSetChanges(context.Context, *GetValidatorActiveSetChangesRequest) (*ActiveSetChanges, error) { return nil, status.Errorf(codes.Unimplemented, "method GetValidatorActiveSetChanges not implemented") } -func (*UnimplementedBeaconChainServer) GetValidatorQueue(context.Context, *emptypb.Empty) (*ValidatorQueue, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetValidatorQueue not implemented") +func (*UnimplementedBeaconChainServer) ValidatorQueue(context.Context, *emptypb.Empty) (*ValidatorQueue, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidatorQueue not implemented") } -func (*UnimplementedBeaconChainServer) GetValidatorPerformance(context.Context, *ValidatorPerformanceRequest) (*ValidatorPerformanceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetValidatorPerformance not implemented") +func (*UnimplementedBeaconChainServer) ValidatorPerformance(context.Context, *ValidatorPerformanceRequest) (*ValidatorPerformanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidatorPerformance not implemented") } func (*UnimplementedBeaconChainServer) ListValidatorAssignments(context.Context, *ListValidatorAssignmentsRequest) (*ValidatorAssignments, error) { return nil, status.Errorf(codes.Unimplemented, "method ListValidatorAssignments not implemented") } -func (*UnimplementedBeaconChainServer) GetValidatorParticipation(context.Context, *GetValidatorParticipationRequest) (*ValidatorParticipationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetValidatorParticipation not implemented") +func (*UnimplementedBeaconChainServer) ValidatorParticipation(context.Context, *GetValidatorParticipationRequest) (*ValidatorParticipationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ValidatorParticipation not implemented") } func (*UnimplementedBeaconChainServer) GetBeaconConfig(context.Context, *emptypb.Empty) (*BeaconConfig, error) { return nil, status.Errorf(codes.Unimplemented, "method GetBeaconConfig not implemented") @@ -5126,14 +5126,14 @@ func _BeaconChain_GetChainHead_Handler(srv interface{}, ctx context.Context, dec return nil, err } if interceptor == nil { - return srv.(BeaconChainServer).GetChainHead(ctx, in) + return srv.(BeaconChainServer).ChainHead(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/GetChainHead", + FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/ChainHead", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BeaconChainServer).GetChainHead(ctx, req.(*emptypb.Empty)) + return srv.(BeaconChainServer).ChainHead(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } @@ -5162,14 +5162,14 @@ func _BeaconChain_ListValidatorBalances_Handler(srv interface{}, ctx context.Con return nil, err } if interceptor == nil { - return srv.(BeaconChainServer).ListValidatorBalances(ctx, in) + return srv.(BeaconChainServer).ValidatorBalances(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/ListValidatorBalances", + FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/ValidatorBalances", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BeaconChainServer).ListValidatorBalances(ctx, req.(*ListValidatorBalancesRequest)) + return srv.(BeaconChainServer).ValidatorBalances(ctx, req.(*ListValidatorBalancesRequest)) } return interceptor(ctx, in, info, handler) } @@ -5180,14 +5180,14 @@ func _BeaconChain_ListValidators_Handler(srv interface{}, ctx context.Context, d return nil, err } if interceptor == nil { - return srv.(BeaconChainServer).ListValidators(ctx, in) + return srv.(BeaconChainServer).Validators(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/ListValidators", + FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/Validators", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BeaconChainServer).ListValidators(ctx, req.(*ListValidatorsRequest)) + return srv.(BeaconChainServer).Validators(ctx, req.(*ListValidatorsRequest)) } return interceptor(ctx, in, info, handler) } @@ -5234,14 +5234,14 @@ func _BeaconChain_GetValidatorQueue_Handler(srv interface{}, ctx context.Context return nil, err } if interceptor == nil { - return srv.(BeaconChainServer).GetValidatorQueue(ctx, in) + return srv.(BeaconChainServer).ValidatorQueue(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorQueue", + FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/ValidatorQueue", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BeaconChainServer).GetValidatorQueue(ctx, req.(*emptypb.Empty)) + return srv.(BeaconChainServer).ValidatorQueue(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } @@ -5252,14 +5252,14 @@ func _BeaconChain_GetValidatorPerformance_Handler(srv interface{}, ctx context.C return nil, err } if interceptor == nil { - return srv.(BeaconChainServer).GetValidatorPerformance(ctx, in) + return srv.(BeaconChainServer).ValidatorPerformance(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorPerformance", + FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/ValidatorPerformance", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BeaconChainServer).GetValidatorPerformance(ctx, req.(*ValidatorPerformanceRequest)) + return srv.(BeaconChainServer).ValidatorPerformance(ctx, req.(*ValidatorPerformanceRequest)) } return interceptor(ctx, in, info, handler) } @@ -5288,14 +5288,14 @@ func _BeaconChain_GetValidatorParticipation_Handler(srv interface{}, ctx context return nil, err } if interceptor == nil { - return srv.(BeaconChainServer).GetValidatorParticipation(ctx, in) + return srv.(BeaconChainServer).ValidatorParticipation(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorParticipation", + FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/ValidatorParticipation", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BeaconChainServer).GetValidatorParticipation(ctx, req.(*GetValidatorParticipationRequest)) + return srv.(BeaconChainServer).ValidatorParticipation(ctx, req.(*GetValidatorParticipationRequest)) } return interceptor(ctx, in, info, handler) } @@ -5393,7 +5393,7 @@ var _BeaconChain_serviceDesc = grpc.ServiceDesc{ Handler: _BeaconChain_ListBeaconBlocks_Handler, }, { - MethodName: "GetChainHead", + MethodName: "ChainHead", Handler: _BeaconChain_GetChainHead_Handler, }, { @@ -5401,11 +5401,11 @@ var _BeaconChain_serviceDesc = grpc.ServiceDesc{ Handler: _BeaconChain_ListBeaconCommittees_Handler, }, { - MethodName: "ListValidatorBalances", + MethodName: "ValidatorBalances", Handler: _BeaconChain_ListValidatorBalances_Handler, }, { - MethodName: "ListValidators", + MethodName: "Validators", Handler: _BeaconChain_ListValidators_Handler, }, { @@ -5417,11 +5417,11 @@ var _BeaconChain_serviceDesc = grpc.ServiceDesc{ Handler: _BeaconChain_GetValidatorActiveSetChanges_Handler, }, { - MethodName: "GetValidatorQueue", + MethodName: "ValidatorQueue", Handler: _BeaconChain_GetValidatorQueue_Handler, }, { - MethodName: "GetValidatorPerformance", + MethodName: "ValidatorPerformance", Handler: _BeaconChain_GetValidatorPerformance_Handler, }, { @@ -5429,7 +5429,7 @@ var _BeaconChain_serviceDesc = grpc.ServiceDesc{ Handler: _BeaconChain_ListValidatorAssignments_Handler, }, { - MethodName: "GetValidatorParticipation", + MethodName: "ValidatorParticipation", Handler: _BeaconChain_GetValidatorParticipation_Handler, }, { diff --git a/proto/prysm/v1alpha1/beacon_chain.pb.gw.go b/proto/prysm/v1alpha1/beacon_chain.pb.gw.go index 6622c0bcfcde..70f7141924c1 100755 --- a/proto/prysm/v1alpha1/beacon_chain.pb.gw.go +++ b/proto/prysm/v1alpha1/beacon_chain.pb.gw.go @@ -192,7 +192,7 @@ func local_request_BeaconChain_GetChainHead_0(ctx context.Context, marshaler run var protoReq emptypb.Empty var metadata runtime.ServerMetadata - msg, err := server.GetChainHead(ctx, &protoReq) + msg, err := server.ChainHead(ctx, &protoReq) return msg, metadata, err } @@ -264,7 +264,7 @@ func local_request_BeaconChain_ListValidatorBalances_0(ctx context.Context, mars return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ListValidatorBalances(ctx, &protoReq) + msg, err := server.ValidatorBalances(ctx, &protoReq) return msg, metadata, err } @@ -300,7 +300,7 @@ func local_request_BeaconChain_ListValidators_0(ctx context.Context, marshaler r return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ListValidators(ctx, &protoReq) + msg, err := server.Validators(ctx, &protoReq) return msg, metadata, err } @@ -390,7 +390,7 @@ func local_request_BeaconChain_GetValidatorQueue_0(ctx context.Context, marshale var protoReq emptypb.Empty var metadata runtime.ServerMetadata - msg, err := server.GetValidatorQueue(ctx, &protoReq) + msg, err := server.ValidatorQueue(ctx, &protoReq) return msg, metadata, err } @@ -426,7 +426,7 @@ func local_request_BeaconChain_GetValidatorPerformance_0(ctx context.Context, ma return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetValidatorPerformance(ctx, &protoReq) + msg, err := server.ValidatorPerformance(ctx, &protoReq) return msg, metadata, err } @@ -498,7 +498,7 @@ func local_request_BeaconChain_GetValidatorParticipation_0(ctx context.Context, return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.GetValidatorParticipation(ctx, &protoReq) + msg, err := server.ValidatorParticipation(ctx, &protoReq) return msg, metadata, err } @@ -733,7 +733,7 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetChainHead") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ChainHead") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -779,7 +779,7 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidatorBalances") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorBalances") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -802,7 +802,7 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidators") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/Validators") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -871,7 +871,7 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorQueue") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorQueue") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -894,7 +894,7 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorPerformance") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorPerformance") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -940,7 +940,7 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorParticipation") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorParticipation") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1174,7 +1174,7 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetChainHead") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ChainHead") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1214,7 +1214,7 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidatorBalances") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorBalances") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1234,7 +1234,7 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidators") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/Validators") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1294,7 +1294,7 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorQueue") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorQueue") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1314,7 +1314,7 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorPerformance") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorPerformance") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1354,7 +1354,7 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorParticipation") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorParticipation") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return diff --git a/proto/prysm/v1alpha1/debug.pb.go b/proto/prysm/v1alpha1/debug.pb.go index 1ae0501d8175..0f3c9437e5d0 100755 --- a/proto/prysm/v1alpha1/debug.pb.go +++ b/proto/prysm/v1alpha1/debug.pb.go @@ -1082,12 +1082,12 @@ var file_proto_prysm_v1alpha1_debug_proto_depIdxs = []int32{ 3, // 11: ethereum.eth.v1alpha1.Debug.GetBeaconState:input_type -> ethereum.eth.v1alpha1.BeaconStateRequest 4, // 12: ethereum.eth.v1alpha1.Debug.GetBlock:input_type -> ethereum.eth.v1alpha1.BlockRequestByRoot 6, // 13: ethereum.eth.v1alpha1.Debug.SetLoggingLevel:input_type -> ethereum.eth.v1alpha1.LoggingLevelRequest - 18, // 14: ethereum.eth.v1alpha1.Debug.ListPeers:input_type -> google.protobuf.Empty + 18, // 14: ethereum.eth.v1alpha1.Debug.Peers:input_type -> google.protobuf.Empty 19, // 15: ethereum.eth.v1alpha1.Debug.GetPeer:input_type -> ethereum.eth.v1alpha1.PeerRequest 5, // 16: ethereum.eth.v1alpha1.Debug.GetBeaconState:output_type -> ethereum.eth.v1alpha1.SSZResponse 5, // 17: ethereum.eth.v1alpha1.Debug.GetBlock:output_type -> ethereum.eth.v1alpha1.SSZResponse 18, // 18: ethereum.eth.v1alpha1.Debug.SetLoggingLevel:output_type -> google.protobuf.Empty - 7, // 19: ethereum.eth.v1alpha1.Debug.ListPeers:output_type -> ethereum.eth.v1alpha1.DebugPeerResponses + 7, // 19: ethereum.eth.v1alpha1.Debug.Peers:output_type -> ethereum.eth.v1alpha1.DebugPeerResponses 8, // 20: ethereum.eth.v1alpha1.Debug.GetPeer:output_type -> ethereum.eth.v1alpha1.DebugPeerResponse 16, // [16:21] is the sub-list for method output_type 11, // [11:16] is the sub-list for method input_type @@ -1318,7 +1318,7 @@ func (c *debugClient) SetLoggingLevel(ctx context.Context, in *LoggingLevelReque func (c *debugClient) ListPeers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*DebugPeerResponses, error) { out := new(DebugPeerResponses) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Debug/ListPeers", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Debug/Peers", in, out, opts...) if err != nil { return nil, err } @@ -1357,7 +1357,7 @@ func (*UnimplementedDebugServer) SetLoggingLevel(context.Context, *LoggingLevelR return nil, status.Errorf(codes.Unimplemented, "method SetLoggingLevel not implemented") } func (*UnimplementedDebugServer) ListPeers(context.Context, *emptypb.Empty) (*DebugPeerResponses, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListPeers not implemented") + return nil, status.Errorf(codes.Unimplemented, "method Peers not implemented") } func (*UnimplementedDebugServer) GetPeer(context.Context, *PeerRequest) (*DebugPeerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetPeer not implemented") @@ -1431,7 +1431,7 @@ func _Debug_ListPeers_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.Debug/ListPeers", + FullMethod: "/ethereum.eth.v1alpha1.Debug/Peers", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DebugServer).ListPeers(ctx, req.(*emptypb.Empty)) @@ -1474,7 +1474,7 @@ var _Debug_serviceDesc = grpc.ServiceDesc{ Handler: _Debug_SetLoggingLevel_Handler, }, { - MethodName: "ListPeers", + MethodName: "Peers", Handler: _Debug_ListPeers_Handler, }, { diff --git a/proto/prysm/v1alpha1/debug.pb.gw.go b/proto/prysm/v1alpha1/debug.pb.gw.go index 750a64dc7280..233316291f29 100755 --- a/proto/prysm/v1alpha1/debug.pb.gw.go +++ b/proto/prysm/v1alpha1/debug.pb.gw.go @@ -278,7 +278,7 @@ func RegisterDebugHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/ListPeers") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/Peers") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -423,7 +423,7 @@ func RegisterDebugHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/ListPeers") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/Peers") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return diff --git a/proto/prysm/v1alpha1/node.pb.go b/proto/prysm/v1alpha1/node.pb.go index ac175b8329c1..a76f7f153dd1 100755 --- a/proto/prysm/v1alpha1/node.pb.go +++ b/proto/prysm/v1alpha1/node.pb.go @@ -895,23 +895,23 @@ var file_proto_prysm_v1alpha1_node_proto_depIdxs = []int32{ 9, // 1: ethereum.eth.v1alpha1.Peers.peers:type_name -> ethereum.eth.v1alpha1.Peer 0, // 2: ethereum.eth.v1alpha1.Peer.direction:type_name -> ethereum.eth.v1alpha1.PeerDirection 1, // 3: ethereum.eth.v1alpha1.Peer.connection_state:type_name -> ethereum.eth.v1alpha1.ConnectionState - 13, // 4: ethereum.eth.v1alpha1.Node.GetSyncStatus:input_type -> google.protobuf.Empty - 13, // 5: ethereum.eth.v1alpha1.Node.GetGenesis:input_type -> google.protobuf.Empty - 13, // 6: ethereum.eth.v1alpha1.Node.GetVersion:input_type -> google.protobuf.Empty + 13, // 4: ethereum.eth.v1alpha1.Node.SyncStatus:input_type -> google.protobuf.Empty + 13, // 5: ethereum.eth.v1alpha1.Node.Genesis:input_type -> google.protobuf.Empty + 13, // 6: ethereum.eth.v1alpha1.Node.Version:input_type -> google.protobuf.Empty 2, // 7: ethereum.eth.v1alpha1.Node.GetHealth:input_type -> ethereum.eth.v1alpha1.HealthRequest 13, // 8: ethereum.eth.v1alpha1.Node.ListImplementedServices:input_type -> google.protobuf.Empty 13, // 9: ethereum.eth.v1alpha1.Node.GetHost:input_type -> google.protobuf.Empty 7, // 10: ethereum.eth.v1alpha1.Node.GetPeer:input_type -> ethereum.eth.v1alpha1.PeerRequest - 13, // 11: ethereum.eth.v1alpha1.Node.ListPeers:input_type -> google.protobuf.Empty + 13, // 11: ethereum.eth.v1alpha1.Node.Peers:input_type -> google.protobuf.Empty 13, // 12: ethereum.eth.v1alpha1.Node.GetETH1ConnectionStatus:input_type -> google.protobuf.Empty - 3, // 13: ethereum.eth.v1alpha1.Node.GetSyncStatus:output_type -> ethereum.eth.v1alpha1.SyncStatus - 4, // 14: ethereum.eth.v1alpha1.Node.GetGenesis:output_type -> ethereum.eth.v1alpha1.Genesis - 5, // 15: ethereum.eth.v1alpha1.Node.GetVersion:output_type -> ethereum.eth.v1alpha1.Version + 3, // 13: ethereum.eth.v1alpha1.Node.SyncStatus:output_type -> ethereum.eth.v1alpha1.SyncStatus + 4, // 14: ethereum.eth.v1alpha1.Node.Genesis:output_type -> ethereum.eth.v1alpha1.Genesis + 5, // 15: ethereum.eth.v1alpha1.Node.Version:output_type -> ethereum.eth.v1alpha1.Version 13, // 16: ethereum.eth.v1alpha1.Node.GetHealth:output_type -> google.protobuf.Empty 6, // 17: ethereum.eth.v1alpha1.Node.ListImplementedServices:output_type -> ethereum.eth.v1alpha1.ImplementedServices 10, // 18: ethereum.eth.v1alpha1.Node.GetHost:output_type -> ethereum.eth.v1alpha1.HostData 9, // 19: ethereum.eth.v1alpha1.Node.GetPeer:output_type -> ethereum.eth.v1alpha1.Peer - 8, // 20: ethereum.eth.v1alpha1.Node.ListPeers:output_type -> ethereum.eth.v1alpha1.Peers + 8, // 20: ethereum.eth.v1alpha1.Node.Peers:output_type -> ethereum.eth.v1alpha1.Peers 11, // 21: ethereum.eth.v1alpha1.Node.GetETH1ConnectionStatus:output_type -> ethereum.eth.v1alpha1.ETH1ConnectionStatus 13, // [13:22] is the sub-list for method output_type 4, // [4:13] is the sub-list for method input_type @@ -1101,7 +1101,7 @@ func NewNodeClient(cc grpc.ClientConnInterface) NodeClient { func (c *nodeClient) GetSyncStatus(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*SyncStatus, error) { out := new(SyncStatus) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Node/GetSyncStatus", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Node/SyncStatus", in, out, opts...) if err != nil { return nil, err } @@ -1110,7 +1110,7 @@ func (c *nodeClient) GetSyncStatus(ctx context.Context, in *emptypb.Empty, opts func (c *nodeClient) GetGenesis(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Genesis, error) { out := new(Genesis) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Node/GetGenesis", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Node/Genesis", in, out, opts...) if err != nil { return nil, err } @@ -1119,7 +1119,7 @@ func (c *nodeClient) GetGenesis(ctx context.Context, in *emptypb.Empty, opts ... func (c *nodeClient) GetVersion(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Version, error) { out := new(Version) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Node/GetVersion", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Node/Version", in, out, opts...) if err != nil { return nil, err } @@ -1164,7 +1164,7 @@ func (c *nodeClient) GetPeer(ctx context.Context, in *PeerRequest, opts ...grpc. func (c *nodeClient) ListPeers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Peers, error) { out := new(Peers) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Node/ListPeers", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Node/Peers", in, out, opts...) if err != nil { return nil, err } @@ -1198,13 +1198,13 @@ type UnimplementedNodeServer struct { } func (*UnimplementedNodeServer) GetSyncStatus(context.Context, *emptypb.Empty) (*SyncStatus, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSyncStatus not implemented") + return nil, status.Errorf(codes.Unimplemented, "method SyncStatus not implemented") } func (*UnimplementedNodeServer) GetGenesis(context.Context, *emptypb.Empty) (*Genesis, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetGenesis not implemented") + return nil, status.Errorf(codes.Unimplemented, "method Genesis not implemented") } func (*UnimplementedNodeServer) GetVersion(context.Context, *emptypb.Empty) (*Version, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented") + return nil, status.Errorf(codes.Unimplemented, "method Version not implemented") } func (*UnimplementedNodeServer) GetHealth(context.Context, *HealthRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method GetHealth not implemented") @@ -1219,7 +1219,7 @@ func (*UnimplementedNodeServer) GetPeer(context.Context, *PeerRequest) (*Peer, e return nil, status.Errorf(codes.Unimplemented, "method GetPeer not implemented") } func (*UnimplementedNodeServer) ListPeers(context.Context, *emptypb.Empty) (*Peers, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListPeers not implemented") + return nil, status.Errorf(codes.Unimplemented, "method Peers not implemented") } func (*UnimplementedNodeServer) GetETH1ConnectionStatus(context.Context, *emptypb.Empty) (*ETH1ConnectionStatus, error) { return nil, status.Errorf(codes.Unimplemented, "method GetETH1ConnectionStatus not implemented") @@ -1239,7 +1239,7 @@ func _Node_GetSyncStatus_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.Node/GetSyncStatus", + FullMethod: "/ethereum.eth.v1alpha1.Node/SyncStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NodeServer).GetSyncStatus(ctx, req.(*emptypb.Empty)) @@ -1257,7 +1257,7 @@ func _Node_GetGenesis_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.Node/GetGenesis", + FullMethod: "/ethereum.eth.v1alpha1.Node/Genesis", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NodeServer).GetGenesis(ctx, req.(*emptypb.Empty)) @@ -1275,7 +1275,7 @@ func _Node_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.Node/GetVersion", + FullMethod: "/ethereum.eth.v1alpha1.Node/Version", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NodeServer).GetVersion(ctx, req.(*emptypb.Empty)) @@ -1365,7 +1365,7 @@ func _Node_ListPeers_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.Node/ListPeers", + FullMethod: "/ethereum.eth.v1alpha1.Node/Peers", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NodeServer).ListPeers(ctx, req.(*emptypb.Empty)) @@ -1396,15 +1396,15 @@ var _Node_serviceDesc = grpc.ServiceDesc{ HandlerType: (*NodeServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "GetSyncStatus", + MethodName: "SyncStatus", Handler: _Node_GetSyncStatus_Handler, }, { - MethodName: "GetGenesis", + MethodName: "Genesis", Handler: _Node_GetGenesis_Handler, }, { - MethodName: "GetVersion", + MethodName: "Version", Handler: _Node_GetVersion_Handler, }, { @@ -1424,7 +1424,7 @@ var _Node_serviceDesc = grpc.ServiceDesc{ Handler: _Node_GetPeer_Handler, }, { - MethodName: "ListPeers", + MethodName: "Peers", Handler: _Node_ListPeers_Handler, }, { diff --git a/proto/prysm/v1alpha1/node.pb.gw.go b/proto/prysm/v1alpha1/node.pb.gw.go index 104633765f54..5a2bc2da2b36 100755 --- a/proto/prysm/v1alpha1/node.pb.gw.go +++ b/proto/prysm/v1alpha1/node.pb.gw.go @@ -245,7 +245,7 @@ func RegisterNodeHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetSyncStatus") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/SyncStatus") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -268,7 +268,7 @@ func RegisterNodeHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetGenesis") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/Genesis") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -291,7 +291,7 @@ func RegisterNodeHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetVersion") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/Version") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -406,7 +406,7 @@ func RegisterNodeHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/ListPeers") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/Peers") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -491,7 +491,7 @@ func RegisterNodeHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetSyncStatus") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/SyncStatus") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -511,7 +511,7 @@ func RegisterNodeHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetGenesis") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/Genesis") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -531,7 +531,7 @@ func RegisterNodeHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetVersion") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/Version") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -631,7 +631,7 @@ func RegisterNodeHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/ListPeers") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/Peers") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return diff --git a/proto/prysm/v1alpha1/validator.pb.go b/proto/prysm/v1alpha1/validator.pb.go index c88f93a09fd0..dccecb9634b4 100755 --- a/proto/prysm/v1alpha1/validator.pb.go +++ b/proto/prysm/v1alpha1/validator.pb.go @@ -4025,56 +4025,56 @@ var file_proto_prysm_v1alpha1_validator_proto_depIdxs = []int32{ 58, // 19: ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsRequest.msgs:type_name -> ethereum.eth.v1alpha1.SyncCommitteeMessage 16, // 20: ethereum.eth.v1alpha1.ValidatorActivationResponse.Status.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatusResponse 0, // 21: ethereum.eth.v1alpha1.DutiesResponse.Duty.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatus - 19, // 22: ethereum.eth.v1alpha1.BeaconNodeValidator.GetDuties:input_type -> ethereum.eth.v1alpha1.DutiesRequest + 19, // 22: ethereum.eth.v1alpha1.BeaconNodeValidator.Duties:input_type -> ethereum.eth.v1alpha1.DutiesRequest 7, // 23: ethereum.eth.v1alpha1.BeaconNodeValidator.DomainData:input_type -> ethereum.eth.v1alpha1.DomainRequest 59, // 24: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForChainStart:input_type -> google.protobuf.Empty 9, // 25: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForActivation:input_type -> ethereum.eth.v1alpha1.ValidatorActivationRequest 13, // 26: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorIndex:input_type -> ethereum.eth.v1alpha1.ValidatorIndexRequest 15, // 27: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorStatus:input_type -> ethereum.eth.v1alpha1.ValidatorStatusRequest 17, // 28: ethereum.eth.v1alpha1.BeaconNodeValidator.MultipleValidatorStatus:input_type -> ethereum.eth.v1alpha1.MultipleValidatorStatusRequest - 21, // 29: ethereum.eth.v1alpha1.BeaconNodeValidator.GetBeaconBlock:input_type -> ethereum.eth.v1alpha1.BlockRequest + 21, // 29: ethereum.eth.v1alpha1.BeaconNodeValidator.BeaconBlock:input_type -> ethereum.eth.v1alpha1.BlockRequest 60, // 30: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeBeaconBlock:input_type -> ethereum.eth.v1alpha1.GenericSignedBeaconBlock 38, // 31: ethereum.eth.v1alpha1.BeaconNodeValidator.PrepareBeaconProposer:input_type -> ethereum.eth.v1alpha1.PrepareBeaconProposerRequest - 39, // 32: ethereum.eth.v1alpha1.BeaconNodeValidator.GetFeeRecipientByPubKey:input_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyRequest - 24, // 33: ethereum.eth.v1alpha1.BeaconNodeValidator.GetAttestationData:input_type -> ethereum.eth.v1alpha1.AttestationDataRequest + 39, // 32: ethereum.eth.v1alpha1.BeaconNodeValidator.FeeRecipientByPubKey:input_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyRequest + 24, // 33: ethereum.eth.v1alpha1.BeaconNodeValidator.AttestationData:input_type -> ethereum.eth.v1alpha1.AttestationDataRequest 61, // 34: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestation:input_type -> ethereum.eth.v1alpha1.Attestation 26, // 35: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProof:input_type -> ethereum.eth.v1alpha1.AggregateSelectionRequest 28, // 36: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProof:input_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitRequest 62, // 37: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeExit:input_type -> ethereum.eth.v1alpha1.SignedVoluntaryExit 30, // 38: ethereum.eth.v1alpha1.BeaconNodeValidator.SubscribeCommitteeSubnets:input_type -> ethereum.eth.v1alpha1.CommitteeSubnetsSubscribeRequest 34, // 39: ethereum.eth.v1alpha1.BeaconNodeValidator.CheckDoppelGanger:input_type -> ethereum.eth.v1alpha1.DoppelGangerRequest - 59, // 40: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncMessageBlockRoot:input_type -> google.protobuf.Empty + 59, // 40: ethereum.eth.v1alpha1.BeaconNodeValidator.SyncMessageBlockRoot:input_type -> google.protobuf.Empty 58, // 41: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSyncMessage:input_type -> ethereum.eth.v1alpha1.SyncCommitteeMessage - 2, // 42: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncSubcommitteeIndex:input_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexRequest - 3, // 43: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:input_type -> ethereum.eth.v1alpha1.SyncCommitteeContributionRequest + 2, // 42: ethereum.eth.v1alpha1.BeaconNodeValidator.SyncSubcommitteeIndex:input_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexRequest + 3, // 43: ethereum.eth.v1alpha1.BeaconNodeValidator.SyncCommitteeContribution:input_type -> ethereum.eth.v1alpha1.SyncCommitteeContributionRequest 63, // 44: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:input_type -> ethereum.eth.v1alpha1.SignedContributionAndProof 36, // 45: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamSlots:input_type -> ethereum.eth.v1alpha1.StreamSlotsRequest 37, // 46: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:input_type -> ethereum.eth.v1alpha1.StreamBlocksRequest 64, // 47: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistrations:input_type -> ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1 41, // 48: ethereum.eth.v1alpha1.BeaconNodeValidator.AssignValidatorToSubnet:input_type -> ethereum.eth.v1alpha1.AssignValidatorToSubnetRequest 42, // 49: ethereum.eth.v1alpha1.BeaconNodeValidator.AggregatedSigAndAggregationBits:input_type -> ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsRequest - 20, // 50: ethereum.eth.v1alpha1.BeaconNodeValidator.GetDuties:output_type -> ethereum.eth.v1alpha1.DutiesResponse + 20, // 50: ethereum.eth.v1alpha1.BeaconNodeValidator.Duties:output_type -> ethereum.eth.v1alpha1.DutiesResponse 8, // 51: ethereum.eth.v1alpha1.BeaconNodeValidator.DomainData:output_type -> ethereum.eth.v1alpha1.DomainResponse 11, // 52: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForChainStart:output_type -> ethereum.eth.v1alpha1.ChainStartResponse 10, // 53: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForActivation:output_type -> ethereum.eth.v1alpha1.ValidatorActivationResponse 14, // 54: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorIndex:output_type -> ethereum.eth.v1alpha1.ValidatorIndexResponse 16, // 55: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorStatus:output_type -> ethereum.eth.v1alpha1.ValidatorStatusResponse 18, // 56: ethereum.eth.v1alpha1.BeaconNodeValidator.MultipleValidatorStatus:output_type -> ethereum.eth.v1alpha1.MultipleValidatorStatusResponse - 65, // 57: ethereum.eth.v1alpha1.BeaconNodeValidator.GetBeaconBlock:output_type -> ethereum.eth.v1alpha1.GenericBeaconBlock + 65, // 57: ethereum.eth.v1alpha1.BeaconNodeValidator.BeaconBlock:output_type -> ethereum.eth.v1alpha1.GenericBeaconBlock 22, // 58: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeBeaconBlock:output_type -> ethereum.eth.v1alpha1.ProposeResponse 59, // 59: ethereum.eth.v1alpha1.BeaconNodeValidator.PrepareBeaconProposer:output_type -> google.protobuf.Empty - 40, // 60: ethereum.eth.v1alpha1.BeaconNodeValidator.GetFeeRecipientByPubKey:output_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyResponse - 66, // 61: ethereum.eth.v1alpha1.BeaconNodeValidator.GetAttestationData:output_type -> ethereum.eth.v1alpha1.AttestationData + 40, // 60: ethereum.eth.v1alpha1.BeaconNodeValidator.FeeRecipientByPubKey:output_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyResponse + 66, // 61: ethereum.eth.v1alpha1.BeaconNodeValidator.AttestationData:output_type -> ethereum.eth.v1alpha1.AttestationData 25, // 62: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestation:output_type -> ethereum.eth.v1alpha1.AttestResponse 27, // 63: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.AggregateSelectionResponse 29, // 64: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitResponse 23, // 65: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeExit:output_type -> ethereum.eth.v1alpha1.ProposeExitResponse 59, // 66: ethereum.eth.v1alpha1.BeaconNodeValidator.SubscribeCommitteeSubnets:output_type -> google.protobuf.Empty 35, // 67: ethereum.eth.v1alpha1.BeaconNodeValidator.CheckDoppelGanger:output_type -> ethereum.eth.v1alpha1.DoppelGangerResponse - 1, // 68: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncMessageBlockRoot:output_type -> ethereum.eth.v1alpha1.SyncMessageBlockRootResponse + 1, // 68: ethereum.eth.v1alpha1.BeaconNodeValidator.SyncMessageBlockRoot:output_type -> ethereum.eth.v1alpha1.SyncMessageBlockRootResponse 59, // 69: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSyncMessage:output_type -> google.protobuf.Empty - 4, // 70: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncSubcommitteeIndex:output_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexResponse - 67, // 71: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:output_type -> ethereum.eth.v1alpha1.SyncCommitteeContribution + 4, // 70: ethereum.eth.v1alpha1.BeaconNodeValidator.SyncSubcommitteeIndex:output_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexResponse + 67, // 71: ethereum.eth.v1alpha1.BeaconNodeValidator.SyncCommitteeContribution:output_type -> ethereum.eth.v1alpha1.SyncCommitteeContribution 59, // 72: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:output_type -> google.protobuf.Empty 5, // 73: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamSlots:output_type -> ethereum.eth.v1alpha1.StreamSlotsResponse 6, // 74: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:output_type -> ethereum.eth.v1alpha1.StreamBlocksResponse @@ -4758,7 +4758,7 @@ func NewBeaconNodeValidatorClient(cc grpc.ClientConnInterface) BeaconNodeValidat func (c *beaconNodeValidatorClient) GetDuties(ctx context.Context, in *DutiesRequest, opts ...grpc.CallOption) (*DutiesResponse, error) { out := new(DutiesResponse) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetDuties", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/Duties", in, out, opts...) if err != nil { return nil, err } @@ -4868,7 +4868,7 @@ func (c *beaconNodeValidatorClient) MultipleValidatorStatus(ctx context.Context, func (c *beaconNodeValidatorClient) GetBeaconBlock(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (*GenericBeaconBlock, error) { out := new(GenericBeaconBlock) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetBeaconBlock", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/BeaconBlock", in, out, opts...) if err != nil { return nil, err } @@ -4895,7 +4895,7 @@ func (c *beaconNodeValidatorClient) PrepareBeaconProposer(ctx context.Context, i func (c *beaconNodeValidatorClient) GetFeeRecipientByPubKey(ctx context.Context, in *FeeRecipientByPubKeyRequest, opts ...grpc.CallOption) (*FeeRecipientByPubKeyResponse, error) { out := new(FeeRecipientByPubKeyResponse) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetFeeRecipientByPubKey", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/FeeRecipientByPubKey", in, out, opts...) if err != nil { return nil, err } @@ -4904,7 +4904,7 @@ func (c *beaconNodeValidatorClient) GetFeeRecipientByPubKey(ctx context.Context, func (c *beaconNodeValidatorClient) GetAttestationData(ctx context.Context, in *AttestationDataRequest, opts ...grpc.CallOption) (*AttestationData, error) { out := new(AttestationData) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetAttestationData", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/AttestationData", in, out, opts...) if err != nil { return nil, err } @@ -4967,7 +4967,7 @@ func (c *beaconNodeValidatorClient) CheckDoppelGanger(ctx context.Context, in *D func (c *beaconNodeValidatorClient) GetSyncMessageBlockRoot(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*SyncMessageBlockRootResponse, error) { out := new(SyncMessageBlockRootResponse) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncMessageBlockRoot", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncMessageBlockRoot", in, out, opts...) if err != nil { return nil, err } @@ -4985,7 +4985,7 @@ func (c *beaconNodeValidatorClient) SubmitSyncMessage(ctx context.Context, in *S func (c *beaconNodeValidatorClient) GetSyncSubcommitteeIndex(ctx context.Context, in *SyncSubcommitteeIndexRequest, opts ...grpc.CallOption) (*SyncSubcommitteeIndexResponse, error) { out := new(SyncSubcommitteeIndexResponse) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncSubcommitteeIndex", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncSubcommitteeIndex", in, out, opts...) if err != nil { return nil, err } @@ -4994,7 +4994,7 @@ func (c *beaconNodeValidatorClient) GetSyncSubcommitteeIndex(ctx context.Context func (c *beaconNodeValidatorClient) GetSyncCommitteeContribution(ctx context.Context, in *SyncCommitteeContributionRequest, opts ...grpc.CallOption) (*SyncCommitteeContribution, error) { out := new(SyncCommitteeContribution) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncCommitteeContribution", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncCommitteeContribution", in, out, opts...) if err != nil { return nil, err } @@ -5143,7 +5143,7 @@ type UnimplementedBeaconNodeValidatorServer struct { } func (*UnimplementedBeaconNodeValidatorServer) GetDuties(context.Context, *DutiesRequest) (*DutiesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetDuties not implemented") + return nil, status.Errorf(codes.Unimplemented, "method Duties not implemented") } func (*UnimplementedBeaconNodeValidatorServer) DomainData(context.Context, *DomainRequest) (*DomainResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DomainData not implemented") @@ -5164,7 +5164,7 @@ func (*UnimplementedBeaconNodeValidatorServer) MultipleValidatorStatus(context.C return nil, status.Errorf(codes.Unimplemented, "method MultipleValidatorStatus not implemented") } func (*UnimplementedBeaconNodeValidatorServer) GetBeaconBlock(context.Context, *BlockRequest) (*GenericBeaconBlock, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetBeaconBlock not implemented") + return nil, status.Errorf(codes.Unimplemented, "method BeaconBlock not implemented") } func (*UnimplementedBeaconNodeValidatorServer) ProposeBeaconBlock(context.Context, *GenericSignedBeaconBlock) (*ProposeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ProposeBeaconBlock not implemented") @@ -5173,10 +5173,10 @@ func (*UnimplementedBeaconNodeValidatorServer) PrepareBeaconProposer(context.Con return nil, status.Errorf(codes.Unimplemented, "method PrepareBeaconProposer not implemented") } func (*UnimplementedBeaconNodeValidatorServer) GetFeeRecipientByPubKey(context.Context, *FeeRecipientByPubKeyRequest) (*FeeRecipientByPubKeyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetFeeRecipientByPubKey not implemented") + return nil, status.Errorf(codes.Unimplemented, "method FeeRecipientByPubKey not implemented") } func (*UnimplementedBeaconNodeValidatorServer) GetAttestationData(context.Context, *AttestationDataRequest) (*AttestationData, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetAttestationData not implemented") + return nil, status.Errorf(codes.Unimplemented, "method AttestationData not implemented") } func (*UnimplementedBeaconNodeValidatorServer) ProposeAttestation(context.Context, *Attestation) (*AttestResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ProposeAttestation not implemented") @@ -5197,16 +5197,16 @@ func (*UnimplementedBeaconNodeValidatorServer) CheckDoppelGanger(context.Context return nil, status.Errorf(codes.Unimplemented, "method CheckDoppelGanger not implemented") } func (*UnimplementedBeaconNodeValidatorServer) GetSyncMessageBlockRoot(context.Context, *emptypb.Empty) (*SyncMessageBlockRootResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSyncMessageBlockRoot not implemented") + return nil, status.Errorf(codes.Unimplemented, "method SyncMessageBlockRoot not implemented") } func (*UnimplementedBeaconNodeValidatorServer) SubmitSyncMessage(context.Context, *SyncCommitteeMessage) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitSyncMessage not implemented") } func (*UnimplementedBeaconNodeValidatorServer) GetSyncSubcommitteeIndex(context.Context, *SyncSubcommitteeIndexRequest) (*SyncSubcommitteeIndexResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSyncSubcommitteeIndex not implemented") + return nil, status.Errorf(codes.Unimplemented, "method SyncSubcommitteeIndex not implemented") } func (*UnimplementedBeaconNodeValidatorServer) GetSyncCommitteeContribution(context.Context, *SyncCommitteeContributionRequest) (*SyncCommitteeContribution, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetSyncCommitteeContribution not implemented") + return nil, status.Errorf(codes.Unimplemented, "method SyncCommitteeContribution not implemented") } func (*UnimplementedBeaconNodeValidatorServer) SubmitSignedContributionAndProof(context.Context, *SignedContributionAndProof) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitSignedContributionAndProof not implemented") @@ -5241,7 +5241,7 @@ func _BeaconNodeValidator_GetDuties_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetDuties", + FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/Duties", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BeaconNodeValidatorServer).GetDuties(ctx, req.(*DutiesRequest)) @@ -5373,7 +5373,7 @@ func _BeaconNodeValidator_GetBeaconBlock_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetBeaconBlock", + FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/BeaconBlock", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BeaconNodeValidatorServer).GetBeaconBlock(ctx, req.(*BlockRequest)) @@ -5427,7 +5427,7 @@ func _BeaconNodeValidator_GetFeeRecipientByPubKey_Handler(srv interface{}, ctx c } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetFeeRecipientByPubKey", + FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/FeeRecipientByPubKey", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BeaconNodeValidatorServer).GetFeeRecipientByPubKey(ctx, req.(*FeeRecipientByPubKeyRequest)) @@ -5445,7 +5445,7 @@ func _BeaconNodeValidator_GetAttestationData_Handler(srv interface{}, ctx contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetAttestationData", + FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/AttestationData", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BeaconNodeValidatorServer).GetAttestationData(ctx, req.(*AttestationDataRequest)) @@ -5571,7 +5571,7 @@ func _BeaconNodeValidator_GetSyncMessageBlockRoot_Handler(srv interface{}, ctx c } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncMessageBlockRoot", + FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncMessageBlockRoot", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BeaconNodeValidatorServer).GetSyncMessageBlockRoot(ctx, req.(*emptypb.Empty)) @@ -5607,7 +5607,7 @@ func _BeaconNodeValidator_GetSyncSubcommitteeIndex_Handler(srv interface{}, ctx } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncSubcommitteeIndex", + FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncSubcommitteeIndex", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BeaconNodeValidatorServer).GetSyncSubcommitteeIndex(ctx, req.(*SyncSubcommitteeIndexRequest)) @@ -5625,7 +5625,7 @@ func _BeaconNodeValidator_GetSyncCommitteeContribution_Handler(srv interface{}, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncCommitteeContribution", + FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncCommitteeContribution", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BeaconNodeValidatorServer).GetSyncCommitteeContribution(ctx, req.(*SyncCommitteeContributionRequest)) @@ -5752,7 +5752,7 @@ var _BeaconNodeValidator_serviceDesc = grpc.ServiceDesc{ HandlerType: (*BeaconNodeValidatorServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "GetDuties", + MethodName: "Duties", Handler: _BeaconNodeValidator_GetDuties_Handler, }, { @@ -5772,7 +5772,7 @@ var _BeaconNodeValidator_serviceDesc = grpc.ServiceDesc{ Handler: _BeaconNodeValidator_MultipleValidatorStatus_Handler, }, { - MethodName: "GetBeaconBlock", + MethodName: "BeaconBlock", Handler: _BeaconNodeValidator_GetBeaconBlock_Handler, }, { @@ -5784,11 +5784,11 @@ var _BeaconNodeValidator_serviceDesc = grpc.ServiceDesc{ Handler: _BeaconNodeValidator_PrepareBeaconProposer_Handler, }, { - MethodName: "GetFeeRecipientByPubKey", + MethodName: "FeeRecipientByPubKey", Handler: _BeaconNodeValidator_GetFeeRecipientByPubKey_Handler, }, { - MethodName: "GetAttestationData", + MethodName: "AttestationData", Handler: _BeaconNodeValidator_GetAttestationData_Handler, }, { @@ -5816,7 +5816,7 @@ var _BeaconNodeValidator_serviceDesc = grpc.ServiceDesc{ Handler: _BeaconNodeValidator_CheckDoppelGanger_Handler, }, { - MethodName: "GetSyncMessageBlockRoot", + MethodName: "SyncMessageBlockRoot", Handler: _BeaconNodeValidator_GetSyncMessageBlockRoot_Handler, }, { @@ -5824,11 +5824,11 @@ var _BeaconNodeValidator_serviceDesc = grpc.ServiceDesc{ Handler: _BeaconNodeValidator_SubmitSyncMessage_Handler, }, { - MethodName: "GetSyncSubcommitteeIndex", + MethodName: "SyncSubcommitteeIndex", Handler: _BeaconNodeValidator_GetSyncSubcommitteeIndex_Handler, }, { - MethodName: "GetSyncCommitteeContribution", + MethodName: "SyncCommitteeContribution", Handler: _BeaconNodeValidator_GetSyncCommitteeContribution_Handler, }, { diff --git a/proto/prysm/v1alpha1/validator.pb.gw.go b/proto/prysm/v1alpha1/validator.pb.gw.go index b5a85384e7a0..ec4b762d202a 100755 --- a/proto/prysm/v1alpha1/validator.pb.gw.go +++ b/proto/prysm/v1alpha1/validator.pb.gw.go @@ -968,7 +968,7 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime. var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetDuties") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/Duties") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1097,7 +1097,7 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime. var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetBeaconBlock") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/BeaconBlock") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1166,7 +1166,7 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime. var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetFeeRecipientByPubKey") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/FeeRecipientByPubKey") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1189,7 +1189,7 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime. var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetAttestationData") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/AttestationData") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1350,7 +1350,7 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime. var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncMessageBlockRoot") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncMessageBlockRoot") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1396,7 +1396,7 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime. var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncSubcommitteeIndex") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncSubcommitteeIndex") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1419,7 +1419,7 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime. var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncCommitteeContribution") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncCommitteeContribution") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1587,7 +1587,7 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime. ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetDuties") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/Duties") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1727,7 +1727,7 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime. ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetBeaconBlock") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/BeaconBlock") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1787,7 +1787,7 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime. ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetFeeRecipientByPubKey") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/FeeRecipientByPubKey") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1807,7 +1807,7 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime. ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetAttestationData") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/AttestationData") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1947,7 +1947,7 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime. ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncMessageBlockRoot") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncMessageBlockRoot") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1987,7 +1987,7 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime. ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncSubcommitteeIndex") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncSubcommitteeIndex") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2007,7 +2007,7 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime. ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncCommitteeContribution") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncCommitteeContribution") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return diff --git a/testing/mock/beacon_service_mock.go b/testing/mock/beacon_service_mock.go index 78bf69ec1165..9f0181fad4b8 100644 --- a/testing/mock/beacon_service_mock.go +++ b/testing/mock/beacon_service_mock.go @@ -89,7 +89,7 @@ func (m *MockBeaconChainClient) GetChainHead(arg0 context.Context, arg1 *emptypb for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "GetChainHead", varargs...) + ret := m.ctrl.Call(m, "ChainHead", varargs...) ret0, _ := ret[0].(*eth.ChainHead) ret1, _ := ret[1].(error) return ret0, ret1 @@ -99,7 +99,7 @@ func (m *MockBeaconChainClient) GetChainHead(arg0 context.Context, arg1 *emptypb func (mr *MockBeaconChainClientMockRecorder) GetChainHead(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChainHead", reflect.TypeOf((*MockBeaconChainClient)(nil).GetChainHead), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainHead", reflect.TypeOf((*MockBeaconChainClient)(nil).GetChainHead), varargs...) } // GetIndividualVotes mocks base method. @@ -169,7 +169,7 @@ func (m *MockBeaconChainClient) GetValidatorParticipation(arg0 context.Context, for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "GetValidatorParticipation", varargs...) + ret := m.ctrl.Call(m, "ValidatorParticipation", varargs...) ret0, _ := ret[0].(*eth.ValidatorParticipationResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -179,7 +179,7 @@ func (m *MockBeaconChainClient) GetValidatorParticipation(arg0 context.Context, func (mr *MockBeaconChainClientMockRecorder) GetValidatorParticipation(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorParticipation", reflect.TypeOf((*MockBeaconChainClient)(nil).GetValidatorParticipation), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorParticipation", reflect.TypeOf((*MockBeaconChainClient)(nil).GetValidatorParticipation), varargs...) } // GetValidatorPerformance mocks base method. @@ -189,7 +189,7 @@ func (m *MockBeaconChainClient) GetValidatorPerformance(arg0 context.Context, ar for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "GetValidatorPerformance", varargs...) + ret := m.ctrl.Call(m, "ValidatorPerformance", varargs...) ret0, _ := ret[0].(*eth.ValidatorPerformanceResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -199,7 +199,7 @@ func (m *MockBeaconChainClient) GetValidatorPerformance(arg0 context.Context, ar func (mr *MockBeaconChainClientMockRecorder) GetValidatorPerformance(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorPerformance", reflect.TypeOf((*MockBeaconChainClient)(nil).GetValidatorPerformance), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorPerformance", reflect.TypeOf((*MockBeaconChainClient)(nil).GetValidatorPerformance), varargs...) } // GetValidatorQueue mocks base method. @@ -209,7 +209,7 @@ func (m *MockBeaconChainClient) GetValidatorQueue(arg0 context.Context, arg1 *em for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "GetValidatorQueue", varargs...) + ret := m.ctrl.Call(m, "ValidatorQueue", varargs...) ret0, _ := ret[0].(*eth.ValidatorQueue) ret1, _ := ret[1].(error) return ret0, ret1 @@ -219,7 +219,7 @@ func (m *MockBeaconChainClient) GetValidatorQueue(arg0 context.Context, arg1 *em func (mr *MockBeaconChainClientMockRecorder) GetValidatorQueue(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorQueue", reflect.TypeOf((*MockBeaconChainClient)(nil).GetValidatorQueue), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorQueue", reflect.TypeOf((*MockBeaconChainClient)(nil).GetValidatorQueue), varargs...) } // ListAttestations mocks base method. @@ -329,7 +329,7 @@ func (m *MockBeaconChainClient) ListValidatorBalances(arg0 context.Context, arg1 for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "ListValidatorBalances", varargs...) + ret := m.ctrl.Call(m, "ValidatorBalances", varargs...) ret0, _ := ret[0].(*eth.ValidatorBalances) ret1, _ := ret[1].(error) return ret0, ret1 @@ -339,7 +339,7 @@ func (m *MockBeaconChainClient) ListValidatorBalances(arg0 context.Context, arg1 func (mr *MockBeaconChainClientMockRecorder) ListValidatorBalances(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListValidatorBalances", reflect.TypeOf((*MockBeaconChainClient)(nil).ListValidatorBalances), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorBalances", reflect.TypeOf((*MockBeaconChainClient)(nil).ListValidatorBalances), varargs...) } // ListValidators mocks base method. @@ -349,7 +349,7 @@ func (m *MockBeaconChainClient) ListValidators(arg0 context.Context, arg1 *eth.L for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "ListValidators", varargs...) + ret := m.ctrl.Call(m, "Validators", varargs...) ret0, _ := ret[0].(*eth.Validators) ret1, _ := ret[1].(error) return ret0, ret1 @@ -359,7 +359,7 @@ func (m *MockBeaconChainClient) ListValidators(arg0 context.Context, arg1 *eth.L func (mr *MockBeaconChainClientMockRecorder) ListValidators(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListValidators", reflect.TypeOf((*MockBeaconChainClient)(nil).ListValidators), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Validators", reflect.TypeOf((*MockBeaconChainClient)(nil).ListValidators), varargs...) } // SubmitAttesterSlashing mocks base method. diff --git a/testing/mock/beacon_validator_client_mock.go b/testing/mock/beacon_validator_client_mock.go index bed03fb8f49c..7b3c13a02686 100644 --- a/testing/mock/beacon_validator_client_mock.go +++ b/testing/mock/beacon_validator_client_mock.go @@ -130,7 +130,7 @@ func (m *MockBeaconNodeValidatorClient) GetAttestationData(arg0 context.Context, for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "GetAttestationData", varargs...) + ret := m.ctrl.Call(m, "AttestationData", varargs...) ret0, _ := ret[0].(*eth.AttestationData) ret1, _ := ret[1].(error) return ret0, ret1 @@ -140,7 +140,7 @@ func (m *MockBeaconNodeValidatorClient) GetAttestationData(arg0 context.Context, func (mr *MockBeaconNodeValidatorClientMockRecorder) GetAttestationData(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAttestationData", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetAttestationData), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AttestationData", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetAttestationData), varargs...) } // GetBeaconBlock mocks base method. @@ -150,7 +150,7 @@ func (m *MockBeaconNodeValidatorClient) GetBeaconBlock(arg0 context.Context, arg for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "GetBeaconBlock", varargs...) + ret := m.ctrl.Call(m, "BeaconBlock", varargs...) ret0, _ := ret[0].(*eth.GenericBeaconBlock) ret1, _ := ret[1].(error) return ret0, ret1 @@ -160,7 +160,7 @@ func (m *MockBeaconNodeValidatorClient) GetBeaconBlock(arg0 context.Context, arg func (mr *MockBeaconNodeValidatorClientMockRecorder) GetBeaconBlock(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBeaconBlock", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetBeaconBlock), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeaconBlock", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetBeaconBlock), varargs...) } // GetDuties mocks base method. @@ -170,7 +170,7 @@ func (m *MockBeaconNodeValidatorClient) GetDuties(arg0 context.Context, arg1 *et for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "GetDuties", varargs...) + ret := m.ctrl.Call(m, "Duties", varargs...) ret0, _ := ret[0].(*eth.DutiesResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -180,7 +180,7 @@ func (m *MockBeaconNodeValidatorClient) GetDuties(arg0 context.Context, arg1 *et func (mr *MockBeaconNodeValidatorClientMockRecorder) GetDuties(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDuties", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetDuties), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Duties", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetDuties), varargs...) } // GetFeeRecipientByPubKey mocks base method. @@ -190,7 +190,7 @@ func (m *MockBeaconNodeValidatorClient) GetFeeRecipientByPubKey(arg0 context.Con for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "GetFeeRecipientByPubKey", varargs...) + ret := m.ctrl.Call(m, "FeeRecipientByPubKey", varargs...) ret0, _ := ret[0].(*eth.FeeRecipientByPubKeyResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -200,7 +200,7 @@ func (m *MockBeaconNodeValidatorClient) GetFeeRecipientByPubKey(arg0 context.Con func (mr *MockBeaconNodeValidatorClientMockRecorder) GetFeeRecipientByPubKey(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFeeRecipientByPubKey", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetFeeRecipientByPubKey), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FeeRecipientByPubKey", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetFeeRecipientByPubKey), varargs...) } // GetSyncCommitteeContribution mocks base method. @@ -210,7 +210,7 @@ func (m *MockBeaconNodeValidatorClient) GetSyncCommitteeContribution(arg0 contex for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "GetSyncCommitteeContribution", varargs...) + ret := m.ctrl.Call(m, "SyncCommitteeContribution", varargs...) ret0, _ := ret[0].(*eth.SyncCommitteeContribution) ret1, _ := ret[1].(error) return ret0, ret1 @@ -220,7 +220,7 @@ func (m *MockBeaconNodeValidatorClient) GetSyncCommitteeContribution(arg0 contex func (mr *MockBeaconNodeValidatorClientMockRecorder) GetSyncCommitteeContribution(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncCommitteeContribution", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetSyncCommitteeContribution), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncCommitteeContribution", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetSyncCommitteeContribution), varargs...) } // GetSyncMessageBlockRoot mocks base method. @@ -230,7 +230,7 @@ func (m *MockBeaconNodeValidatorClient) GetSyncMessageBlockRoot(arg0 context.Con for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "GetSyncMessageBlockRoot", varargs...) + ret := m.ctrl.Call(m, "SyncMessageBlockRoot", varargs...) ret0, _ := ret[0].(*eth.SyncMessageBlockRootResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -240,7 +240,7 @@ func (m *MockBeaconNodeValidatorClient) GetSyncMessageBlockRoot(arg0 context.Con func (mr *MockBeaconNodeValidatorClientMockRecorder) GetSyncMessageBlockRoot(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncMessageBlockRoot", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetSyncMessageBlockRoot), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncMessageBlockRoot", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetSyncMessageBlockRoot), varargs...) } // GetSyncSubcommitteeIndex mocks base method. @@ -250,7 +250,7 @@ func (m *MockBeaconNodeValidatorClient) GetSyncSubcommitteeIndex(arg0 context.Co for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "GetSyncSubcommitteeIndex", varargs...) + ret := m.ctrl.Call(m, "SyncSubcommitteeIndex", varargs...) ret0, _ := ret[0].(*eth.SyncSubcommitteeIndexResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -260,7 +260,7 @@ func (m *MockBeaconNodeValidatorClient) GetSyncSubcommitteeIndex(arg0 context.Co func (mr *MockBeaconNodeValidatorClientMockRecorder) GetSyncSubcommitteeIndex(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncSubcommitteeIndex", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetSyncSubcommitteeIndex), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncSubcommitteeIndex", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetSyncSubcommitteeIndex), varargs...) } // MultipleValidatorStatus mocks base method. diff --git a/testing/mock/beacon_validator_server_mock.go b/testing/mock/beacon_validator_server_mock.go index c1722b39eaf7..aa343b948d4f 100644 --- a/testing/mock/beacon_validator_server_mock.go +++ b/testing/mock/beacon_validator_server_mock.go @@ -105,7 +105,7 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) DomainData(arg0, arg1 any) // GetAttestationData mocks base method. func (m *MockBeaconNodeValidatorServer) GetAttestationData(arg0 context.Context, arg1 *eth.AttestationDataRequest) (*eth.AttestationData, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAttestationData", arg0, arg1) + ret := m.ctrl.Call(m, "AttestationData", arg0, arg1) ret0, _ := ret[0].(*eth.AttestationData) ret1, _ := ret[1].(error) return ret0, ret1 @@ -114,13 +114,13 @@ func (m *MockBeaconNodeValidatorServer) GetAttestationData(arg0 context.Context, // GetAttestationData indicates an expected call of GetAttestationData. func (mr *MockBeaconNodeValidatorServerMockRecorder) GetAttestationData(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAttestationData", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetAttestationData), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AttestationData", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetAttestationData), arg0, arg1) } // GetBeaconBlock mocks base method. func (m *MockBeaconNodeValidatorServer) GetBeaconBlock(arg0 context.Context, arg1 *eth.BlockRequest) (*eth.GenericBeaconBlock, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetBeaconBlock", arg0, arg1) + ret := m.ctrl.Call(m, "BeaconBlock", arg0, arg1) ret0, _ := ret[0].(*eth.GenericBeaconBlock) ret1, _ := ret[1].(error) return ret0, ret1 @@ -129,13 +129,13 @@ func (m *MockBeaconNodeValidatorServer) GetBeaconBlock(arg0 context.Context, arg // GetBeaconBlock indicates an expected call of GetBeaconBlock. func (mr *MockBeaconNodeValidatorServerMockRecorder) GetBeaconBlock(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBeaconBlock", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetBeaconBlock), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeaconBlock", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetBeaconBlock), arg0, arg1) } // GetDuties mocks base method. func (m *MockBeaconNodeValidatorServer) GetDuties(arg0 context.Context, arg1 *eth.DutiesRequest) (*eth.DutiesResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetDuties", arg0, arg1) + ret := m.ctrl.Call(m, "Duties", arg0, arg1) ret0, _ := ret[0].(*eth.DutiesResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -144,13 +144,13 @@ func (m *MockBeaconNodeValidatorServer) GetDuties(arg0 context.Context, arg1 *et // GetDuties indicates an expected call of GetDuties. func (mr *MockBeaconNodeValidatorServerMockRecorder) GetDuties(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDuties", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetDuties), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Duties", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetDuties), arg0, arg1) } // GetFeeRecipientByPubKey mocks base method. func (m *MockBeaconNodeValidatorServer) GetFeeRecipientByPubKey(arg0 context.Context, arg1 *eth.FeeRecipientByPubKeyRequest) (*eth.FeeRecipientByPubKeyResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetFeeRecipientByPubKey", arg0, arg1) + ret := m.ctrl.Call(m, "FeeRecipientByPubKey", arg0, arg1) ret0, _ := ret[0].(*eth.FeeRecipientByPubKeyResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -159,13 +159,13 @@ func (m *MockBeaconNodeValidatorServer) GetFeeRecipientByPubKey(arg0 context.Con // GetFeeRecipientByPubKey indicates an expected call of GetFeeRecipientByPubKey. func (mr *MockBeaconNodeValidatorServerMockRecorder) GetFeeRecipientByPubKey(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFeeRecipientByPubKey", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetFeeRecipientByPubKey), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FeeRecipientByPubKey", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetFeeRecipientByPubKey), arg0, arg1) } // GetSyncCommitteeContribution mocks base method. func (m *MockBeaconNodeValidatorServer) GetSyncCommitteeContribution(arg0 context.Context, arg1 *eth.SyncCommitteeContributionRequest) (*eth.SyncCommitteeContribution, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSyncCommitteeContribution", arg0, arg1) + ret := m.ctrl.Call(m, "SyncCommitteeContribution", arg0, arg1) ret0, _ := ret[0].(*eth.SyncCommitteeContribution) ret1, _ := ret[1].(error) return ret0, ret1 @@ -174,13 +174,13 @@ func (m *MockBeaconNodeValidatorServer) GetSyncCommitteeContribution(arg0 contex // GetSyncCommitteeContribution indicates an expected call of GetSyncCommitteeContribution. func (mr *MockBeaconNodeValidatorServerMockRecorder) GetSyncCommitteeContribution(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncCommitteeContribution", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetSyncCommitteeContribution), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncCommitteeContribution", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetSyncCommitteeContribution), arg0, arg1) } // GetSyncMessageBlockRoot mocks base method. func (m *MockBeaconNodeValidatorServer) GetSyncMessageBlockRoot(arg0 context.Context, arg1 *emptypb.Empty) (*eth.SyncMessageBlockRootResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSyncMessageBlockRoot", arg0, arg1) + ret := m.ctrl.Call(m, "SyncMessageBlockRoot", arg0, arg1) ret0, _ := ret[0].(*eth.SyncMessageBlockRootResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -189,13 +189,13 @@ func (m *MockBeaconNodeValidatorServer) GetSyncMessageBlockRoot(arg0 context.Con // GetSyncMessageBlockRoot indicates an expected call of GetSyncMessageBlockRoot. func (mr *MockBeaconNodeValidatorServerMockRecorder) GetSyncMessageBlockRoot(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncMessageBlockRoot", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetSyncMessageBlockRoot), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncMessageBlockRoot", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetSyncMessageBlockRoot), arg0, arg1) } // GetSyncSubcommitteeIndex mocks base method. func (m *MockBeaconNodeValidatorServer) GetSyncSubcommitteeIndex(arg0 context.Context, arg1 *eth.SyncSubcommitteeIndexRequest) (*eth.SyncSubcommitteeIndexResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSyncSubcommitteeIndex", arg0, arg1) + ret := m.ctrl.Call(m, "SyncSubcommitteeIndex", arg0, arg1) ret0, _ := ret[0].(*eth.SyncSubcommitteeIndexResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -204,7 +204,7 @@ func (m *MockBeaconNodeValidatorServer) GetSyncSubcommitteeIndex(arg0 context.Co // GetSyncSubcommitteeIndex indicates an expected call of GetSyncSubcommitteeIndex. func (mr *MockBeaconNodeValidatorServerMockRecorder) GetSyncSubcommitteeIndex(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncSubcommitteeIndex", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetSyncSubcommitteeIndex), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncSubcommitteeIndex", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetSyncSubcommitteeIndex), arg0, arg1) } // MultipleValidatorStatus mocks base method. diff --git a/testing/mock/node_service_mock.go b/testing/mock/node_service_mock.go index 57a0cde054f6..582398484354 100644 --- a/testing/mock/node_service_mock.go +++ b/testing/mock/node_service_mock.go @@ -69,7 +69,7 @@ func (m *MockNodeClient) GetGenesis(arg0 context.Context, arg1 *emptypb.Empty, a for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "GetGenesis", varargs...) + ret := m.ctrl.Call(m, "Genesis", varargs...) ret0, _ := ret[0].(*eth.Genesis) ret1, _ := ret[1].(error) return ret0, ret1 @@ -79,7 +79,7 @@ func (m *MockNodeClient) GetGenesis(arg0 context.Context, arg1 *emptypb.Empty, a func (mr *MockNodeClientMockRecorder) GetGenesis(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGenesis", reflect.TypeOf((*MockNodeClient)(nil).GetGenesis), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Genesis", reflect.TypeOf((*MockNodeClient)(nil).GetGenesis), varargs...) } // GetHost mocks base method. @@ -129,7 +129,7 @@ func (m *MockNodeClient) GetSyncStatus(arg0 context.Context, arg1 *emptypb.Empty for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "GetSyncStatus", varargs...) + ret := m.ctrl.Call(m, "SyncStatus", varargs...) ret0, _ := ret[0].(*eth.SyncStatus) ret1, _ := ret[1].(error) return ret0, ret1 @@ -139,7 +139,7 @@ func (m *MockNodeClient) GetSyncStatus(arg0 context.Context, arg1 *emptypb.Empty func (mr *MockNodeClientMockRecorder) GetSyncStatus(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncStatus", reflect.TypeOf((*MockNodeClient)(nil).GetSyncStatus), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncStatus", reflect.TypeOf((*MockNodeClient)(nil).GetSyncStatus), varargs...) } // GetVersion mocks base method. @@ -149,7 +149,7 @@ func (m *MockNodeClient) GetVersion(arg0 context.Context, arg1 *emptypb.Empty, a for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "GetVersion", varargs...) + ret := m.ctrl.Call(m, "Version", varargs...) ret0, _ := ret[0].(*eth.Version) ret1, _ := ret[1].(error) return ret0, ret1 @@ -159,7 +159,7 @@ func (m *MockNodeClient) GetVersion(arg0 context.Context, arg1 *emptypb.Empty, a func (mr *MockNodeClientMockRecorder) GetVersion(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVersion", reflect.TypeOf((*MockNodeClient)(nil).GetVersion), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Version", reflect.TypeOf((*MockNodeClient)(nil).GetVersion), varargs...) } // ListImplementedServices mocks base method. @@ -189,7 +189,7 @@ func (m *MockNodeClient) ListPeers(arg0 context.Context, arg1 *emptypb.Empty, ar for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "ListPeers", varargs...) + ret := m.ctrl.Call(m, "Peers", varargs...) ret0, _ := ret[0].(*eth.Peers) ret1, _ := ret[1].(error) return ret0, ret1 @@ -199,5 +199,5 @@ func (m *MockNodeClient) ListPeers(arg0 context.Context, arg1 *emptypb.Empty, ar func (mr *MockNodeClientMockRecorder) ListPeers(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPeers", reflect.TypeOf((*MockNodeClient)(nil).ListPeers), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Peers", reflect.TypeOf((*MockNodeClient)(nil).ListPeers), varargs...) } diff --git a/testing/validator-mock/chain_client_mock.go b/testing/validator-mock/chain_client_mock.go index 0b10bcf7d810..d12ab76e98cf 100644 --- a/testing/validator-mock/chain_client_mock.go +++ b/testing/validator-mock/chain_client_mock.go @@ -42,9 +42,9 @@ func (m *MockChainClient) EXPECT() *MockChainClientMockRecorder { } // GetChainHead mocks base method. -func (m *MockChainClient) GetChainHead(arg0 context.Context, arg1 *emptypb.Empty) (*eth.ChainHead, error) { +func (m *MockChainClient) ChainHead(arg0 context.Context, arg1 *emptypb.Empty) (*eth.ChainHead, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetChainHead", arg0, arg1) + ret := m.ctrl.Call(m, "ChainHead", arg0, arg1) ret0, _ := ret[0].(*eth.ChainHead) ret1, _ := ret[1].(error) return ret0, ret1 @@ -53,13 +53,13 @@ func (m *MockChainClient) GetChainHead(arg0 context.Context, arg1 *emptypb.Empty // GetChainHead indicates an expected call of GetChainHead. func (mr *MockChainClientMockRecorder) GetChainHead(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChainHead", reflect.TypeOf((*MockChainClient)(nil).GetChainHead), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainHead", reflect.TypeOf((*MockChainClient)(nil).ChainHead), arg0, arg1) } // GetValidatorParticipation mocks base method. -func (m *MockChainClient) GetValidatorParticipation(arg0 context.Context, arg1 *eth.GetValidatorParticipationRequest) (*eth.ValidatorParticipationResponse, error) { +func (m *MockChainClient) ValidatorParticipation(arg0 context.Context, arg1 *eth.GetValidatorParticipationRequest) (*eth.ValidatorParticipationResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetValidatorParticipation", arg0, arg1) + ret := m.ctrl.Call(m, "ValidatorParticipation", arg0, arg1) ret0, _ := ret[0].(*eth.ValidatorParticipationResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -68,13 +68,13 @@ func (m *MockChainClient) GetValidatorParticipation(arg0 context.Context, arg1 * // GetValidatorParticipation indicates an expected call of GetValidatorParticipation. func (mr *MockChainClientMockRecorder) GetValidatorParticipation(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorParticipation", reflect.TypeOf((*MockChainClient)(nil).GetValidatorParticipation), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorParticipation", reflect.TypeOf((*MockChainClient)(nil).ValidatorParticipation), arg0, arg1) } // GetValidatorPerformance mocks base method. -func (m *MockChainClient) GetValidatorPerformance(arg0 context.Context, arg1 *eth.ValidatorPerformanceRequest) (*eth.ValidatorPerformanceResponse, error) { +func (m *MockChainClient) ValidatorPerformance(arg0 context.Context, arg1 *eth.ValidatorPerformanceRequest) (*eth.ValidatorPerformanceResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetValidatorPerformance", arg0, arg1) + ret := m.ctrl.Call(m, "ValidatorPerformance", arg0, arg1) ret0, _ := ret[0].(*eth.ValidatorPerformanceResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -83,13 +83,13 @@ func (m *MockChainClient) GetValidatorPerformance(arg0 context.Context, arg1 *et // GetValidatorPerformance indicates an expected call of GetValidatorPerformance. func (mr *MockChainClientMockRecorder) GetValidatorPerformance(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorPerformance", reflect.TypeOf((*MockChainClient)(nil).GetValidatorPerformance), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorPerformance", reflect.TypeOf((*MockChainClient)(nil).ValidatorPerformance), arg0, arg1) } // GetValidatorQueue mocks base method. -func (m *MockChainClient) GetValidatorQueue(arg0 context.Context, arg1 *emptypb.Empty) (*eth.ValidatorQueue, error) { +func (m *MockChainClient) ValidatorQueue(arg0 context.Context, arg1 *emptypb.Empty) (*eth.ValidatorQueue, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetValidatorQueue", arg0, arg1) + ret := m.ctrl.Call(m, "ValidatorQueue", arg0, arg1) ret0, _ := ret[0].(*eth.ValidatorQueue) ret1, _ := ret[1].(error) return ret0, ret1 @@ -98,13 +98,13 @@ func (m *MockChainClient) GetValidatorQueue(arg0 context.Context, arg1 *emptypb. // GetValidatorQueue indicates an expected call of GetValidatorQueue. func (mr *MockChainClientMockRecorder) GetValidatorQueue(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorQueue", reflect.TypeOf((*MockChainClient)(nil).GetValidatorQueue), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorQueue", reflect.TypeOf((*MockChainClient)(nil).ValidatorQueue), arg0, arg1) } // ListValidatorBalances mocks base method. -func (m *MockChainClient) ListValidatorBalances(arg0 context.Context, arg1 *eth.ListValidatorBalancesRequest) (*eth.ValidatorBalances, error) { +func (m *MockChainClient) ValidatorBalances(arg0 context.Context, arg1 *eth.ListValidatorBalancesRequest) (*eth.ValidatorBalances, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListValidatorBalances", arg0, arg1) + ret := m.ctrl.Call(m, "ValidatorBalances", arg0, arg1) ret0, _ := ret[0].(*eth.ValidatorBalances) ret1, _ := ret[1].(error) return ret0, ret1 @@ -113,13 +113,13 @@ func (m *MockChainClient) ListValidatorBalances(arg0 context.Context, arg1 *eth. // ListValidatorBalances indicates an expected call of ListValidatorBalances. func (mr *MockChainClientMockRecorder) ListValidatorBalances(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListValidatorBalances", reflect.TypeOf((*MockChainClient)(nil).ListValidatorBalances), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorBalances", reflect.TypeOf((*MockChainClient)(nil).ValidatorBalances), arg0, arg1) } // ListValidators mocks base method. -func (m *MockChainClient) ListValidators(arg0 context.Context, arg1 *eth.ListValidatorsRequest) (*eth.Validators, error) { +func (m *MockChainClient) Validators(arg0 context.Context, arg1 *eth.ListValidatorsRequest) (*eth.Validators, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListValidators", arg0, arg1) + ret := m.ctrl.Call(m, "Validators", arg0, arg1) ret0, _ := ret[0].(*eth.Validators) ret1, _ := ret[1].(error) return ret0, ret1 @@ -128,5 +128,5 @@ func (m *MockChainClient) ListValidators(arg0 context.Context, arg1 *eth.ListVal // ListValidators indicates an expected call of ListValidators. func (mr *MockChainClientMockRecorder) ListValidators(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListValidators", reflect.TypeOf((*MockChainClient)(nil).ListValidators), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Validators", reflect.TypeOf((*MockChainClient)(nil).Validators), arg0, arg1) } diff --git a/testing/validator-mock/node_client_mock.go b/testing/validator-mock/node_client_mock.go index 337b8e22465e..27fc25bce8fc 100644 --- a/testing/validator-mock/node_client_mock.go +++ b/testing/validator-mock/node_client_mock.go @@ -45,9 +45,9 @@ func (m *MockNodeClient) EXPECT() *MockNodeClientMockRecorder { } // GetGenesis mocks base method. -func (m *MockNodeClient) GetGenesis(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Genesis, error) { +func (m *MockNodeClient) Genesis(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Genesis, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetGenesis", arg0, arg1) + ret := m.ctrl.Call(m, "Genesis", arg0, arg1) ret0, _ := ret[0].(*eth.Genesis) ret1, _ := ret[1].(error) return ret0, ret1 @@ -56,13 +56,13 @@ func (m *MockNodeClient) GetGenesis(arg0 context.Context, arg1 *emptypb.Empty) ( // GetGenesis indicates an expected call of GetGenesis. func (mr *MockNodeClientMockRecorder) GetGenesis(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGenesis", reflect.TypeOf((*MockNodeClient)(nil).GetGenesis), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Genesis", reflect.TypeOf((*MockNodeClient)(nil).Genesis), arg0, arg1) } // GetSyncStatus mocks base method. -func (m *MockNodeClient) GetSyncStatus(arg0 context.Context, arg1 *emptypb.Empty) (*eth.SyncStatus, error) { +func (m *MockNodeClient) SyncStatus(arg0 context.Context, arg1 *emptypb.Empty) (*eth.SyncStatus, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSyncStatus", arg0, arg1) + ret := m.ctrl.Call(m, "SyncStatus", arg0, arg1) ret0, _ := ret[0].(*eth.SyncStatus) ret1, _ := ret[1].(error) return ret0, ret1 @@ -71,13 +71,13 @@ func (m *MockNodeClient) GetSyncStatus(arg0 context.Context, arg1 *emptypb.Empty // GetSyncStatus indicates an expected call of GetSyncStatus. func (mr *MockNodeClientMockRecorder) GetSyncStatus(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncStatus", reflect.TypeOf((*MockNodeClient)(nil).GetSyncStatus), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncStatus", reflect.TypeOf((*MockNodeClient)(nil).SyncStatus), arg0, arg1) } // GetVersion mocks base method. -func (m *MockNodeClient) GetVersion(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Version, error) { +func (m *MockNodeClient) Version(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Version, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetVersion", arg0, arg1) + ret := m.ctrl.Call(m, "Version", arg0, arg1) ret0, _ := ret[0].(*eth.Version) ret1, _ := ret[1].(error) return ret0, ret1 @@ -86,7 +86,7 @@ func (m *MockNodeClient) GetVersion(arg0 context.Context, arg1 *emptypb.Empty) ( // GetVersion indicates an expected call of GetVersion. func (mr *MockNodeClientMockRecorder) GetVersion(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVersion", reflect.TypeOf((*MockNodeClient)(nil).GetVersion), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Version", reflect.TypeOf((*MockNodeClient)(nil).Version), arg0, arg1) } // IsHealthy mocks base method. @@ -104,9 +104,9 @@ func (mr *MockNodeClientMockRecorder) IsHealthy(arg0 any) *gomock.Call { } // ListPeers mocks base method. -func (m *MockNodeClient) ListPeers(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Peers, error) { +func (m *MockNodeClient) Peers(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Peers, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListPeers", arg0, arg1) + ret := m.ctrl.Call(m, "Peers", arg0, arg1) ret0, _ := ret[0].(*eth.Peers) ret1, _ := ret[1].(error) return ret0, ret1 @@ -115,7 +115,7 @@ func (m *MockNodeClient) ListPeers(arg0 context.Context, arg1 *emptypb.Empty) (* // ListPeers indicates an expected call of ListPeers. func (mr *MockNodeClientMockRecorder) ListPeers(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPeers", reflect.TypeOf((*MockNodeClient)(nil).ListPeers), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Peers", reflect.TypeOf((*MockNodeClient)(nil).Peers), arg0, arg1) } func (m *MockNodeClient) HealthTracker() *beacon.NodeHealthTracker { diff --git a/testing/validator-mock/prysm_chain_client_mock.go b/testing/validator-mock/prysm_chain_client_mock.go index 330af4c503ee..135c9540100f 100644 --- a/testing/validator-mock/prysm_chain_client_mock.go +++ b/testing/validator-mock/prysm_chain_client_mock.go @@ -37,9 +37,9 @@ func (m *MockPrysmChainClient) EXPECT() *MockPrysmChainClientMockRecorder { } // GetValidatorCount mocks base method. -func (m *MockPrysmChainClient) GetValidatorCount(arg0 context.Context, arg1 string, arg2 []validator.Status) ([]iface.ValidatorCount, error) { +func (m *MockPrysmChainClient) ValidatorCount(arg0 context.Context, arg1 string, arg2 []validator.Status) ([]iface.ValidatorCount, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetValidatorCount", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "ValidatorCount", arg0, arg1, arg2) ret0, _ := ret[0].([]iface.ValidatorCount) ret1, _ := ret[1].(error) return ret0, ret1 @@ -48,5 +48,5 @@ func (m *MockPrysmChainClient) GetValidatorCount(arg0 context.Context, arg1 stri // GetValidatorCount indicates an expected call of GetValidatorCount. func (mr *MockPrysmChainClientMockRecorder) GetValidatorCount(arg0, arg1, arg2 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorCount", reflect.TypeOf((*MockPrysmChainClient)(nil).GetValidatorCount), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorCount", reflect.TypeOf((*MockPrysmChainClient)(nil).ValidatorCount), arg0, arg1, arg2) } diff --git a/testing/validator-mock/validator_client_mock.go b/testing/validator-mock/validator_client_mock.go index 7af1aee9a0de..757071964512 100644 --- a/testing/validator-mock/validator_client_mock.go +++ b/testing/validator-mock/validator_client_mock.go @@ -89,9 +89,9 @@ func (mr *MockValidatorClientMockRecorder) EventStreamIsRunning() *gomock.Call { } // GetAggregatedSelections mocks base method. -func (m *MockValidatorClient) GetAggregatedSelections(arg0 context.Context, arg1 []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { +func (m *MockValidatorClient) AggregatedSelections(arg0 context.Context, arg1 []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAggregatedSelections", arg0, arg1) + ret := m.ctrl.Call(m, "AggregatedSelections", arg0, arg1) ret0, _ := ret[0].([]iface.BeaconCommitteeSelection) ret1, _ := ret[1].(error) return ret0, ret1 @@ -100,13 +100,13 @@ func (m *MockValidatorClient) GetAggregatedSelections(arg0 context.Context, arg1 // GetAggregatedSelections indicates an expected call of GetAggregatedSelections. func (mr *MockValidatorClientMockRecorder) GetAggregatedSelections(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAggregatedSelections", reflect.TypeOf((*MockValidatorClient)(nil).GetAggregatedSelections), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AggregatedSelections", reflect.TypeOf((*MockValidatorClient)(nil).AggregatedSelections), arg0, arg1) } // GetAggregatedSyncSelections mocks base method. -func (m *MockValidatorClient) GetAggregatedSyncSelections(arg0 context.Context, arg1 []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { +func (m *MockValidatorClient) AggregatedSyncSelections(arg0 context.Context, arg1 []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAggregatedSyncSelections", arg0, arg1) + ret := m.ctrl.Call(m, "AggregatedSyncSelections", arg0, arg1) ret0, _ := ret[0].([]iface.SyncCommitteeSelection) ret1, _ := ret[1].(error) return ret0, ret1 @@ -115,13 +115,13 @@ func (m *MockValidatorClient) GetAggregatedSyncSelections(arg0 context.Context, // GetAggregatedSyncSelections indicates an expected call of GetAggregatedSyncSelections. func (mr *MockValidatorClientMockRecorder) GetAggregatedSyncSelections(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAggregatedSyncSelections", reflect.TypeOf((*MockValidatorClient)(nil).GetAggregatedSyncSelections), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AggregatedSyncSelections", reflect.TypeOf((*MockValidatorClient)(nil).AggregatedSyncSelections), arg0, arg1) } // GetAttestationData mocks base method. -func (m *MockValidatorClient) GetAttestationData(arg0 context.Context, arg1 *eth.AttestationDataRequest) (*eth.AttestationData, error) { +func (m *MockValidatorClient) AttestationData(arg0 context.Context, arg1 *eth.AttestationDataRequest) (*eth.AttestationData, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAttestationData", arg0, arg1) + ret := m.ctrl.Call(m, "AttestationData", arg0, arg1) ret0, _ := ret[0].(*eth.AttestationData) ret1, _ := ret[1].(error) return ret0, ret1 @@ -130,13 +130,13 @@ func (m *MockValidatorClient) GetAttestationData(arg0 context.Context, arg1 *eth // GetAttestationData indicates an expected call of GetAttestationData. func (mr *MockValidatorClientMockRecorder) GetAttestationData(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAttestationData", reflect.TypeOf((*MockValidatorClient)(nil).GetAttestationData), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AttestationData", reflect.TypeOf((*MockValidatorClient)(nil).AttestationData), arg0, arg1) } // GetBeaconBlock mocks base method. -func (m *MockValidatorClient) GetBeaconBlock(arg0 context.Context, arg1 *eth.BlockRequest) (*eth.GenericBeaconBlock, error) { +func (m *MockValidatorClient) BeaconBlock(arg0 context.Context, arg1 *eth.BlockRequest) (*eth.GenericBeaconBlock, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetBeaconBlock", arg0, arg1) + ret := m.ctrl.Call(m, "BeaconBlock", arg0, arg1) ret0, _ := ret[0].(*eth.GenericBeaconBlock) ret1, _ := ret[1].(error) return ret0, ret1 @@ -145,13 +145,13 @@ func (m *MockValidatorClient) GetBeaconBlock(arg0 context.Context, arg1 *eth.Blo // GetBeaconBlock indicates an expected call of GetBeaconBlock. func (mr *MockValidatorClientMockRecorder) GetBeaconBlock(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBeaconBlock", reflect.TypeOf((*MockValidatorClient)(nil).GetBeaconBlock), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeaconBlock", reflect.TypeOf((*MockValidatorClient)(nil).BeaconBlock), arg0, arg1) } // GetDuties mocks base method. -func (m *MockValidatorClient) GetDuties(arg0 context.Context, arg1 *eth.DutiesRequest) (*eth.DutiesResponse, error) { +func (m *MockValidatorClient) Duties(arg0 context.Context, arg1 *eth.DutiesRequest) (*eth.DutiesResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetDuties", arg0, arg1) + ret := m.ctrl.Call(m, "Duties", arg0, arg1) ret0, _ := ret[0].(*eth.DutiesResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -160,13 +160,13 @@ func (m *MockValidatorClient) GetDuties(arg0 context.Context, arg1 *eth.DutiesRe // GetDuties indicates an expected call of GetDuties. func (mr *MockValidatorClientMockRecorder) GetDuties(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDuties", reflect.TypeOf((*MockValidatorClient)(nil).GetDuties), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Duties", reflect.TypeOf((*MockValidatorClient)(nil).Duties), arg0, arg1) } // GetFeeRecipientByPubKey mocks base method. -func (m *MockValidatorClient) GetFeeRecipientByPubKey(arg0 context.Context, arg1 *eth.FeeRecipientByPubKeyRequest) (*eth.FeeRecipientByPubKeyResponse, error) { +func (m *MockValidatorClient) FeeRecipientByPubKey(arg0 context.Context, arg1 *eth.FeeRecipientByPubKeyRequest) (*eth.FeeRecipientByPubKeyResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetFeeRecipientByPubKey", arg0, arg1) + ret := m.ctrl.Call(m, "FeeRecipientByPubKey", arg0, arg1) ret0, _ := ret[0].(*eth.FeeRecipientByPubKeyResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -175,13 +175,13 @@ func (m *MockValidatorClient) GetFeeRecipientByPubKey(arg0 context.Context, arg1 // GetFeeRecipientByPubKey indicates an expected call of GetFeeRecipientByPubKey. func (mr *MockValidatorClientMockRecorder) GetFeeRecipientByPubKey(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFeeRecipientByPubKey", reflect.TypeOf((*MockValidatorClient)(nil).GetFeeRecipientByPubKey), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FeeRecipientByPubKey", reflect.TypeOf((*MockValidatorClient)(nil).FeeRecipientByPubKey), arg0, arg1) } // GetSyncCommitteeContribution mocks base method. -func (m *MockValidatorClient) GetSyncCommitteeContribution(arg0 context.Context, arg1 *eth.SyncCommitteeContributionRequest) (*eth.SyncCommitteeContribution, error) { +func (m *MockValidatorClient) SyncCommitteeContribution(arg0 context.Context, arg1 *eth.SyncCommitteeContributionRequest) (*eth.SyncCommitteeContribution, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSyncCommitteeContribution", arg0, arg1) + ret := m.ctrl.Call(m, "SyncCommitteeContribution", arg0, arg1) ret0, _ := ret[0].(*eth.SyncCommitteeContribution) ret1, _ := ret[1].(error) return ret0, ret1 @@ -190,13 +190,13 @@ func (m *MockValidatorClient) GetSyncCommitteeContribution(arg0 context.Context, // GetSyncCommitteeContribution indicates an expected call of GetSyncCommitteeContribution. func (mr *MockValidatorClientMockRecorder) GetSyncCommitteeContribution(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncCommitteeContribution", reflect.TypeOf((*MockValidatorClient)(nil).GetSyncCommitteeContribution), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncCommitteeContribution", reflect.TypeOf((*MockValidatorClient)(nil).SyncCommitteeContribution), arg0, arg1) } // GetSyncMessageBlockRoot mocks base method. -func (m *MockValidatorClient) GetSyncMessageBlockRoot(arg0 context.Context, arg1 *emptypb.Empty) (*eth.SyncMessageBlockRootResponse, error) { +func (m *MockValidatorClient) SyncMessageBlockRoot(arg0 context.Context, arg1 *emptypb.Empty) (*eth.SyncMessageBlockRootResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSyncMessageBlockRoot", arg0, arg1) + ret := m.ctrl.Call(m, "SyncMessageBlockRoot", arg0, arg1) ret0, _ := ret[0].(*eth.SyncMessageBlockRootResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -205,13 +205,13 @@ func (m *MockValidatorClient) GetSyncMessageBlockRoot(arg0 context.Context, arg1 // GetSyncMessageBlockRoot indicates an expected call of GetSyncMessageBlockRoot. func (mr *MockValidatorClientMockRecorder) GetSyncMessageBlockRoot(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncMessageBlockRoot", reflect.TypeOf((*MockValidatorClient)(nil).GetSyncMessageBlockRoot), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncMessageBlockRoot", reflect.TypeOf((*MockValidatorClient)(nil).SyncMessageBlockRoot), arg0, arg1) } // GetSyncSubcommitteeIndex mocks base method. -func (m *MockValidatorClient) GetSyncSubcommitteeIndex(arg0 context.Context, arg1 *eth.SyncSubcommitteeIndexRequest) (*eth.SyncSubcommitteeIndexResponse, error) { +func (m *MockValidatorClient) SyncSubcommitteeIndex(arg0 context.Context, arg1 *eth.SyncSubcommitteeIndexRequest) (*eth.SyncSubcommitteeIndexResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSyncSubcommitteeIndex", arg0, arg1) + ret := m.ctrl.Call(m, "SyncSubcommitteeIndex", arg0, arg1) ret0, _ := ret[0].(*eth.SyncSubcommitteeIndexResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -220,7 +220,7 @@ func (m *MockValidatorClient) GetSyncSubcommitteeIndex(arg0 context.Context, arg // GetSyncSubcommitteeIndex indicates an expected call of GetSyncSubcommitteeIndex. func (mr *MockValidatorClientMockRecorder) GetSyncSubcommitteeIndex(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncSubcommitteeIndex", reflect.TypeOf((*MockValidatorClient)(nil).GetSyncSubcommitteeIndex), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncSubcommitteeIndex", reflect.TypeOf((*MockValidatorClient)(nil).SyncSubcommitteeIndex), arg0, arg1) } // MultipleValidatorStatus mocks base method. diff --git a/validator/accounts/accounts_exit.go b/validator/accounts/accounts_exit.go index 67f0b801ea0c..1750bae15b8b 100644 --- a/validator/accounts/accounts_exit.go +++ b/validator/accounts/accounts_exit.go @@ -47,7 +47,7 @@ func (acm *CLIManager) Exit(ctx context.Context) error { if nodeClient == nil { return errors.New("could not prepare beacon node client") } - syncStatus, err := (*nodeClient).GetSyncStatus(ctx, &emptypb.Empty{}) + syncStatus, err := (*nodeClient).SyncStatus(ctx, &emptypb.Empty{}) if err != nil { return err } @@ -81,7 +81,7 @@ func PerformVoluntaryExit( ctx context.Context, cfg PerformExitCfg, ) (rawExitedKeys [][]byte, formattedExitedKeys []string, err error) { var rawNotExitedKeys [][]byte - genesisResponse, err := cfg.NodeClient.GetGenesis(ctx, &emptypb.Empty{}) + genesisResponse, err := cfg.NodeClient.Genesis(ctx, &emptypb.Empty{}) if err != nil { log.WithError(err).Errorf("voluntary exit failed: %v", err) } diff --git a/validator/accounts/testing/mock.go b/validator/accounts/testing/mock.go index 3d5fccd86f74..dce08b9e6602 100644 --- a/validator/accounts/testing/mock.go +++ b/validator/accounts/testing/mock.go @@ -218,7 +218,7 @@ func (m *Validator) SetProposerSettings(_ context.Context, settings *proposer.Se } // GetGraffiti for mocking -func (m *Validator) GetGraffiti(_ context.Context, _ [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { +func (m *Validator) Graffiti(_ context.Context, _ [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { return []byte(m.graffiti), nil } diff --git a/validator/client/attest.go b/validator/client/attest.go index 42973c4b13b1..d5ace95f004a 100644 --- a/validator/client/attest.go +++ b/validator/client/attest.go @@ -75,7 +75,7 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot primitives.Slot, Slot: slot, CommitteeIndex: duty.CommitteeIndex, } - data, err := v.validatorClient.GetAttestationData(ctx, req) + data, err := v.validatorClient.AttestationData(ctx, req) if err != nil { log.WithError(err).Error("Could not request attestation to sign at slot") if v.emitAccountMetrics { diff --git a/validator/client/beacon-api/beacon_api_beacon_chain_client.go b/validator/client/beacon-api/beacon_api_beacon_chain_client.go index 0ed7607b33da..231969522b79 100644 --- a/validator/client/beacon-api/beacon_api_beacon_chain_client.go +++ b/validator/client/beacon-api/beacon_api_beacon_chain_client.go @@ -43,7 +43,7 @@ func (c beaconApiChainClient) getHeadBlockHeaders(ctx context.Context) (*structs return &blockHeader, nil } -func (c beaconApiChainClient) GetChainHead(ctx context.Context, _ *empty.Empty) (*ethpb.ChainHead, error) { +func (c beaconApiChainClient) ChainHead(ctx context.Context, _ *empty.Empty) (*ethpb.ChainHead, error) { const endpoint = "/eth/v1/beacon/states/head/finality_checkpoints" finalityCheckpoints := structs.GetFinalityCheckpointsResponse{} @@ -146,16 +146,16 @@ func (c beaconApiChainClient) GetChainHead(ctx context.Context, _ *empty.Empty) }, nil } -func (c beaconApiChainClient) ListValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) { +func (c beaconApiChainClient) ValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) { if c.fallbackClient != nil { - return c.fallbackClient.ListValidatorBalances(ctx, in) + return c.fallbackClient.ValidatorBalances(ctx, in) } // TODO: Implement me - panic("beaconApiChainClient.ListValidatorBalances is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.") + panic("beaconApiChainClient.ValidatorBalances is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.") } -func (c beaconApiChainClient) ListValidators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) { +func (c beaconApiChainClient) Validators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) { pageSize := in.PageSize // We follow the gRPC behavior here, which returns a maximum of 250 results when pageSize == 0 @@ -310,16 +310,16 @@ func (c beaconApiChainClient) ListValidators(ctx context.Context, in *ethpb.List }, nil } -func (c beaconApiChainClient) GetValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) { +func (c beaconApiChainClient) ValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) { if c.fallbackClient != nil { - return c.fallbackClient.GetValidatorQueue(ctx, in) + return c.fallbackClient.ValidatorQueue(ctx, in) } // TODO: Implement me - panic("beaconApiChainClient.GetValidatorQueue is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.") + panic("beaconApiChainClient.ValidatorQueue is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.") } -func (c beaconApiChainClient) GetValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) { +func (c beaconApiChainClient) ValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) { request, err := json.Marshal(structs.GetValidatorPerformanceRequest{ PublicKeys: in.PublicKeys, Indices: in.Indices, @@ -345,13 +345,13 @@ func (c beaconApiChainClient) GetValidatorPerformance(ctx context.Context, in *e }, nil } -func (c beaconApiChainClient) GetValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) { +func (c beaconApiChainClient) ValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) { if c.fallbackClient != nil { - return c.fallbackClient.GetValidatorParticipation(ctx, in) + return c.fallbackClient.ValidatorParticipation(ctx, in) } // TODO: Implement me - panic("beaconApiChainClient.GetValidatorParticipation is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.") + panic("beaconApiChainClient.ValidatorParticipation is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiChainClientWithFallback.") } func NewBeaconApiChainClientWithFallback(jsonRestHandler JsonRestHandler, fallbackClient iface.ChainClient) iface.ChainClient { diff --git a/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go b/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go index a7a32ecc2381..29579b826a73 100644 --- a/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go +++ b/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go @@ -32,7 +32,7 @@ func TestListValidators(t *testing.T) { ctx := context.Background() beaconChainClient := beaconApiChainClient{} - _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ + _, err := beaconChainClient.Validators(ctx, ðpb.ListValidatorsRequest{ PageToken: "foo", }) assert.ErrorContains(t, "failed to parse page token `foo`", err) @@ -44,7 +44,7 @@ func TestListValidators(t *testing.T) { ctx := context.Background() beaconChainClient := beaconApiChainClient{} - _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ + _, err := beaconChainClient.Validators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Epoch{ Epoch: math.MaxUint64, }, @@ -64,7 +64,7 @@ func TestListValidators(t *testing.T) { ) beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider} - _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ + _, err := beaconChainClient.Validators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Epoch{ Epoch: 0, }, @@ -84,7 +84,7 @@ func TestListValidators(t *testing.T) { ) beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider} - _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ + _, err := beaconChainClient.Validators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Genesis{}, }) assert.ErrorContains(t, "failed to get genesis state validators: bar error", err) @@ -102,7 +102,7 @@ func TestListValidators(t *testing.T) { ) beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider} - _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ + _, err := beaconChainClient.Validators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: nil, }) assert.ErrorContains(t, "failed to get head state validators: foo error", err) @@ -126,7 +126,7 @@ func TestListValidators(t *testing.T) { stateValidatorsProvider: stateValidatorsProvider, jsonRestHandler: jsonRestHandler, } - _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ + _, err := beaconChainClient.Validators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: nil, }) assert.ErrorContains(t, "bar error", err) @@ -204,7 +204,7 @@ func TestListValidators(t *testing.T) { stateValidatorsProvider: stateValidatorsProvider, jsonRestHandler: jsonRestHandler, } - _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ + _, err := beaconChainClient.Validators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: nil, }) assert.ErrorContains(t, testCase.expectedError, err) @@ -334,7 +334,7 @@ func TestListValidators(t *testing.T) { ) beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider} - _, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ + _, err := beaconChainClient.Validators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Genesis{}, }) assert.ErrorContains(t, testCase.expectedError, err) @@ -562,7 +562,7 @@ func TestListValidators(t *testing.T) { ) beaconChainClient := beaconApiChainClient{stateValidatorsProvider: stateValidatorsProvider} - validators, err := beaconChainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{ + validators, err := beaconChainClient.Validators(ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Genesis{}, PublicKeys: [][]byte{}, Indices: []primitives.ValidatorIndex{}, @@ -753,7 +753,7 @@ func TestGetChainHead(t *testing.T) { ) beaconChainClient := beaconApiChainClient{jsonRestHandler: jsonRestHandler} - _, err := beaconChainClient.GetChainHead(ctx, &emptypb.Empty{}) + _, err := beaconChainClient.ChainHead(ctx, &emptypb.Empty{}) assert.ErrorContains(t, testCase.expectedError, err) }) } @@ -860,7 +860,7 @@ func TestGetChainHead(t *testing.T) { ) beaconChainClient := beaconApiChainClient{jsonRestHandler: jsonRestHandler} - _, err := beaconChainClient.GetChainHead(ctx, &emptypb.Empty{}) + _, err := beaconChainClient.ChainHead(ctx, &emptypb.Empty{}) assert.ErrorContains(t, testCase.expectedError, err) }) } @@ -914,7 +914,7 @@ func TestGetChainHead(t *testing.T) { } beaconChainClient := beaconApiChainClient{jsonRestHandler: jsonRestHandler} - chainHead, err := beaconChainClient.GetChainHead(ctx, &emptypb.Empty{}) + chainHead, err := beaconChainClient.ChainHead(ctx, &emptypb.Empty{}) require.NoError(t, err) assert.DeepEqual(t, expectedChainHead, chainHead) }) @@ -953,7 +953,7 @@ func Test_beaconApiBeaconChainClient_GetValidatorPerformance(t *testing.T) { jsonRestHandler: jsonRestHandler, } - got, err := c.GetValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ + got, err := c.ValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ PublicKeys: [][]byte{publicKeys[0][:], publicKeys[2][:], publicKeys[1][:]}, }) require.NoError(t, err) diff --git a/validator/client/beacon-api/beacon_api_node_client.go b/validator/client/beacon-api/beacon_api_node_client.go index 6dd726b1ad4f..101e6da7f930 100644 --- a/validator/client/beacon-api/beacon_api_node_client.go +++ b/validator/client/beacon-api/beacon_api_node_client.go @@ -25,7 +25,7 @@ type beaconApiNodeClient struct { healthTracker *beacon.NodeHealthTracker } -func (c *beaconApiNodeClient) GetSyncStatus(ctx context.Context, _ *empty.Empty) (*ethpb.SyncStatus, error) { +func (c *beaconApiNodeClient) SyncStatus(ctx context.Context, _ *empty.Empty) (*ethpb.SyncStatus, error) { syncingResponse := structs.SyncStatusResponse{} if err := c.jsonRestHandler.Get(ctx, "/eth/v1/node/syncing", &syncingResponse); err != nil { return nil, err @@ -40,7 +40,7 @@ func (c *beaconApiNodeClient) GetSyncStatus(ctx context.Context, _ *empty.Empty) }, nil } -func (c *beaconApiNodeClient) GetGenesis(ctx context.Context, _ *empty.Empty) (*ethpb.Genesis, error) { +func (c *beaconApiNodeClient) Genesis(ctx context.Context, _ *empty.Empty) (*ethpb.Genesis, error) { genesisJson, err := c.genesisProvider.GetGenesis(ctx) if err != nil { return nil, errors.Wrap(err, "failed to get genesis") @@ -79,7 +79,7 @@ func (c *beaconApiNodeClient) GetGenesis(ctx context.Context, _ *empty.Empty) (* }, nil } -func (c *beaconApiNodeClient) GetVersion(ctx context.Context, _ *empty.Empty) (*ethpb.Version, error) { +func (c *beaconApiNodeClient) Version(ctx context.Context, _ *empty.Empty) (*ethpb.Version, error) { var versionResponse structs.GetVersionResponse if err := c.jsonRestHandler.Get(ctx, "/eth/v1/node/version", &versionResponse); err != nil { return nil, err @@ -94,13 +94,13 @@ func (c *beaconApiNodeClient) GetVersion(ctx context.Context, _ *empty.Empty) (* }, nil } -func (c *beaconApiNodeClient) ListPeers(ctx context.Context, in *empty.Empty) (*ethpb.Peers, error) { +func (c *beaconApiNodeClient) Peers(ctx context.Context, in *empty.Empty) (*ethpb.Peers, error) { if c.fallbackClient != nil { - return c.fallbackClient.ListPeers(ctx, in) + return c.fallbackClient.Peers(ctx, in) } // TODO: Implement me - panic("beaconApiNodeClient.ListPeers is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiNodeClientWithFallback.") + panic("beaconApiNodeClient.Peers is not implemented. To use a fallback client, pass a fallback client as the last argument of NewBeaconApiNodeClientWithFallback.") } func (c *beaconApiNodeClient) IsHealthy(ctx context.Context) bool { diff --git a/validator/client/beacon-api/beacon_api_node_client_test.go b/validator/client/beacon-api/beacon_api_node_client_test.go index 16c9f39715f3..7d564dc53cec 100644 --- a/validator/client/beacon-api/beacon_api_node_client_test.go +++ b/validator/client/beacon-api/beacon_api_node_client_test.go @@ -139,7 +139,7 @@ func TestGetGenesis(t *testing.T) { genesisProvider: genesisProvider, jsonRestHandler: jsonRestHandler, } - response, err := nodeClient.GetGenesis(ctx, &emptypb.Empty{}) + response, err := nodeClient.Genesis(ctx, &emptypb.Empty{}) if testCase.expectedResponse == nil { assert.ErrorContains(t, testCase.expectedError, err) @@ -214,7 +214,7 @@ func TestGetSyncStatus(t *testing.T) { ) nodeClient := &beaconApiNodeClient{jsonRestHandler: jsonRestHandler} - syncStatus, err := nodeClient.GetSyncStatus(ctx, &emptypb.Empty{}) + syncStatus, err := nodeClient.SyncStatus(ctx, &emptypb.Empty{}) if testCase.expectedResponse == nil { assert.ErrorContains(t, testCase.expectedError, err) @@ -278,7 +278,7 @@ func TestGetVersion(t *testing.T) { ) nodeClient := &beaconApiNodeClient{jsonRestHandler: jsonRestHandler} - version, err := nodeClient.GetVersion(ctx, &emptypb.Empty{}) + version, err := nodeClient.Version(ctx, &emptypb.Empty{}) if testCase.expectedResponse == nil { assert.ErrorContains(t, testCase.expectedError, err) diff --git a/validator/client/beacon-api/beacon_api_validator_client.go b/validator/client/beacon-api/beacon_api_validator_client.go index 43eb64d3726d..490500be8ff0 100644 --- a/validator/client/beacon-api/beacon_api_validator_client.go +++ b/validator/client/beacon-api/beacon_api_validator_client.go @@ -46,8 +46,8 @@ func NewBeaconApiValidatorClient(jsonRestHandler JsonRestHandler, opts ...Valida return c } -func (c *beaconApiValidatorClient) GetDuties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { - return wrapInMetrics[*ethpb.DutiesResponse]("GetDuties", func() (*ethpb.DutiesResponse, error) { +func (c *beaconApiValidatorClient) Duties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { + return wrapInMetrics[*ethpb.DutiesResponse]("Duties", func() (*ethpb.DutiesResponse, error) { return c.getDuties(ctx, in) }) } @@ -69,36 +69,36 @@ func (c *beaconApiValidatorClient) DomainData(ctx context.Context, in *ethpb.Dom }) } -func (c *beaconApiValidatorClient) GetAttestationData(ctx context.Context, in *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) { - return wrapInMetrics[*ethpb.AttestationData]("GetAttestationData", func() (*ethpb.AttestationData, error) { +func (c *beaconApiValidatorClient) AttestationData(ctx context.Context, in *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) { + return wrapInMetrics[*ethpb.AttestationData]("AttestationData", func() (*ethpb.AttestationData, error) { return c.getAttestationData(ctx, in.Slot, in.CommitteeIndex) }) } -func (c *beaconApiValidatorClient) GetBeaconBlock(ctx context.Context, in *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) { - return wrapInMetrics[*ethpb.GenericBeaconBlock]("GetBeaconBlock", func() (*ethpb.GenericBeaconBlock, error) { +func (c *beaconApiValidatorClient) BeaconBlock(ctx context.Context, in *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) { + return wrapInMetrics[*ethpb.GenericBeaconBlock]("BeaconBlock", func() (*ethpb.GenericBeaconBlock, error) { return c.getBeaconBlock(ctx, in.Slot, in.RandaoReveal, in.Graffiti) }) } -func (c *beaconApiValidatorClient) GetFeeRecipientByPubKey(_ context.Context, _ *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error) { +func (c *beaconApiValidatorClient) FeeRecipientByPubKey(_ context.Context, _ *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error) { return nil, nil } -func (c *beaconApiValidatorClient) GetSyncCommitteeContribution(ctx context.Context, in *ethpb.SyncCommitteeContributionRequest) (*ethpb.SyncCommitteeContribution, error) { - return wrapInMetrics[*ethpb.SyncCommitteeContribution]("GetSyncCommitteeContribution", func() (*ethpb.SyncCommitteeContribution, error) { +func (c *beaconApiValidatorClient) SyncCommitteeContribution(ctx context.Context, in *ethpb.SyncCommitteeContributionRequest) (*ethpb.SyncCommitteeContribution, error) { + return wrapInMetrics[*ethpb.SyncCommitteeContribution]("SyncCommitteeContribution", func() (*ethpb.SyncCommitteeContribution, error) { return c.getSyncCommitteeContribution(ctx, in) }) } -func (c *beaconApiValidatorClient) GetSyncMessageBlockRoot(ctx context.Context, _ *empty.Empty) (*ethpb.SyncMessageBlockRootResponse, error) { - return wrapInMetrics[*ethpb.SyncMessageBlockRootResponse]("GetSyncMessageBlockRoot", func() (*ethpb.SyncMessageBlockRootResponse, error) { +func (c *beaconApiValidatorClient) SyncMessageBlockRoot(ctx context.Context, _ *empty.Empty) (*ethpb.SyncMessageBlockRootResponse, error) { + return wrapInMetrics[*ethpb.SyncMessageBlockRootResponse]("SyncMessageBlockRoot", func() (*ethpb.SyncMessageBlockRootResponse, error) { return c.getSyncMessageBlockRoot(ctx) }) } -func (c *beaconApiValidatorClient) GetSyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) { - return wrapInMetrics[*ethpb.SyncSubcommitteeIndexResponse]("GetSyncSubcommitteeIndex", func() (*ethpb.SyncSubcommitteeIndexResponse, error) { +func (c *beaconApiValidatorClient) SyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) { + return wrapInMetrics[*ethpb.SyncSubcommitteeIndexResponse]("SyncSubcommitteeIndex", func() (*ethpb.SyncSubcommitteeIndexResponse, error) { return c.getSyncSubcommitteeIndex(ctx, in) }) } @@ -211,11 +211,11 @@ func (c *beaconApiValidatorClient) EventStreamIsRunning() bool { return c.isEventStreamRunning } -func (c *beaconApiValidatorClient) GetAggregatedSelections(ctx context.Context, selections []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { +func (c *beaconApiValidatorClient) AggregatedSelections(ctx context.Context, selections []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { return c.getAggregatedSelection(ctx, selections) } -func (c *beaconApiValidatorClient) GetAggregatedSyncSelections(ctx context.Context, selections []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { +func (c *beaconApiValidatorClient) AggregatedSyncSelections(ctx context.Context, selections []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { return c.getAggregatedSyncSelections(ctx, selections) } diff --git a/validator/client/beacon-api/beacon_api_validator_client_test.go b/validator/client/beacon-api/beacon_api_validator_client_test.go index f416ae498fce..6ff40eef4bee 100644 --- a/validator/client/beacon-api/beacon_api_validator_client_test.go +++ b/validator/client/beacon-api/beacon_api_validator_client_test.go @@ -19,7 +19,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" ) -// Make sure that GetAttestationData() returns the same thing as the internal getAttestationData() +// Make sure that AttestationData() returns the same thing as the internal getAttestationData() func TestBeaconApiValidatorClient_GetAttestationDataValid(t *testing.T) { const slot = primitives.Slot(1) const committeeIndex = primitives.CommitteeIndex(2) @@ -45,7 +45,7 @@ func TestBeaconApiValidatorClient_GetAttestationDataValid(t *testing.T) { validatorClient := beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} expectedResp, expectedErr := validatorClient.getAttestationData(ctx, slot, committeeIndex) - resp, err := validatorClient.GetAttestationData( + resp, err := validatorClient.AttestationData( context.Background(), ðpb.AttestationDataRequest{Slot: slot, CommitteeIndex: committeeIndex}, ) @@ -79,7 +79,7 @@ func TestBeaconApiValidatorClient_GetAttestationDataError(t *testing.T) { validatorClient := beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} expectedResp, expectedErr := validatorClient.getAttestationData(ctx, slot, committeeIndex) - resp, err := validatorClient.GetAttestationData( + resp, err := validatorClient.AttestationData( context.Background(), ðpb.AttestationDataRequest{Slot: slot, CommitteeIndex: committeeIndex}, ) @@ -93,7 +93,7 @@ func TestBeaconApiValidatorClient_GetFeeRecipientByPubKey(t *testing.T) { validatorClient := beaconApiValidatorClient{} var expected *ethpb.FeeRecipientByPubKeyResponse = nil - resp, err := validatorClient.GetFeeRecipientByPubKey(ctx, nil) + resp, err := validatorClient.FeeRecipientByPubKey(ctx, nil) require.NoError(t, err) require.Equal(t, expected, resp) } diff --git a/validator/client/beacon-api/beacon_committee_selections_test.go b/validator/client/beacon-api/beacon_committee_selections_test.go index d1f942a8487e..8e6d87950519 100644 --- a/validator/client/beacon-api/beacon_committee_selections_test.go +++ b/validator/client/beacon-api/beacon_committee_selections_test.go @@ -111,7 +111,7 @@ func TestGetAggregatedSelections(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - res, err := validatorClient.GetAggregatedSelections(ctx, test.req) + res, err := validatorClient.AggregatedSelections(ctx, test.req) if test.expectedErrorMessage != "" { require.ErrorContains(t, test.expectedErrorMessage, err) return diff --git a/validator/client/beacon-api/domain_data_test.go b/validator/client/beacon-api/domain_data_test.go index 827955a39dd9..651eb399b516 100644 --- a/validator/client/beacon-api/domain_data_test.go +++ b/validator/client/beacon-api/domain_data_test.go @@ -35,7 +35,7 @@ func TestGetDomainData_ValidDomainData(t *testing.T) { ctx := context.Background() - // Make sure that GetGenesis() is called exactly once + // Make sure that Genesis() is called exactly once genesisProvider := mock.NewMockGenesisProvider(ctrl) genesisProvider.EXPECT().GetGenesis(ctx).Return( &structs.Genesis{GenesisValidatorsRoot: genesisValidatorRoot}, @@ -64,7 +64,7 @@ func TestGetDomainData_GenesisError(t *testing.T) { ctx := context.Background() - // Make sure that GetGenesis() is called exactly once + // Make sure that Genesis() is called exactly once genesisProvider := mock.NewMockGenesisProvider(ctrl) genesisProvider.EXPECT().GetGenesis(ctx).Return(nil, errors.New("foo error")).Times(1) @@ -83,7 +83,7 @@ func TestGetDomainData_InvalidGenesisRoot(t *testing.T) { ctx := context.Background() - // Make sure that GetGenesis() is called exactly once + // Make sure that Genesis() is called exactly once genesisProvider := mock.NewMockGenesisProvider(ctrl) genesisProvider.EXPECT().GetGenesis(ctx).Return( &structs.Genesis{GenesisValidatorsRoot: "foo"}, diff --git a/validator/client/beacon-api/mock/genesis_mock.go b/validator/client/beacon-api/mock/genesis_mock.go index dd8e35e36eed..fce4c5ba2dd8 100644 --- a/validator/client/beacon-api/mock/genesis_mock.go +++ b/validator/client/beacon-api/mock/genesis_mock.go @@ -43,7 +43,7 @@ func (m *MockGenesisProvider) EXPECT() *MockGenesisProviderMockRecorder { // GetGenesis mocks base method. func (m *MockGenesisProvider) GetGenesis(ctx context.Context) (*structs.Genesis, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetGenesis", ctx) + ret := m.ctrl.Call(m, "Genesis", ctx) ret0, _ := ret[0].(*structs.Genesis) ret1, _ := ret[1].(error) return ret0, ret1 @@ -52,5 +52,5 @@ func (m *MockGenesisProvider) GetGenesis(ctx context.Context) (*structs.Genesis, // GetGenesis indicates an expected call of GetGenesis. func (mr *MockGenesisProviderMockRecorder) GetGenesis(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGenesis", reflect.TypeOf((*MockGenesisProvider)(nil).GetGenesis), ctx) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Genesis", reflect.TypeOf((*MockGenesisProvider)(nil).GetGenesis), ctx) } diff --git a/validator/client/beacon-api/prysm_beacon_chain_client.go b/validator/client/beacon-api/prysm_beacon_chain_client.go index d4bce8f37832..9a17d8a5f548 100644 --- a/validator/client/beacon-api/prysm_beacon_chain_client.go +++ b/validator/client/beacon-api/prysm_beacon_chain_client.go @@ -26,9 +26,9 @@ type prysmChainClient struct { nodeClient iface.NodeClient } -func (c prysmChainClient) GetValidatorCount(ctx context.Context, stateID string, statuses []validator2.Status) ([]iface.ValidatorCount, error) { +func (c prysmChainClient) ValidatorCount(ctx context.Context, stateID string, statuses []validator2.Status) ([]iface.ValidatorCount, error) { // Check node version for prysm beacon node as it is a custom endpoint for prysm beacon node. - nodeVersion, err := c.nodeClient.GetVersion(ctx, nil) + nodeVersion, err := c.nodeClient.Version(ctx, nil) if err != nil { return nil, errors.Wrap(err, "failed to get node version") } diff --git a/validator/client/beacon-api/status.go b/validator/client/beacon-api/status.go index a9dc536cc248..b0f63fc7e9fa 100644 --- a/validator/client/beacon-api/status.go +++ b/validator/client/beacon-api/status.go @@ -79,7 +79,7 @@ func (c *beaconApiValidatorClient) getValidatorsStatusResponse(ctx context.Conte return nil, nil, nil, errors.Wrap(err, "failed to get state validators") } - validatorsCountResponse, err := c.prysmChainClient.GetValidatorCount(ctx, "head", nil) + validatorsCountResponse, err := c.prysmChainClient.ValidatorCount(ctx, "head", nil) if err != nil && !errors.Is(err, iface.ErrNotSupported) { return nil, nil, nil, errors.Wrap(err, "failed to get total validator count") } diff --git a/validator/client/beacon-api/sync_committee_selections_test.go b/validator/client/beacon-api/sync_committee_selections_test.go index 6afc78e5a14c..4d0dc89e0469 100644 --- a/validator/client/beacon-api/sync_committee_selections_test.go +++ b/validator/client/beacon-api/sync_committee_selections_test.go @@ -117,7 +117,7 @@ func TestGetAggregatedSyncSelections(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - res, err := validatorClient.GetAggregatedSyncSelections(ctx, test.req) + res, err := validatorClient.AggregatedSyncSelections(ctx, test.req) if test.expectedErrorMessage != "" { require.ErrorContains(t, test.expectedErrorMessage, err) return diff --git a/validator/client/beacon-api/validator_count_test.go b/validator/client/beacon-api/validator_count_test.go index eb2206801a3f..9a243018e2f3 100644 --- a/validator/client/beacon-api/validator_count_test.go +++ b/validator/client/beacon-api/validator_count_test.go @@ -146,7 +146,7 @@ func TestGetValidatorCount(t *testing.T) { jsonRestHandler: jsonRestHandler, } - countResponse, err := client.GetValidatorCount(ctx, "head", []validator.Status{validator.Active}) + countResponse, err := client.ValidatorCount(ctx, "head", []validator.Status{validator.Active}) if len(test.expectedResponse) == 0 { require.ErrorContains(t, test.expectedError, err) diff --git a/validator/client/grpc-api/grpc_beacon_chain_client.go b/validator/client/grpc-api/grpc_beacon_chain_client.go index 9f31a3b57bee..1d575d9e1a50 100644 --- a/validator/client/grpc-api/grpc_beacon_chain_client.go +++ b/validator/client/grpc-api/grpc_beacon_chain_client.go @@ -13,27 +13,27 @@ type grpcChainClient struct { beaconChainClient ethpb.BeaconChainClient } -func (c *grpcChainClient) GetChainHead(ctx context.Context, in *empty.Empty) (*ethpb.ChainHead, error) { +func (c *grpcChainClient) ChainHead(ctx context.Context, in *empty.Empty) (*ethpb.ChainHead, error) { return c.beaconChainClient.GetChainHead(ctx, in) } -func (c *grpcChainClient) ListValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) { +func (c *grpcChainClient) ValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) { return c.beaconChainClient.ListValidatorBalances(ctx, in) } -func (c *grpcChainClient) ListValidators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) { +func (c *grpcChainClient) Validators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) { return c.beaconChainClient.ListValidators(ctx, in) } -func (c *grpcChainClient) GetValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) { +func (c *grpcChainClient) ValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) { return c.beaconChainClient.GetValidatorQueue(ctx, in) } -func (c *grpcChainClient) GetValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) { +func (c *grpcChainClient) ValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) { return c.beaconChainClient.GetValidatorPerformance(ctx, in) } -func (c *grpcChainClient) GetValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) { +func (c *grpcChainClient) ValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) { return c.beaconChainClient.GetValidatorParticipation(ctx, in) } diff --git a/validator/client/grpc-api/grpc_node_client.go b/validator/client/grpc-api/grpc_node_client.go index c19dd4663fd1..54bf320a5087 100644 --- a/validator/client/grpc-api/grpc_node_client.go +++ b/validator/client/grpc-api/grpc_node_client.go @@ -20,19 +20,19 @@ type grpcNodeClient struct { healthTracker *beacon.NodeHealthTracker } -func (c *grpcNodeClient) GetSyncStatus(ctx context.Context, in *empty.Empty) (*ethpb.SyncStatus, error) { +func (c *grpcNodeClient) SyncStatus(ctx context.Context, in *empty.Empty) (*ethpb.SyncStatus, error) { return c.nodeClient.GetSyncStatus(ctx, in) } -func (c *grpcNodeClient) GetGenesis(ctx context.Context, in *empty.Empty) (*ethpb.Genesis, error) { +func (c *grpcNodeClient) Genesis(ctx context.Context, in *empty.Empty) (*ethpb.Genesis, error) { return c.nodeClient.GetGenesis(ctx, in) } -func (c *grpcNodeClient) GetVersion(ctx context.Context, in *empty.Empty) (*ethpb.Version, error) { +func (c *grpcNodeClient) Version(ctx context.Context, in *empty.Empty) (*ethpb.Version, error) { return c.nodeClient.GetVersion(ctx, in) } -func (c *grpcNodeClient) ListPeers(ctx context.Context, in *empty.Empty) (*ethpb.Peers, error) { +func (c *grpcNodeClient) Peers(ctx context.Context, in *empty.Empty) (*ethpb.Peers, error) { return c.nodeClient.ListPeers(ctx, in) } diff --git a/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go b/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go index be9f40b3a234..5082107af548 100644 --- a/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go +++ b/validator/client/grpc-api/grpc_prysm_beacon_chain_client.go @@ -22,8 +22,8 @@ type grpcPrysmChainClient struct { chainClient iface.ChainClient } -func (g grpcPrysmChainClient) GetValidatorCount(ctx context.Context, _ string, statuses []validator.Status) ([]iface.ValidatorCount, error) { - resp, err := g.chainClient.ListValidators(ctx, ðpb.ListValidatorsRequest{PageSize: 0}) +func (g grpcPrysmChainClient) ValidatorCount(ctx context.Context, _ string, statuses []validator.Status) ([]iface.ValidatorCount, error) { + resp, err := g.chainClient.Validators(ctx, ðpb.ListValidatorsRequest{PageSize: 0}) if err != nil { return nil, errors.Wrap(err, "list validators failed") } @@ -33,7 +33,7 @@ func (g grpcPrysmChainClient) GetValidatorCount(ctx context.Context, _ string, s vals = append(vals, val.Validator) } - head, err := g.chainClient.GetChainHead(ctx, &empty.Empty{}) + head, err := g.chainClient.ChainHead(ctx, &empty.Empty{}) if err != nil { return nil, errors.Wrap(err, "get chain head") } diff --git a/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go b/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go index d383f6f678d4..f54787dbafa8 100644 --- a/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go +++ b/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go @@ -318,7 +318,7 @@ func TestGetValidatorCount(t *testing.T) { require.Equal(t, true, ok) statuses = append(statuses, valStatus) } - vcCountResp, err := prysmBeaconChainClient.GetValidatorCount(context.Background(), "", statuses) + vcCountResp, err := prysmBeaconChainClient.ValidatorCount(context.Background(), "", statuses) require.NoError(t, err) require.DeepEqual(t, test.expectedResponse, vcCountResp) }) diff --git a/validator/client/grpc-api/grpc_validator_client.go b/validator/client/grpc-api/grpc_validator_client.go index cb87cc174756..25cbb4fb698a 100644 --- a/validator/client/grpc-api/grpc_validator_client.go +++ b/validator/client/grpc-api/grpc_validator_client.go @@ -23,7 +23,7 @@ type grpcValidatorClient struct { isEventStreamRunning bool } -func (c *grpcValidatorClient) GetDuties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { +func (c *grpcValidatorClient) Duties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { return c.beaconNodeValidatorClient.GetDuties(ctx, in) } @@ -35,27 +35,27 @@ func (c *grpcValidatorClient) DomainData(ctx context.Context, in *ethpb.DomainRe return c.beaconNodeValidatorClient.DomainData(ctx, in) } -func (c *grpcValidatorClient) GetAttestationData(ctx context.Context, in *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) { +func (c *grpcValidatorClient) AttestationData(ctx context.Context, in *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) { return c.beaconNodeValidatorClient.GetAttestationData(ctx, in) } -func (c *grpcValidatorClient) GetBeaconBlock(ctx context.Context, in *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) { +func (c *grpcValidatorClient) BeaconBlock(ctx context.Context, in *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) { return c.beaconNodeValidatorClient.GetBeaconBlock(ctx, in) } -func (c *grpcValidatorClient) GetFeeRecipientByPubKey(ctx context.Context, in *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error) { +func (c *grpcValidatorClient) FeeRecipientByPubKey(ctx context.Context, in *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error) { return c.beaconNodeValidatorClient.GetFeeRecipientByPubKey(ctx, in) } -func (c *grpcValidatorClient) GetSyncCommitteeContribution(ctx context.Context, in *ethpb.SyncCommitteeContributionRequest) (*ethpb.SyncCommitteeContribution, error) { +func (c *grpcValidatorClient) SyncCommitteeContribution(ctx context.Context, in *ethpb.SyncCommitteeContributionRequest) (*ethpb.SyncCommitteeContribution, error) { return c.beaconNodeValidatorClient.GetSyncCommitteeContribution(ctx, in) } -func (c *grpcValidatorClient) GetSyncMessageBlockRoot(ctx context.Context, in *empty.Empty) (*ethpb.SyncMessageBlockRootResponse, error) { +func (c *grpcValidatorClient) SyncMessageBlockRoot(ctx context.Context, in *empty.Empty) (*ethpb.SyncMessageBlockRootResponse, error) { return c.beaconNodeValidatorClient.GetSyncMessageBlockRoot(ctx, in) } -func (c *grpcValidatorClient) GetSyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) { +func (c *grpcValidatorClient) SyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) { return c.beaconNodeValidatorClient.GetSyncSubcommitteeIndex(ctx, in) } @@ -142,11 +142,11 @@ func (c *grpcValidatorClient) AggregatedSigAndAggregationBits( return c.beaconNodeValidatorClient.AggregatedSigAndAggregationBits(ctx, in) } -func (grpcValidatorClient) GetAggregatedSelections(context.Context, []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { +func (grpcValidatorClient) AggregatedSelections(context.Context, []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { return nil, iface.ErrNotSupported } -func (grpcValidatorClient) GetAggregatedSyncSelections(context.Context, []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { +func (grpcValidatorClient) AggregatedSyncSelections(context.Context, []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { return nil, iface.ErrNotSupported } diff --git a/validator/client/iface/chain_client.go b/validator/client/iface/chain_client.go index 01ec65c3306b..792750bd3640 100644 --- a/validator/client/iface/chain_client.go +++ b/validator/client/iface/chain_client.go @@ -8,10 +8,10 @@ import ( ) type ChainClient interface { - GetChainHead(ctx context.Context, in *empty.Empty) (*ethpb.ChainHead, error) - ListValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) - ListValidators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) - GetValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) - GetValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) - GetValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) + ChainHead(ctx context.Context, in *empty.Empty) (*ethpb.ChainHead, error) + ValidatorBalances(ctx context.Context, in *ethpb.ListValidatorBalancesRequest) (*ethpb.ValidatorBalances, error) + Validators(ctx context.Context, in *ethpb.ListValidatorsRequest) (*ethpb.Validators, error) + ValidatorQueue(ctx context.Context, in *empty.Empty) (*ethpb.ValidatorQueue, error) + ValidatorPerformance(ctx context.Context, in *ethpb.ValidatorPerformanceRequest) (*ethpb.ValidatorPerformanceResponse, error) + ValidatorParticipation(ctx context.Context, in *ethpb.GetValidatorParticipationRequest) (*ethpb.ValidatorParticipationResponse, error) } diff --git a/validator/client/iface/node_client.go b/validator/client/iface/node_client.go index 710c74bf26b1..7f6b80d7d737 100644 --- a/validator/client/iface/node_client.go +++ b/validator/client/iface/node_client.go @@ -9,9 +9,9 @@ import ( ) type NodeClient interface { - GetSyncStatus(ctx context.Context, in *empty.Empty) (*ethpb.SyncStatus, error) - GetGenesis(ctx context.Context, in *empty.Empty) (*ethpb.Genesis, error) - GetVersion(ctx context.Context, in *empty.Empty) (*ethpb.Version, error) - ListPeers(ctx context.Context, in *empty.Empty) (*ethpb.Peers, error) + SyncStatus(ctx context.Context, in *empty.Empty) (*ethpb.SyncStatus, error) + Genesis(ctx context.Context, in *empty.Empty) (*ethpb.Genesis, error) + Version(ctx context.Context, in *empty.Empty) (*ethpb.Version, error) + Peers(ctx context.Context, in *empty.Empty) (*ethpb.Peers, error) HealthTracker() *beacon.NodeHealthTracker } diff --git a/validator/client/iface/prysm_chain_client.go b/validator/client/iface/prysm_chain_client.go index 1cb0e2095562..84413f256b77 100644 --- a/validator/client/iface/prysm_chain_client.go +++ b/validator/client/iface/prysm_chain_client.go @@ -16,5 +16,5 @@ type ValidatorCount struct { // PrysmChainClient defines an interface required to implement all the prysm specific custom endpoints. type PrysmChainClient interface { - GetValidatorCount(context.Context, string, []validator.Status) ([]ValidatorCount, error) + ValidatorCount(context.Context, string, []validator.Status) ([]ValidatorCount, error) } diff --git a/validator/client/iface/validator.go b/validator/client/iface/validator.go index 3163b8dd8a6a..b913275f9d3b 100644 --- a/validator/client/iface/validator.go +++ b/validator/client/iface/validator.go @@ -64,7 +64,7 @@ type Validator interface { ProcessEvent(event *event.Event) ProposerSettings() *proposer.Settings SetProposerSettings(context.Context, *proposer.Settings) error - GetGraffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) ([]byte, error) + Graffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) ([]byte, error) SetGraffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, graffiti []byte) error DeleteGraffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) error HealthTracker() *beacon.NodeHealthTracker diff --git a/validator/client/iface/validator_client.go b/validator/client/iface/validator_client.go index 3f9cbe8fd22f..b53044152af2 100644 --- a/validator/client/iface/validator_client.go +++ b/validator/client/iface/validator_client.go @@ -122,32 +122,32 @@ func (s *SyncCommitteeSelection) UnmarshalJSON(input []byte) error { } type ValidatorClient interface { - GetDuties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) + Duties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) DomainData(ctx context.Context, in *ethpb.DomainRequest) (*ethpb.DomainResponse, error) WaitForChainStart(ctx context.Context, in *empty.Empty) (*ethpb.ChainStartResponse, error) WaitForActivation(ctx context.Context, in *ethpb.ValidatorActivationRequest) (ethpb.BeaconNodeValidator_WaitForActivationClient, error) ValidatorIndex(ctx context.Context, in *ethpb.ValidatorIndexRequest) (*ethpb.ValidatorIndexResponse, error) ValidatorStatus(ctx context.Context, in *ethpb.ValidatorStatusRequest) (*ethpb.ValidatorStatusResponse, error) MultipleValidatorStatus(ctx context.Context, in *ethpb.MultipleValidatorStatusRequest) (*ethpb.MultipleValidatorStatusResponse, error) - GetBeaconBlock(ctx context.Context, in *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) + BeaconBlock(ctx context.Context, in *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) ProposeBeaconBlock(ctx context.Context, in *ethpb.GenericSignedBeaconBlock) (*ethpb.ProposeResponse, error) PrepareBeaconProposer(ctx context.Context, in *ethpb.PrepareBeaconProposerRequest) (*empty.Empty, error) - GetFeeRecipientByPubKey(ctx context.Context, in *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error) - GetAttestationData(ctx context.Context, in *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) + FeeRecipientByPubKey(ctx context.Context, in *ethpb.FeeRecipientByPubKeyRequest) (*ethpb.FeeRecipientByPubKeyResponse, error) + AttestationData(ctx context.Context, in *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) ProposeAttestation(ctx context.Context, in *ethpb.Attestation) (*ethpb.AttestResponse, error) SubmitAggregateSelectionProof(ctx context.Context, in *ethpb.AggregateSelectionRequest, index primitives.ValidatorIndex, committeeLength uint64) (*ethpb.AggregateSelectionResponse, error) SubmitSignedAggregateSelectionProof(ctx context.Context, in *ethpb.SignedAggregateSubmitRequest) (*ethpb.SignedAggregateSubmitResponse, error) ProposeExit(ctx context.Context, in *ethpb.SignedVoluntaryExit) (*ethpb.ProposeExitResponse, error) SubscribeCommitteeSubnets(ctx context.Context, in *ethpb.CommitteeSubnetsSubscribeRequest, duties []*ethpb.DutiesResponse_Duty) (*empty.Empty, error) CheckDoppelGanger(ctx context.Context, in *ethpb.DoppelGangerRequest) (*ethpb.DoppelGangerResponse, error) - GetSyncMessageBlockRoot(ctx context.Context, in *empty.Empty) (*ethpb.SyncMessageBlockRootResponse, error) + SyncMessageBlockRoot(ctx context.Context, in *empty.Empty) (*ethpb.SyncMessageBlockRootResponse, error) SubmitSyncMessage(ctx context.Context, in *ethpb.SyncCommitteeMessage) (*empty.Empty, error) - GetSyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) - GetSyncCommitteeContribution(ctx context.Context, in *ethpb.SyncCommitteeContributionRequest) (*ethpb.SyncCommitteeContribution, error) + SyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) + SyncCommitteeContribution(ctx context.Context, in *ethpb.SyncCommitteeContributionRequest) (*ethpb.SyncCommitteeContribution, error) SubmitSignedContributionAndProof(ctx context.Context, in *ethpb.SignedContributionAndProof) (*empty.Empty, error) SubmitValidatorRegistrations(ctx context.Context, in *ethpb.SignedValidatorRegistrationsV1) (*empty.Empty, error) StartEventStream(ctx context.Context, topics []string, eventsChannel chan<- *event.Event) EventStreamIsRunning() bool - GetAggregatedSelections(ctx context.Context, selections []BeaconCommitteeSelection) ([]BeaconCommitteeSelection, error) - GetAggregatedSyncSelections(ctx context.Context, selections []SyncCommitteeSelection) ([]SyncCommitteeSelection, error) + AggregatedSelections(ctx context.Context, selections []BeaconCommitteeSelection) ([]BeaconCommitteeSelection, error) + AggregatedSyncSelections(ctx context.Context, selections []SyncCommitteeSelection) ([]SyncCommitteeSelection, error) } diff --git a/validator/client/key_reload.go b/validator/client/key_reload.go index 777177cff860..abb452071423 100644 --- a/validator/client/key_reload.go +++ b/validator/client/key_reload.go @@ -39,7 +39,7 @@ func (v *validator) HandleKeyReload(ctx context.Context, currentKeys [][fieldpar // "-1" indicates that validator count endpoint is not supported by the beacon node. var valCount int64 = -1 - valCounts, err := v.prysmChainClient.GetValidatorCount(ctx, "head", []validator2.Status{validator2.Active}) + valCounts, err := v.prysmChainClient.ValidatorCount(ctx, "head", []validator2.Status{validator2.Active}) if err != nil && !errors.Is(err, iface.ErrNotSupported) { return false, errors.Wrap(err, "could not get active validator count") } diff --git a/validator/client/metrics.go b/validator/client/metrics.go index b5668c154380..72a1c2ca9ef0 100644 --- a/validator/client/metrics.go +++ b/validator/client/metrics.go @@ -249,7 +249,7 @@ func (v *validator) LogValidatorGainsAndLosses(ctx context.Context, slot primiti req := ðpb.ValidatorPerformanceRequest{ PublicKeys: pubKeys, } - resp, err := v.chainClient.GetValidatorPerformance(ctx, req) + resp, err := v.chainClient.ValidatorPerformance(ctx, req) if err != nil { return err } diff --git a/validator/client/propose.go b/validator/client/propose.go index 3d70c42fb1a6..cc92ff146bb1 100644 --- a/validator/client/propose.go +++ b/validator/client/propose.go @@ -70,7 +70,7 @@ func (v *validator) ProposeBlock(ctx context.Context, slot primitives.Slot, pubK return } - g, err := v.GetGraffiti(ctx, pubKey) + g, err := v.Graffiti(ctx, pubKey) if err != nil { // Graffiti is not a critical enough to fail block production and cause // validator to miss block reward. When failed, validator should continue @@ -79,7 +79,7 @@ func (v *validator) ProposeBlock(ctx context.Context, slot primitives.Slot, pubK } // Request block from beacon node - b, err := v.validatorClient.GetBeaconBlock(ctx, ðpb.BlockRequest{ + b, err := v.validatorClient.BeaconBlock(ctx, ðpb.BlockRequest{ Slot: slot, RandaoReveal: randaoReveal, Graffiti: g, @@ -427,7 +427,7 @@ func signVoluntaryExit( } // GetGraffiti gets the graffiti from cli or file for the validator public key. -func (v *validator) GetGraffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { +func (v *validator) Graffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { if v.proposerSettings != nil { // Check proposer settings for specific key first if v.proposerSettings.ProposeConfig != nil { diff --git a/validator/client/propose_test.go b/validator/client/propose_test.go index ac27dac94bea..36f2575ef501 100644 --- a/validator/client/propose_test.go +++ b/validator/client/propose_test.go @@ -1081,7 +1081,7 @@ func TestGetGraffiti_Ok(t *testing.T) { ValidatorIndex(gomock.Any(), ðpb.ValidatorIndexRequest{PublicKey: pubKey[:]}). Return(ðpb.ValidatorIndexResponse{Index: 2}, nil) } - got, err := tt.v.GetGraffiti(context.Background(), pubKey) + got, err := tt.v.Graffiti(context.Background(), pubKey) require.NoError(t, err) require.DeepEqual(t, tt.want, got) }) @@ -1111,7 +1111,7 @@ func TestGetGraffitiOrdered_Ok(t *testing.T) { }, } for _, want := range [][]byte{bytesutil.PadTo([]byte{'a'}, 32), bytesutil.PadTo([]byte{'b'}, 32), bytesutil.PadTo([]byte{'c'}, 32), bytesutil.PadTo([]byte{'d'}, 32), bytesutil.PadTo([]byte{'d'}, 32)} { - got, err := v.GetGraffiti(context.Background(), pubKey) + got, err := v.Graffiti(context.Background(), pubKey) require.NoError(t, err) require.DeepEqual(t, want, got) } diff --git a/validator/client/service.go b/validator/client/service.go index 2b820195c4d9..8657458ac9a7 100644 --- a/validator/client/service.go +++ b/validator/client/service.go @@ -323,7 +323,7 @@ func (v *ValidatorService) GetGraffiti(ctx context.Context, pubKey [fieldparams. if v.validator == nil { return nil, errors.New("validator is unavailable") } - return v.validator.GetGraffiti(ctx, pubKey) + return v.validator.Graffiti(ctx, pubKey) } func (v *ValidatorService) SetGraffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, graffiti []byte) error { diff --git a/validator/client/sync_committee.go b/validator/client/sync_committee.go index bea78e5e110a..bbb4c93a85e6 100644 --- a/validator/client/sync_committee.go +++ b/validator/client/sync_committee.go @@ -33,7 +33,7 @@ func (v *validator) SubmitSyncCommitteeMessage(ctx context.Context, slot primiti v.waitOneThirdOrValidBlock(ctx, slot) - res, err := v.validatorClient.GetSyncMessageBlockRoot(ctx, &emptypb.Empty{}) + res, err := v.validatorClient.SyncMessageBlockRoot(ctx, &emptypb.Empty{}) if err != nil { log.WithError(err).Error("Could not request sync message block root to sign") tracing.AnnotateError(span, err) @@ -107,7 +107,7 @@ func (v *validator) SubmitSignedContributionAndProof(ctx context.Context, slot p return } - indexRes, err := v.validatorClient.GetSyncSubcommitteeIndex(ctx, ðpb.SyncSubcommitteeIndexRequest{ + indexRes, err := v.validatorClient.SyncSubcommitteeIndex(ctx, ðpb.SyncSubcommitteeIndexRequest{ PublicKey: pubKey[:], Slot: slot, }) @@ -139,7 +139,7 @@ func (v *validator) SubmitSignedContributionAndProof(ctx context.Context, slot p } subCommitteeSize := params.BeaconConfig().SyncCommitteeSize / params.BeaconConfig().SyncCommitteeSubnetCount subnet := uint64(comIdx) / subCommitteeSize - contribution, err := v.validatorClient.GetSyncCommitteeContribution(ctx, ðpb.SyncCommitteeContributionRequest{ + contribution, err := v.validatorClient.SyncCommitteeContribution(ctx, ðpb.SyncCommitteeContributionRequest{ Slot: slot, PublicKey: pubKey[:], SubnetId: subnet, @@ -216,7 +216,7 @@ func (v *validator) selectionProofs(ctx context.Context, slot primitives.Slot, p // Override selection proofs with aggregated ones if the node is part of a Distributed Validator. if v.distributed && len(selections) > 0 { var err error - selections, err := v.validatorClient.GetAggregatedSyncSelections(ctx, selections) + selections, err := v.validatorClient.AggregatedSyncSelections(ctx, selections) if err != nil { return nil, errors.Wrap(err, "failed to get aggregated sync selections") } diff --git a/validator/client/testutil/mock_validator.go b/validator/client/testutil/mock_validator.go index 15c4d17a537f..fecd9f300a89 100644 --- a/validator/client/testutil/mock_validator.go +++ b/validator/client/testutil/mock_validator.go @@ -295,7 +295,7 @@ func (fv *FakeValidator) SetProposerSettings(_ context.Context, settings *propos } // GetGraffiti for mocking -func (fv *FakeValidator) GetGraffiti(_ context.Context, _ [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { +func (fv *FakeValidator) Graffiti(_ context.Context, _ [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { return []byte(fv.graffiti), nil } diff --git a/validator/client/validator.go b/validator/client/validator.go index c78ef5fd1246..4f164adba02b 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -312,7 +312,7 @@ func (v *validator) WaitForSync(ctx context.Context) error { ctx, span := trace.StartSpan(ctx, "validator.WaitForSync") defer span.End() - s, err := v.nodeClient.GetSyncStatus(ctx, &emptypb.Empty{}) + s, err := v.nodeClient.SyncStatus(ctx, &emptypb.Empty{}) if err != nil { return errors.Wrap(client.ErrConnectionIssue, errors.Wrap(err, "could not get sync status").Error()) } @@ -324,7 +324,7 @@ func (v *validator) WaitForSync(ctx context.Context) error { select { // Poll every half slot. case <-time.After(slots.DivideSlotBy(2 /* twice per slot */)): - s, err := v.nodeClient.GetSyncStatus(ctx, &emptypb.Empty{}) + s, err := v.nodeClient.SyncStatus(ctx, &emptypb.Empty{}) if err != nil { return errors.Wrap(client.ErrConnectionIssue, errors.Wrap(err, "could not get sync status").Error()) } @@ -402,7 +402,7 @@ func (v *validator) checkAndLogValidatorStatus(statuses []*validatorStatus, acti func (v *validator) CanonicalHeadSlot(ctx context.Context) (primitives.Slot, error) { ctx, span := trace.StartSpan(ctx, "validator.CanonicalHeadSlot") defer span.End() - head, err := v.chainClient.GetChainHead(ctx, &emptypb.Empty{}) + head, err := v.chainClient.ChainHead(ctx, &emptypb.Empty{}) if err != nil { return 0, errors.Wrap(client.ErrConnectionIssue, err.Error()) } @@ -558,7 +558,7 @@ func (v *validator) UpdateDuties(ctx context.Context, slot primitives.Slot) erro } // If duties is nil it means we have had no prior duties and just started up. - resp, err := v.validatorClient.GetDuties(ctx, req) + resp, err := v.validatorClient.Duties(ctx, req) if err != nil { v.dutiesLock.Lock() v.duties = nil // Clear assignments so we know to retry the request. @@ -800,7 +800,7 @@ func (v *validator) isAggregator( // modulo = max(1, SYNC_COMMITTEE_SIZE // SYNC_COMMITTEE_SUBNET_COUNT // TARGET_AGGREGATORS_PER_SYNC_SUBCOMMITTEE) // return bytes_to_uint64(hash(signature)[0:8]) % modulo == 0 func (v *validator) isSyncCommitteeAggregator(ctx context.Context, slot primitives.Slot, pubKey [fieldparams.BLSPubkeyLength]byte, validatorIndex primitives.ValidatorIndex) (bool, error) { - res, err := v.validatorClient.GetSyncSubcommitteeIndex(ctx, ðpb.SyncSubcommitteeIndexRequest{ + res, err := v.validatorClient.SyncSubcommitteeIndex(ctx, ðpb.SyncSubcommitteeIndexRequest{ PublicKey: pubKey[:], Slot: slot, }) @@ -827,7 +827,7 @@ func (v *validator) isSyncCommitteeAggregator(ctx context.Context, slot primitiv // Override selections with aggregated ones if the node is part of a Distributed Validator. if v.distributed && len(selections) > 0 { - selections, err = v.validatorClient.GetAggregatedSyncSelections(ctx, selections) + selections, err = v.validatorClient.AggregatedSyncSelections(ctx, selections) if err != nil { return false, errors.Wrap(err, "failed to get aggregated sync selections") } @@ -1337,7 +1337,7 @@ func (v *validator) getAggregatedSelectionProofs(ctx context.Context, duties *et }) } - resp, err := v.validatorClient.GetAggregatedSelections(ctx, req) + resp, err := v.validatorClient.AggregatedSelections(ctx, req) if err != nil { return err } diff --git a/validator/client/wait_for_activation.go b/validator/client/wait_for_activation.go index d4a61153d5f8..ff90f8201ceb 100644 --- a/validator/client/wait_for_activation.go +++ b/validator/client/wait_for_activation.go @@ -120,7 +120,7 @@ func (v *validator) internalWaitForActivation(ctx context.Context, accountsChang // "-1" indicates that validator count endpoint is not supported by the beacon node. var valCount int64 = -1 - valCounts, err := v.prysmChainClient.GetValidatorCount(ctx, "head", []validator2.Status{validator2.Active}) + valCounts, err := v.prysmChainClient.ValidatorCount(ctx, "head", []validator2.Status{validator2.Active}) if err != nil && !errors.Is(err, iface.ErrNotSupported) { return errors.Wrap(err, "could not get active validator count") } diff --git a/validator/rpc/handlers_beacon.go b/validator/rpc/handlers_beacon.go index 9a6afc920a41..345d36a1bf80 100644 --- a/validator/rpc/handlers_beacon.go +++ b/validator/rpc/handlers_beacon.go @@ -25,7 +25,7 @@ import ( func (s *Server) GetBeaconStatus(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "validator.web.beacon.GetBeaconStatus") defer span.End() - syncStatus, err := s.nodeClient.GetSyncStatus(ctx, &emptypb.Empty{}) + syncStatus, err := s.nodeClient.SyncStatus(ctx, &emptypb.Empty{}) if err != nil { log.WithError(err).Error("beacon node call to get sync status failed") httputil.WriteJson(w, &BeaconStatusResponse{ @@ -35,16 +35,16 @@ func (s *Server) GetBeaconStatus(w http.ResponseWriter, r *http.Request) { }) return } - genesis, err := s.nodeClient.GetGenesis(ctx, &emptypb.Empty{}) + genesis, err := s.nodeClient.Genesis(ctx, &emptypb.Empty{}) if err != nil { - httputil.HandleError(w, errors.Wrap(err, "GetGenesis call failed").Error(), http.StatusInternalServerError) + httputil.HandleError(w, errors.Wrap(err, "Genesis call failed").Error(), http.StatusInternalServerError) return } genesisTime := uint64(time.Unix(genesis.GenesisTime.Seconds, 0).Unix()) address := genesis.DepositContractAddress - chainHead, err := s.chainClient.GetChainHead(ctx, &emptypb.Empty{}) + chainHead, err := s.chainClient.ChainHead(ctx, &emptypb.Empty{}) if err != nil { - httputil.HandleError(w, errors.Wrap(err, "GetChainHead").Error(), http.StatusInternalServerError) + httputil.HandleError(w, errors.Wrap(err, "ChainHead").Error(), http.StatusInternalServerError) return } httputil.WriteJson(w, &BeaconStatusResponse{ @@ -59,7 +59,7 @@ func (s *Server) GetBeaconStatus(w http.ResponseWriter, r *http.Request) { // GetValidatorPerformance is a wrapper around the /eth/v1alpha1 endpoint of the same name. func (s *Server) GetValidatorPerformance(w http.ResponseWriter, r *http.Request) { - ctx, span := trace.StartSpan(r.Context(), "validator.web.beacon.GetValidatorPerformance") + ctx, span := trace.StartSpan(r.Context(), "validator.web.beacon.ValidatorPerformance") defer span.End() publicKeys := r.URL.Query()["public_keys"] pubkeys := make([][]byte, len(publicKeys)) @@ -85,9 +85,9 @@ func (s *Server) GetValidatorPerformance(w http.ResponseWriter, r *http.Request) req := ðpb.ValidatorPerformanceRequest{ PublicKeys: pubkeys, } - validatorPerformance, err := s.chainClient.GetValidatorPerformance(ctx, req) + validatorPerformance, err := s.chainClient.ValidatorPerformance(ctx, req) if err != nil { - httputil.HandleError(w, errors.Wrap(err, "GetValidatorPerformance call failed").Error(), http.StatusInternalServerError) + httputil.HandleError(w, errors.Wrap(err, "ValidatorPerformance call failed").Error(), http.StatusInternalServerError) return } httputil.WriteJson(w, ValidatorPerformanceResponseFromConsensus(validatorPerformance)) @@ -133,9 +133,9 @@ func (s *Server) GetValidatorBalances(w http.ResponseWriter, r *http.Request) { PageSize: int32(ps), PageToken: pageToken, } - listValidatorBalances, err := s.chainClient.ListValidatorBalances(ctx, req) + listValidatorBalances, err := s.chainClient.ValidatorBalances(ctx, req) if err != nil { - httputil.HandleError(w, errors.Wrap(err, "ListValidatorBalances call failed").Error(), http.StatusInternalServerError) + httputil.HandleError(w, errors.Wrap(err, "ValidatorBalances call failed").Error(), http.StatusInternalServerError) return } response, err := ValidatorBalancesResponseFromConsensus(listValidatorBalances) @@ -187,9 +187,9 @@ func (s *Server) GetValidators(w http.ResponseWriter, r *http.Request) { PageSize: int32(ps), PageToken: pageToken, } - validators, err := s.chainClient.ListValidators(ctx, req) + validators, err := s.chainClient.Validators(ctx, req) if err != nil { - httputil.HandleError(w, errors.Wrap(err, "ListValidators call failed").Error(), http.StatusInternalServerError) + httputil.HandleError(w, errors.Wrap(err, "Validators call failed").Error(), http.StatusInternalServerError) return } response, err := ValidatorsResponseFromConsensus(validators) @@ -204,9 +204,9 @@ func (s *Server) GetValidators(w http.ResponseWriter, r *http.Request) { func (s *Server) GetPeers(w http.ResponseWriter, r *http.Request) { ctx, span := trace.StartSpan(r.Context(), "validator.web.beacon.GetPeers") defer span.End() - peers, err := s.nodeClient.ListPeers(ctx, &emptypb.Empty{}) + peers, err := s.nodeClient.Peers(ctx, &emptypb.Empty{}) if err != nil { - httputil.HandleError(w, errors.Wrap(err, "ListPeers call failed").Error(), http.StatusInternalServerError) + httputil.HandleError(w, errors.Wrap(err, "Peers call failed").Error(), http.StatusInternalServerError) return } httputil.WriteJson(w, peers) diff --git a/validator/rpc/handlers_health.go b/validator/rpc/handlers_health.go index dc6e05b068c0..7c65ea81d268 100644 --- a/validator/rpc/handlers_health.go +++ b/validator/rpc/handlers_health.go @@ -15,10 +15,10 @@ import ( // GetVersion returns the beacon node and validator client versions func (s *Server) GetVersion(w http.ResponseWriter, r *http.Request) { - ctx, span := trace.StartSpan(r.Context(), "validator.web.health.GetVersion") + ctx, span := trace.StartSpan(r.Context(), "validator.web.health.Version") defer span.End() - beacon, err := s.nodeClient.GetVersion(ctx, &emptypb.Empty{}) + beacon, err := s.nodeClient.Version(ctx, &emptypb.Empty{}) if err != nil { httputil.HandleError(w, err.Error(), http.StatusInternalServerError) return diff --git a/validator/rpc/handlers_keymanager.go b/validator/rpc/handlers_keymanager.go index 9725bde7651e..c9fae2f58880 100644 --- a/validator/rpc/handlers_keymanager.go +++ b/validator/rpc/handlers_keymanager.go @@ -347,7 +347,7 @@ func (s *Server) SetVoluntaryExit(w http.ResponseWriter, r *http.Request) { epoch := primitives.Epoch(e) if rawEpoch == "" { - genesisResponse, err := s.nodeClient.GetGenesis(ctx, &emptypb.Empty{}) + genesisResponse, err := s.nodeClient.Genesis(ctx, &emptypb.Empty{}) if err != nil { httputil.HandleError(w, errors.Wrap(err, "Failed to get genesis time").Error(), http.StatusInternalServerError) return @@ -842,7 +842,7 @@ func (s *Server) DeleteGasLimit(w http.ResponseWriter, r *http.Request) { } func (s *Server) GetGraffiti(w http.ResponseWriter, r *http.Request) { - ctx, span := trace.StartSpan(r.Context(), "validator.keymanagerAPI.GetGraffiti") + ctx, span := trace.StartSpan(r.Context(), "validator.keymanagerAPI.Graffiti") defer span.End() if s.validatorService == nil { diff --git a/validator/rpc/handlers_keymanager_test.go b/validator/rpc/handlers_keymanager_test.go index 2ec1d6b42de9..7fb1f67d05b5 100644 --- a/validator/rpc/handlers_keymanager_test.go +++ b/validator/rpc/handlers_keymanager_test.go @@ -841,7 +841,7 @@ func TestServer_SetVoluntaryExit(t *testing.T) { resp := &SetVoluntaryExitResponse{} require.NoError(t, json.Unmarshal(w.Body.Bytes(), resp)) if tt.w.epoch == 0 { - genesisResponse, err := s.nodeClient.GetGenesis(ctx, &emptypb.Empty{}) + genesisResponse, err := s.nodeClient.Genesis(ctx, &emptypb.Empty{}) require.NoError(t, err) tt.w.epoch, err = client.CurrentEpoch(genesisResponse.GenesisTime) require.NoError(t, err) From feb589ac688f7184fd3950d9c1137f5d9a190324 Mon Sep 17 00:00:00 2001 From: rkapka Date: Mon, 27 May 2024 19:22:20 +0900 Subject: [PATCH 3/9] inspection --- validator/client/beacon-api/activation.go | 2 +- .../client/beacon-api/attestation_data.go | 2 +- .../beacon-api/beacon_api_helpers_test.go | 6 +- .../beacon-api/beacon_block_converter_test.go | 104 ++++++------ .../beacon_committee_selections_test.go | 16 +- validator/client/beacon-api/domain_data.go | 2 +- .../client/beacon-api/doppelganger_test.go | 4 +- validator/client/beacon-api/duties.go | 4 +- validator/client/beacon-api/genesis.go | 2 +- .../client/beacon-api/get_beacon_block.go | 6 +- .../beacon-api/get_beacon_block_test.go | 42 ++--- validator/client/beacon-api/index.go | 2 +- .../client/beacon-api/json_rest_handler.go | 4 +- .../client/beacon-api/propose_attestation.go | 2 +- .../beacon-api/propose_attestation_test.go | 28 ++-- .../client/beacon-api/propose_beacon_block.go | 2 +- .../propose_beacon_block_altair_test.go | 6 +- .../propose_beacon_block_bellatrix_test.go | 6 +- ...ose_beacon_block_blinded_bellatrix_test.go | 144 ++++++++-------- ...opose_beacon_block_blinded_capella_test.go | 158 +++++++++--------- .../propose_beacon_block_capella_test.go | 6 +- .../propose_beacon_block_phase0_test.go | 6 +- validator/client/beacon-api/propose_exit.go | 2 +- .../client/beacon-api/state_validators.go | 3 +- validator/client/beacon-api/stream_blocks.go | 4 +- .../client/beacon-api/stream_blocks_test.go | 34 ++-- .../submit_aggregate_selection_proof_test.go | 6 +- .../submit_signed_aggregate_proof_test.go | 16 +- .../submit_signed_contribution_and_proof.go | 2 +- .../beacon-api/subscribe_committee_subnets.go | 2 +- validator/client/beacon-api/sync_committee.go | 4 +- .../sync_committee_selections_test.go | 16 +- .../client/beacon-api/sync_committee_test.go | 4 +- .../grpc_prysm_beacon_chain_client_test.go | 4 +- .../client/grpc-api/grpc_validator_client.go | 4 +- validator/client/iface/validator_client.go | 4 +- validator/client/metrics.go | 26 +-- validator/client/propose.go | 4 +- validator/client/propose_test.go | 18 +- validator/client/runner_test.go | 4 +- validator/client/service.go | 2 +- validator/client/testutil/mock_validator.go | 4 +- validator/client/validator.go | 52 +++--- validator/client/validator_test.go | 2 +- validator/client/wait_for_activation.go | 2 +- 45 files changed, 376 insertions(+), 397 deletions(-) diff --git a/validator/client/beacon-api/activation.go b/validator/client/beacon-api/activation.go index 0928327b0fc3..61dd83bf04cf 100644 --- a/validator/client/beacon-api/activation.go +++ b/validator/client/beacon-api/activation.go @@ -13,7 +13,7 @@ import ( "google.golang.org/grpc" ) -func (c beaconApiValidatorClient) waitForActivation(ctx context.Context, in *ethpb.ValidatorActivationRequest) (ethpb.BeaconNodeValidator_WaitForActivationClient, error) { +func (c *beaconApiValidatorClient) waitForActivation(ctx context.Context, in *ethpb.ValidatorActivationRequest) (ethpb.BeaconNodeValidator_WaitForActivationClient, error) { return &waitForActivationClient{ ctx: ctx, beaconApiValidatorClient: c, diff --git a/validator/client/beacon-api/attestation_data.go b/validator/client/beacon-api/attestation_data.go index f4d2c1d8f890..066244564208 100644 --- a/validator/client/beacon-api/attestation_data.go +++ b/validator/client/beacon-api/attestation_data.go @@ -12,7 +12,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (c beaconApiValidatorClient) getAttestationData( +func (c *beaconApiValidatorClient) getAttestationData( ctx context.Context, reqSlot primitives.Slot, reqCommitteeIndex primitives.CommitteeIndex, diff --git a/validator/client/beacon-api/beacon_api_helpers_test.go b/validator/client/beacon-api/beacon_api_helpers_test.go index 622d7e498c72..9e00ec909b7d 100644 --- a/validator/client/beacon-api/beacon_api_helpers_test.go +++ b/validator/client/beacon-api/beacon_api_helpers_test.go @@ -290,7 +290,7 @@ func TestGetLiveness_Invalid(t *testing.T) { require.ErrorContains(t, "custom error", err) } -const syncingEnpoint = "/eth/v1/node/syncing" +const syncingEndpoint = "/eth/v1/node/syncing" func TestGetIsSyncing_Nominal(t *testing.T) { testCases := []struct { @@ -325,7 +325,7 @@ func TestGetIsSyncing_Nominal(t *testing.T) { jsonRestHandler.EXPECT().Get( ctx, - syncingEnpoint, + syncingEndpoint, &syncingResponseJson, ).Return( nil, @@ -356,7 +356,7 @@ func TestGetIsSyncing_Invalid(t *testing.T) { jsonRestHandler.EXPECT().Get( ctx, - syncingEnpoint, + syncingEndpoint, &syncingResponseJson, ).Return( errors.New("custom error"), diff --git a/validator/client/beacon-api/beacon_block_converter_test.go b/validator/client/beacon-api/beacon_block_converter_test.go index bcb6a3ec37b3..cc30e14a2fbb 100644 --- a/validator/client/beacon-api/beacon_block_converter_test.go +++ b/validator/client/beacon-api/beacon_block_converter_test.go @@ -6,13 +6,13 @@ import ( "github.com/prysmaticlabs/prysm/v5/api/server/structs" "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" ) func TestGetBeaconBlockConverter_Phase0Valid(t *testing.T) { - expectedBeaconBlock := test_helpers.GenerateProtoPhase0BeaconBlock() + expectedBeaconBlock := testhelpers.GenerateProtoPhase0BeaconBlock() beaconBlockConverter := &beaconApiBeaconBlockConverter{} - beaconBlock, err := beaconBlockConverter.ConvertRESTPhase0BlockToProto(test_helpers.GenerateJsonPhase0BeaconBlock()) + beaconBlock, err := beaconBlockConverter.ConvertRESTPhase0BlockToProto(testhelpers.GenerateJsonPhase0BeaconBlock()) require.NoError(t, err) assert.DeepEqual(t, expectedBeaconBlock, beaconBlock) } @@ -27,7 +27,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "nil body", expectedErrorMessage: "block body is nil", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body = nil return beaconBlock }, @@ -36,7 +36,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "nil eth1 data", expectedErrorMessage: "eth1 data is nil", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.Eth1Data = nil return beaconBlock }, @@ -45,7 +45,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad slot", expectedErrorMessage: "failed to parse slot `foo`", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Slot = "foo" return beaconBlock }, @@ -54,7 +54,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad proposer index", expectedErrorMessage: "failed to parse proposer index `bar`", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.ProposerIndex = "bar" return beaconBlock }, @@ -63,7 +63,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad parent root", expectedErrorMessage: "failed to decode parent root `foo`", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.ParentRoot = "foo" return beaconBlock }, @@ -72,7 +72,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad state root", expectedErrorMessage: "failed to decode state root `bar`", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.StateRoot = "bar" return beaconBlock }, @@ -81,7 +81,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad randao reveal", expectedErrorMessage: "failed to decode randao reveal `foo`", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.RandaoReveal = "foo" return beaconBlock }, @@ -90,7 +90,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad deposit root", expectedErrorMessage: "failed to decode deposit root `bar`", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.Eth1Data.DepositRoot = "bar" return beaconBlock }, @@ -99,7 +99,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad deposit count", expectedErrorMessage: "failed to parse deposit count `foo`", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.Eth1Data.DepositCount = "foo" return beaconBlock }, @@ -108,7 +108,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad block hash", expectedErrorMessage: "failed to decode block hash `bar`", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.Eth1Data.BlockHash = "bar" return beaconBlock }, @@ -117,7 +117,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad graffiti", expectedErrorMessage: "failed to decode graffiti `foo`", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.Graffiti = "foo" return beaconBlock }, @@ -126,7 +126,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad proposer slashings", expectedErrorMessage: "failed to get proposer slashings", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.ProposerSlashings[0] = nil return beaconBlock }, @@ -135,7 +135,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad attester slashings", expectedErrorMessage: "failed to get attester slashings", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.AttesterSlashings[0] = nil return beaconBlock }, @@ -144,7 +144,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad attestations", expectedErrorMessage: "failed to get attestations", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.Attestations[0] = nil return beaconBlock }, @@ -153,7 +153,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad deposits", expectedErrorMessage: "failed to get deposits", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.Deposits[0] = nil return beaconBlock }, @@ -162,7 +162,7 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { name: "bad voluntary exits", expectedErrorMessage: "failed to get voluntary exits", generateData: func() *structs.BeaconBlock { - beaconBlock := test_helpers.GenerateJsonPhase0BeaconBlock() + beaconBlock := testhelpers.GenerateJsonPhase0BeaconBlock() beaconBlock.Body.VoluntaryExits[0] = nil return beaconBlock }, @@ -181,9 +181,9 @@ func TestGetBeaconBlockConverter_Phase0Error(t *testing.T) { } func TestGetBeaconBlockConverter_AltairValid(t *testing.T) { - expectedBeaconBlock := test_helpers.GenerateProtoAltairBeaconBlock() + expectedBeaconBlock := testhelpers.GenerateProtoAltairBeaconBlock() beaconBlockConverter := &beaconApiBeaconBlockConverter{} - beaconBlock, err := beaconBlockConverter.ConvertRESTAltairBlockToProto(test_helpers.GenerateJsonAltairBeaconBlock()) + beaconBlock, err := beaconBlockConverter.ConvertRESTAltairBlockToProto(testhelpers.GenerateJsonAltairBeaconBlock()) require.NoError(t, err) assert.DeepEqual(t, expectedBeaconBlock, beaconBlock) } @@ -198,7 +198,7 @@ func TestGetBeaconBlockConverter_AltairError(t *testing.T) { name: "nil body", expectedErrorMessage: "block body is nil", generateData: func() *structs.BeaconBlockAltair { - beaconBlock := test_helpers.GenerateJsonAltairBeaconBlock() + beaconBlock := testhelpers.GenerateJsonAltairBeaconBlock() beaconBlock.Body = nil return beaconBlock }, @@ -207,7 +207,7 @@ func TestGetBeaconBlockConverter_AltairError(t *testing.T) { name: "nil sync aggregate", expectedErrorMessage: "sync aggregate is nil", generateData: func() *structs.BeaconBlockAltair { - beaconBlock := test_helpers.GenerateJsonAltairBeaconBlock() + beaconBlock := testhelpers.GenerateJsonAltairBeaconBlock() beaconBlock.Body.SyncAggregate = nil return beaconBlock }, @@ -216,7 +216,7 @@ func TestGetBeaconBlockConverter_AltairError(t *testing.T) { name: "bad phase0 fields", expectedErrorMessage: "failed to get the phase0 fields of the altair block", generateData: func() *structs.BeaconBlockAltair { - beaconBlock := test_helpers.GenerateJsonAltairBeaconBlock() + beaconBlock := testhelpers.GenerateJsonAltairBeaconBlock() beaconBlock.Body.Eth1Data = nil return beaconBlock }, @@ -225,7 +225,7 @@ func TestGetBeaconBlockConverter_AltairError(t *testing.T) { name: "bad sync committee bits", expectedErrorMessage: "failed to decode sync committee bits `foo`", generateData: func() *structs.BeaconBlockAltair { - beaconBlock := test_helpers.GenerateJsonAltairBeaconBlock() + beaconBlock := testhelpers.GenerateJsonAltairBeaconBlock() beaconBlock.Body.SyncAggregate.SyncCommitteeBits = "foo" return beaconBlock }, @@ -234,7 +234,7 @@ func TestGetBeaconBlockConverter_AltairError(t *testing.T) { name: "bad sync committee signature", expectedErrorMessage: "failed to decode sync committee signature `bar`", generateData: func() *structs.BeaconBlockAltair { - beaconBlock := test_helpers.GenerateJsonAltairBeaconBlock() + beaconBlock := testhelpers.GenerateJsonAltairBeaconBlock() beaconBlock.Body.SyncAggregate.SyncCommitteeSignature = "bar" return beaconBlock }, @@ -253,9 +253,9 @@ func TestGetBeaconBlockConverter_AltairError(t *testing.T) { } func TestGetBeaconBlockConverter_BellatrixValid(t *testing.T) { - expectedBeaconBlock := test_helpers.GenerateProtoBellatrixBeaconBlock() + expectedBeaconBlock := testhelpers.GenerateProtoBellatrixBeaconBlock() beaconBlockConverter := &beaconApiBeaconBlockConverter{} - beaconBlock, err := beaconBlockConverter.ConvertRESTBellatrixBlockToProto(test_helpers.GenerateJsonBellatrixBeaconBlock()) + beaconBlock, err := beaconBlockConverter.ConvertRESTBellatrixBlockToProto(testhelpers.GenerateJsonBellatrixBeaconBlock()) require.NoError(t, err) assert.DeepEqual(t, expectedBeaconBlock, beaconBlock) } @@ -270,7 +270,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "nil body", expectedErrorMessage: "block body is nil", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body = nil return beaconBlock }, @@ -279,7 +279,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "nil execution payload", expectedErrorMessage: "execution payload is nil", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload = nil return beaconBlock }, @@ -288,7 +288,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad altair fields", expectedErrorMessage: "failed to get the altair fields of the bellatrix block", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.Eth1Data = nil return beaconBlock }, @@ -297,7 +297,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad parent hash", expectedErrorMessage: "failed to decode execution payload parent hash `foo`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.ParentHash = "foo" return beaconBlock }, @@ -306,7 +306,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad fee recipient", expectedErrorMessage: "failed to decode execution payload fee recipient `bar`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.FeeRecipient = "bar" return beaconBlock }, @@ -315,7 +315,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad state root", expectedErrorMessage: "failed to decode execution payload state root `foo`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.StateRoot = "foo" return beaconBlock }, @@ -324,7 +324,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad receipts root", expectedErrorMessage: "failed to decode execution payload receipts root `bar`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.ReceiptsRoot = "bar" return beaconBlock }, @@ -333,7 +333,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad logs bloom", expectedErrorMessage: "failed to decode execution payload logs bloom `foo`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.LogsBloom = "foo" return beaconBlock }, @@ -342,7 +342,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad prev randao", expectedErrorMessage: "failed to decode execution payload prev randao `bar`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.PrevRandao = "bar" return beaconBlock }, @@ -351,7 +351,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad block number", expectedErrorMessage: "failed to parse execution payload block number `foo`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.BlockNumber = "foo" return beaconBlock }, @@ -360,7 +360,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad gas limit", expectedErrorMessage: "failed to parse execution payload gas limit `bar`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.GasLimit = "bar" return beaconBlock }, @@ -369,7 +369,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad gas used", expectedErrorMessage: "failed to parse execution payload gas used `foo`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.GasUsed = "foo" return beaconBlock }, @@ -378,7 +378,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad timestamp", expectedErrorMessage: "failed to parse execution payload timestamp `bar`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.Timestamp = "bar" return beaconBlock }, @@ -387,7 +387,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad extra data", expectedErrorMessage: "failed to decode execution payload extra data `foo`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.ExtraData = "foo" return beaconBlock }, @@ -396,7 +396,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad base fee per gas", expectedErrorMessage: "failed to parse execution payload base fee per gas `bar`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.BaseFeePerGas = "bar" return beaconBlock }, @@ -405,7 +405,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad block hash", expectedErrorMessage: "failed to decode execution payload block hash `foo`", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.BlockHash = "foo" return beaconBlock }, @@ -414,7 +414,7 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { name: "bad transactions", expectedErrorMessage: "failed to get execution payload transactions", generateData: func() *structs.BeaconBlockBellatrix { - beaconBlock := test_helpers.GenerateJsonBellatrixBeaconBlock() + beaconBlock := testhelpers.GenerateJsonBellatrixBeaconBlock() beaconBlock.Body.ExecutionPayload.Transactions[0] = "bar" return beaconBlock }, @@ -433,9 +433,9 @@ func TestGetBeaconBlockConverter_BellatrixError(t *testing.T) { } func TestGetBeaconBlockConverter_CapellaValid(t *testing.T) { - expectedBeaconBlock := test_helpers.GenerateProtoCapellaBeaconBlock() + expectedBeaconBlock := testhelpers.GenerateProtoCapellaBeaconBlock() beaconBlockConverter := &beaconApiBeaconBlockConverter{} - beaconBlock, err := beaconBlockConverter.ConvertRESTCapellaBlockToProto(test_helpers.GenerateJsonCapellaBeaconBlock()) + beaconBlock, err := beaconBlockConverter.ConvertRESTCapellaBlockToProto(testhelpers.GenerateJsonCapellaBeaconBlock()) require.NoError(t, err) assert.DeepEqual(t, expectedBeaconBlock, beaconBlock) } @@ -450,7 +450,7 @@ func TestGetBeaconBlockConverter_CapellaError(t *testing.T) { name: "nil body", expectedErrorMessage: "block body is nil", generateData: func() *structs.BeaconBlockCapella { - beaconBlock := test_helpers.GenerateJsonCapellaBeaconBlock() + beaconBlock := testhelpers.GenerateJsonCapellaBeaconBlock() beaconBlock.Body = nil return beaconBlock }, @@ -459,7 +459,7 @@ func TestGetBeaconBlockConverter_CapellaError(t *testing.T) { name: "nil execution payload", expectedErrorMessage: "execution payload is nil", generateData: func() *structs.BeaconBlockCapella { - beaconBlock := test_helpers.GenerateJsonCapellaBeaconBlock() + beaconBlock := testhelpers.GenerateJsonCapellaBeaconBlock() beaconBlock.Body.ExecutionPayload = nil return beaconBlock }, @@ -468,7 +468,7 @@ func TestGetBeaconBlockConverter_CapellaError(t *testing.T) { name: "bad bellatrix fields", expectedErrorMessage: "failed to get the bellatrix fields of the capella block", generateData: func() *structs.BeaconBlockCapella { - beaconBlock := test_helpers.GenerateJsonCapellaBeaconBlock() + beaconBlock := testhelpers.GenerateJsonCapellaBeaconBlock() beaconBlock.Body.Eth1Data = nil return beaconBlock }, @@ -477,7 +477,7 @@ func TestGetBeaconBlockConverter_CapellaError(t *testing.T) { name: "bad withdrawals", expectedErrorMessage: "failed to get withdrawals", generateData: func() *structs.BeaconBlockCapella { - beaconBlock := test_helpers.GenerateJsonCapellaBeaconBlock() + beaconBlock := testhelpers.GenerateJsonCapellaBeaconBlock() beaconBlock.Body.ExecutionPayload.Withdrawals[0] = nil return beaconBlock }, @@ -486,7 +486,7 @@ func TestGetBeaconBlockConverter_CapellaError(t *testing.T) { name: "bad bls execution changes", expectedErrorMessage: "failed to get bls to execution changes", generateData: func() *structs.BeaconBlockCapella { - beaconBlock := test_helpers.GenerateJsonCapellaBeaconBlock() + beaconBlock := testhelpers.GenerateJsonCapellaBeaconBlock() beaconBlock.Body.BLSToExecutionChanges[0] = nil return beaconBlock }, diff --git a/validator/client/beacon-api/beacon_committee_selections_test.go b/validator/client/beacon-api/beacon_committee_selections_test.go index 8e6d87950519..4fc8b465a2ea 100644 --- a/validator/client/beacon-api/beacon_committee_selections_test.go +++ b/validator/client/beacon-api/beacon_committee_selections_test.go @@ -11,7 +11,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -27,14 +27,14 @@ func TestGetAggregatedSelections(t *testing.T) { name: "valid", req: []iface.BeaconCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 82), + SelectionProof: testhelpers.FillByteSlice(96, 82), Slot: 75, ValidatorIndex: 76, }, }, res: []iface.BeaconCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 100), + SelectionProof: testhelpers.FillByteSlice(96, 100), Slot: 75, ValidatorIndex: 76, }, @@ -44,7 +44,7 @@ func TestGetAggregatedSelections(t *testing.T) { name: "endpoint error", req: []iface.BeaconCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 82), + SelectionProof: testhelpers.FillByteSlice(96, 82), Slot: 75, ValidatorIndex: 76, }, @@ -56,7 +56,7 @@ func TestGetAggregatedSelections(t *testing.T) { name: "no response error", req: []iface.BeaconCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 82), + SelectionProof: testhelpers.FillByteSlice(96, 82), Slot: 75, ValidatorIndex: 76, }, @@ -67,19 +67,19 @@ func TestGetAggregatedSelections(t *testing.T) { name: "mismatch response", req: []iface.BeaconCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 82), + SelectionProof: testhelpers.FillByteSlice(96, 82), Slot: 75, ValidatorIndex: 76, }, { - SelectionProof: test_helpers.FillByteSlice(96, 102), + SelectionProof: testhelpers.FillByteSlice(96, 102), Slot: 75, ValidatorIndex: 79, }, }, res: []iface.BeaconCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 100), + SelectionProof: testhelpers.FillByteSlice(96, 100), Slot: 75, ValidatorIndex: 76, }, diff --git a/validator/client/beacon-api/domain_data.go b/validator/client/beacon-api/domain_data.go index a1854ec54e16..bbc2d6605669 100644 --- a/validator/client/beacon-api/domain_data.go +++ b/validator/client/beacon-api/domain_data.go @@ -11,7 +11,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (c beaconApiValidatorClient) getDomainData(ctx context.Context, epoch primitives.Epoch, domainType [4]byte) (*ethpb.DomainResponse, error) { +func (c *beaconApiValidatorClient) getDomainData(ctx context.Context, epoch primitives.Epoch, domainType [4]byte) (*ethpb.DomainResponse, error) { // Get the fork version from the given epoch fork, err := forks.Fork(epoch) if err != nil { diff --git a/validator/client/beacon-api/doppelganger_test.go b/validator/client/beacon-api/doppelganger_test.go index 5db65329dcfe..a8e4e0df32a7 100644 --- a/validator/client/beacon-api/doppelganger_test.go +++ b/validator/client/beacon-api/doppelganger_test.go @@ -298,7 +298,7 @@ func TestCheckDoppelGanger_Nominal(t *testing.T) { jsonRestHandler.EXPECT().Get( ctx, - syncingEnpoint, + syncingEndpoint, &syncingResponseJson, ).Return( nil, @@ -734,7 +734,7 @@ func TestCheckDoppelGanger_Errors(t *testing.T) { jsonRestHandler.EXPECT().Get( ctx, - syncingEnpoint, + syncingEndpoint, &syncingResponseJson, ).Return( testCase.getSyncingError, diff --git a/validator/client/beacon-api/duties.go b/validator/client/beacon-api/duties.go index 881040445668..b673a16ac07b 100644 --- a/validator/client/beacon-api/duties.go +++ b/validator/client/beacon-api/duties.go @@ -40,7 +40,7 @@ type validatorForDuty struct { status ethpb.ValidatorStatus } -func (c beaconApiValidatorClient) getDuties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { +func (c *beaconApiValidatorClient) getDuties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { vals, err := c.getValidatorsForDuties(ctx, in.PublicKeys) if err != nil { return nil, errors.Wrap(err, "failed to get validators for duties") @@ -76,7 +76,7 @@ func (c beaconApiValidatorClient) getDuties(ctx context.Context, in *ethpb.Dutie }, nil } -func (c beaconApiValidatorClient) getDutiesForEpoch( +func (c *beaconApiValidatorClient) getDutiesForEpoch( ctx context.Context, epoch primitives.Epoch, vals []validatorForDuty, diff --git a/validator/client/beacon-api/genesis.go b/validator/client/beacon-api/genesis.go index 411953660e7f..061aec437d66 100644 --- a/validator/client/beacon-api/genesis.go +++ b/validator/client/beacon-api/genesis.go @@ -24,7 +24,7 @@ type beaconApiGenesisProvider struct { once sync.Once } -func (c beaconApiValidatorClient) waitForChainStart(ctx context.Context) (*ethpb.ChainStartResponse, error) { +func (c *beaconApiValidatorClient) waitForChainStart(ctx context.Context) (*ethpb.ChainStartResponse, error) { genesis, err := c.genesisProvider.GetGenesis(ctx) for err != nil { diff --git a/validator/client/beacon-api/get_beacon_block.go b/validator/client/beacon-api/get_beacon_block.go index 4e0b7fd20324..f1a967da9864 100644 --- a/validator/client/beacon-api/get_beacon_block.go +++ b/validator/client/beacon-api/get_beacon_block.go @@ -22,7 +22,7 @@ type abstractProduceBlockResponseJson struct { Data json.RawMessage `json:"data"` } -func (c beaconApiValidatorClient) getBeaconBlock(ctx context.Context, slot primitives.Slot, randaoReveal []byte, graffiti []byte) (*ethpb.GenericBeaconBlock, error) { +func (c *beaconApiValidatorClient) getBeaconBlock(ctx context.Context, slot primitives.Slot, randaoReveal []byte, graffiti []byte) (*ethpb.GenericBeaconBlock, error) { queryParams := neturl.Values{} queryParams.Add("randao_reveal", hexutil.Encode(randaoReveal)) if len(graffiti) > 0 { @@ -164,7 +164,7 @@ func (c beaconApiValidatorClient) getBeaconBlock(ctx context.Context, slot primi return response, nil } -func (c beaconApiValidatorClient) fallBackToBlinded( +func (c *beaconApiValidatorClient) fallBackToBlinded( ctx context.Context, slot primitives.Slot, queryParams neturl.Values, @@ -177,7 +177,7 @@ func (c beaconApiValidatorClient) fallBackToBlinded( return resp, nil } -func (c beaconApiValidatorClient) fallBackToFull( +func (c *beaconApiValidatorClient) fallBackToFull( ctx context.Context, slot primitives.Slot, queryParams neturl.Values, diff --git a/validator/client/beacon-api/get_beacon_block_test.go b/validator/client/beacon-api/get_beacon_block_test.go index cce3e2ae3c1e..0ee4a58253aa 100644 --- a/validator/client/beacon-api/get_beacon_block_test.go +++ b/validator/client/beacon-api/get_beacon_block_test.go @@ -16,7 +16,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -149,8 +149,8 @@ func TestGetBeaconBlock_Phase0Valid(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoPhase0BeaconBlock() - block := test_helpers.GenerateJsonPhase0BeaconBlock() + proto := testhelpers.GenerateProtoPhase0BeaconBlock() + block := testhelpers.GenerateJsonPhase0BeaconBlock() bytes, err := json.Marshal(block) require.NoError(t, err) @@ -191,8 +191,8 @@ func TestGetBeaconBlock_AltairValid(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoAltairBeaconBlock() - block := test_helpers.GenerateJsonAltairBeaconBlock() + proto := testhelpers.GenerateProtoAltairBeaconBlock() + block := testhelpers.GenerateJsonAltairBeaconBlock() bytes, err := json.Marshal(block) require.NoError(t, err) @@ -234,8 +234,8 @@ func TestGetBeaconBlock_BellatrixValid(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoBellatrixBeaconBlock() - block := test_helpers.GenerateJsonBellatrixBeaconBlock() + proto := testhelpers.GenerateProtoBellatrixBeaconBlock() + block := testhelpers.GenerateJsonBellatrixBeaconBlock() bytes, err := json.Marshal(block) require.NoError(t, err) @@ -279,8 +279,8 @@ func TestGetBeaconBlock_BlindedBellatrixValid(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoBlindedBellatrixBeaconBlock() - block := test_helpers.GenerateJsonBlindedBellatrixBeaconBlock() + proto := testhelpers.GenerateProtoBlindedBellatrixBeaconBlock() + block := testhelpers.GenerateJsonBlindedBellatrixBeaconBlock() bytes, err := json.Marshal(block) require.NoError(t, err) @@ -324,8 +324,8 @@ func TestGetBeaconBlock_CapellaValid(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoCapellaBeaconBlock() - block := test_helpers.GenerateJsonCapellaBeaconBlock() + proto := testhelpers.GenerateProtoCapellaBeaconBlock() + block := testhelpers.GenerateJsonCapellaBeaconBlock() bytes, err := json.Marshal(block) require.NoError(t, err) @@ -369,8 +369,8 @@ func TestGetBeaconBlock_BlindedCapellaValid(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoBlindedCapellaBeaconBlock() - block := test_helpers.GenerateJsonBlindedCapellaBeaconBlock() + proto := testhelpers.GenerateProtoBlindedCapellaBeaconBlock() + block := testhelpers.GenerateJsonBlindedCapellaBeaconBlock() bytes, err := json.Marshal(block) require.NoError(t, err) @@ -414,8 +414,8 @@ func TestGetBeaconBlock_DenebValid(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoDenebBeaconBlockContents() - block := test_helpers.GenerateJsonDenebBeaconBlockContents() + proto := testhelpers.GenerateProtoDenebBeaconBlockContents() + block := testhelpers.GenerateJsonDenebBeaconBlockContents() bytes, err := json.Marshal(block) require.NoError(t, err) @@ -459,8 +459,8 @@ func TestGetBeaconBlock_BlindedDenebValid(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoBlindedDenebBeaconBlock() - block := test_helpers.GenerateJsonBlindedDenebBeaconBlock() + proto := testhelpers.GenerateProtoBlindedDenebBeaconBlock() + block := testhelpers.GenerateJsonBlindedDenebBeaconBlock() bytes, err := json.Marshal(block) require.NoError(t, err) @@ -504,8 +504,8 @@ func TestGetBeaconBlock_FallbackToBlindedBlock(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoBlindedDenebBeaconBlock() - block := test_helpers.GenerateJsonBlindedDenebBeaconBlock() + proto := testhelpers.GenerateProtoBlindedDenebBeaconBlock() + block := testhelpers.GenerateJsonBlindedDenebBeaconBlock() blockBytes, err := json.Marshal(block) require.NoError(t, err) @@ -555,8 +555,8 @@ func TestGetBeaconBlock_FallbackToFullBlock(t *testing.T) { ctrl := gomock.NewController(t) defer ctrl.Finish() - proto := test_helpers.GenerateProtoDenebBeaconBlockContents() - block := test_helpers.GenerateJsonDenebBeaconBlockContents() + proto := testhelpers.GenerateProtoDenebBeaconBlockContents() + block := testhelpers.GenerateJsonDenebBeaconBlockContents() blockBytes, err := json.Marshal(block) require.NoError(t, err) diff --git a/validator/client/beacon-api/index.go b/validator/client/beacon-api/index.go index 098ab721c94f..a32d4f3361d9 100644 --- a/validator/client/beacon-api/index.go +++ b/validator/client/beacon-api/index.go @@ -28,7 +28,7 @@ func (e *IndexNotFoundError) Error() string { return e.message } -func (c beaconApiValidatorClient) validatorIndex(ctx context.Context, in *ethpb.ValidatorIndexRequest) (*ethpb.ValidatorIndexResponse, error) { +func (c *beaconApiValidatorClient) validatorIndex(ctx context.Context, in *ethpb.ValidatorIndexRequest) (*ethpb.ValidatorIndexResponse, error) { stringPubKey := hexutil.Encode(in.PublicKey) stateValidator, err := c.stateValidatorsProvider.GetStateValidators(ctx, []string{stringPubKey}, nil, nil) diff --git a/validator/client/beacon-api/json_rest_handler.go b/validator/client/beacon-api/json_rest_handler.go index 57f74aaf4d14..485b95319b97 100644 --- a/validator/client/beacon-api/json_rest_handler.go +++ b/validator/client/beacon-api/json_rest_handler.go @@ -33,12 +33,12 @@ func NewBeaconApiJsonRestHandler(client http.Client, host string) JsonRestHandle } } -// GetHttpClient returns the underlying HTTP client of the handler +// HttpClient returns the underlying HTTP client of the handler func (c BeaconApiJsonRestHandler) HttpClient() *http.Client { return &c.client } -// GetHost returns the underlying HTTP host +// Host returns the underlying HTTP host func (c BeaconApiJsonRestHandler) Host() string { return c.host } diff --git a/validator/client/beacon-api/propose_attestation.go b/validator/client/beacon-api/propose_attestation.go index 803f2fe6a0a4..be543d14ed6f 100644 --- a/validator/client/beacon-api/propose_attestation.go +++ b/validator/client/beacon-api/propose_attestation.go @@ -9,7 +9,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (c beaconApiValidatorClient) proposeAttestation(ctx context.Context, attestation *ethpb.Attestation) (*ethpb.AttestResponse, error) { +func (c *beaconApiValidatorClient) proposeAttestation(ctx context.Context, attestation *ethpb.Attestation) (*ethpb.AttestResponse, error) { if err := checkNilAttestation(attestation); err != nil { return nil, err } diff --git a/validator/client/beacon-api/propose_attestation_test.go b/validator/client/beacon-api/propose_attestation_test.go index 90c844327877..4caf3a8f07d9 100644 --- a/validator/client/beacon-api/propose_attestation_test.go +++ b/validator/client/beacon-api/propose_attestation_test.go @@ -11,27 +11,27 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) func TestProposeAttestation(t *testing.T) { attestation := ðpb.Attestation{ - AggregationBits: test_helpers.FillByteSlice(4, 74), + AggregationBits: testhelpers.FillByteSlice(4, 74), Data: ðpb.AttestationData{ Slot: 75, CommitteeIndex: 76, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 78, - Root: test_helpers.FillByteSlice(32, 79), + Root: testhelpers.FillByteSlice(32, 79), }, Target: ðpb.Checkpoint{ Epoch: 80, - Root: test_helpers.FillByteSlice(32, 81), + Root: testhelpers.FillByteSlice(32, 81), }, }, - Signature: test_helpers.FillByteSlice(96, 82), + Signature: testhelpers.FillByteSlice(96, 82), } tests := []struct { @@ -53,30 +53,30 @@ func TestProposeAttestation(t *testing.T) { { name: "nil attestation data", attestation: ðpb.Attestation{ - AggregationBits: test_helpers.FillByteSlice(4, 74), - Signature: test_helpers.FillByteSlice(96, 82), + AggregationBits: testhelpers.FillByteSlice(4, 74), + Signature: testhelpers.FillByteSlice(96, 82), }, expectedErrorMessage: "attestation data is nil", }, { name: "nil source checkpoint", attestation: ðpb.Attestation{ - AggregationBits: test_helpers.FillByteSlice(4, 74), + AggregationBits: testhelpers.FillByteSlice(4, 74), Data: ðpb.AttestationData{ Target: ðpb.Checkpoint{}, }, - Signature: test_helpers.FillByteSlice(96, 82), + Signature: testhelpers.FillByteSlice(96, 82), }, expectedErrorMessage: "source/target in attestation data is nil", }, { name: "nil target checkpoint", attestation: ðpb.Attestation{ - AggregationBits: test_helpers.FillByteSlice(4, 74), + AggregationBits: testhelpers.FillByteSlice(4, 74), Data: ðpb.AttestationData{ Source: ðpb.Checkpoint{}, }, - Signature: test_helpers.FillByteSlice(96, 82), + Signature: testhelpers.FillByteSlice(96, 82), }, expectedErrorMessage: "source/target in attestation data is nil", }, @@ -87,14 +87,14 @@ func TestProposeAttestation(t *testing.T) { Source: ðpb.Checkpoint{}, Target: ðpb.Checkpoint{}, }, - Signature: test_helpers.FillByteSlice(96, 82), + Signature: testhelpers.FillByteSlice(96, 82), }, expectedErrorMessage: "attestation aggregation bits is empty", }, { name: "nil signature", attestation: ðpb.Attestation{ - AggregationBits: test_helpers.FillByteSlice(4, 74), + AggregationBits: testhelpers.FillByteSlice(4, 74), Data: ðpb.AttestationData{ Source: ðpb.Checkpoint{}, Target: ðpb.Checkpoint{}, diff --git a/validator/client/beacon-api/propose_beacon_block.go b/validator/client/beacon-api/propose_beacon_block.go index f8ae50b2c229..b6d91a447e49 100644 --- a/validator/client/beacon-api/propose_beacon_block.go +++ b/validator/client/beacon-api/propose_beacon_block.go @@ -14,7 +14,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (c beaconApiValidatorClient) proposeBeaconBlock(ctx context.Context, in *ethpb.GenericSignedBeaconBlock) (*ethpb.ProposeResponse, error) { +func (c *beaconApiValidatorClient) proposeBeaconBlock(ctx context.Context, in *ethpb.GenericSignedBeaconBlock) (*ethpb.ProposeResponse, error) { var consensusVersion string var beaconBlockRoot [32]byte diff --git a/validator/client/beacon-api/propose_beacon_block_altair_test.go b/validator/client/beacon-api/propose_beacon_block_altair_test.go index 82a68d24c030..45f6bab5132d 100644 --- a/validator/client/beacon-api/propose_beacon_block_altair_test.go +++ b/validator/client/beacon-api/propose_beacon_block_altair_test.go @@ -12,7 +12,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -80,8 +80,8 @@ func TestProposeBeaconBlock_Altair(t *testing.T) { func generateSignedAltairBlock() *ethpb.GenericSignedBeaconBlock_Altair { return ðpb.GenericSignedBeaconBlock_Altair{ Altair: ðpb.SignedBeaconBlockAltair{ - Block: test_helpers.GenerateProtoAltairBeaconBlock(), - Signature: test_helpers.FillByteSlice(96, 112), + Block: testhelpers.GenerateProtoAltairBeaconBlock(), + Signature: testhelpers.FillByteSlice(96, 112), }, } } diff --git a/validator/client/beacon-api/propose_beacon_block_bellatrix_test.go b/validator/client/beacon-api/propose_beacon_block_bellatrix_test.go index c5fa61ba3428..9fd2dca4e842 100644 --- a/validator/client/beacon-api/propose_beacon_block_bellatrix_test.go +++ b/validator/client/beacon-api/propose_beacon_block_bellatrix_test.go @@ -13,7 +13,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -97,8 +97,8 @@ func TestProposeBeaconBlock_Bellatrix(t *testing.T) { func generateSignedBellatrixBlock() *ethpb.GenericSignedBeaconBlock_Bellatrix { return ðpb.GenericSignedBeaconBlock_Bellatrix{ Bellatrix: ðpb.SignedBeaconBlockBellatrix{ - Block: test_helpers.GenerateProtoBellatrixBeaconBlock(), - Signature: test_helpers.FillByteSlice(96, 127), + Block: testhelpers.GenerateProtoBellatrixBeaconBlock(), + Signature: testhelpers.FillByteSlice(96, 127), }, } } diff --git a/validator/client/beacon-api/propose_beacon_block_blinded_bellatrix_test.go b/validator/client/beacon-api/propose_beacon_block_blinded_bellatrix_test.go index 8465ae065ba4..302bbea9e520 100644 --- a/validator/client/beacon-api/propose_beacon_block_blinded_bellatrix_test.go +++ b/validator/client/beacon-api/propose_beacon_block_blinded_bellatrix_test.go @@ -14,7 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -101,37 +101,37 @@ func generateSignedBlindedBellatrixBlock() *ethpb.GenericSignedBeaconBlock_Blind Block: ðpb.BlindedBeaconBlockBellatrix{ Slot: 1, ProposerIndex: 2, - ParentRoot: test_helpers.FillByteSlice(32, 3), - StateRoot: test_helpers.FillByteSlice(32, 4), + ParentRoot: testhelpers.FillByteSlice(32, 3), + StateRoot: testhelpers.FillByteSlice(32, 4), Body: ðpb.BlindedBeaconBlockBodyBellatrix{ - RandaoReveal: test_helpers.FillByteSlice(96, 5), + RandaoReveal: testhelpers.FillByteSlice(96, 5), Eth1Data: ðpb.Eth1Data{ - DepositRoot: test_helpers.FillByteSlice(32, 6), + DepositRoot: testhelpers.FillByteSlice(32, 6), DepositCount: 7, - BlockHash: test_helpers.FillByteSlice(32, 8), + BlockHash: testhelpers.FillByteSlice(32, 8), }, - Graffiti: test_helpers.FillByteSlice(32, 9), + Graffiti: testhelpers.FillByteSlice(32, 9), ProposerSlashings: []*ethpb.ProposerSlashing{ { Header_1: ðpb.SignedBeaconBlockHeader{ Header: ðpb.BeaconBlockHeader{ Slot: 10, ProposerIndex: 11, - ParentRoot: test_helpers.FillByteSlice(32, 12), - StateRoot: test_helpers.FillByteSlice(32, 13), - BodyRoot: test_helpers.FillByteSlice(32, 14), + ParentRoot: testhelpers.FillByteSlice(32, 12), + StateRoot: testhelpers.FillByteSlice(32, 13), + BodyRoot: testhelpers.FillByteSlice(32, 14), }, - Signature: test_helpers.FillByteSlice(96, 15), + Signature: testhelpers.FillByteSlice(96, 15), }, Header_2: ðpb.SignedBeaconBlockHeader{ Header: ðpb.BeaconBlockHeader{ Slot: 16, ProposerIndex: 17, - ParentRoot: test_helpers.FillByteSlice(32, 18), - StateRoot: test_helpers.FillByteSlice(32, 19), - BodyRoot: test_helpers.FillByteSlice(32, 20), + ParentRoot: testhelpers.FillByteSlice(32, 18), + StateRoot: testhelpers.FillByteSlice(32, 19), + BodyRoot: testhelpers.FillByteSlice(32, 20), }, - Signature: test_helpers.FillByteSlice(96, 21), + Signature: testhelpers.FillByteSlice(96, 21), }, }, { @@ -139,21 +139,21 @@ func generateSignedBlindedBellatrixBlock() *ethpb.GenericSignedBeaconBlock_Blind Header: ðpb.BeaconBlockHeader{ Slot: 22, ProposerIndex: 23, - ParentRoot: test_helpers.FillByteSlice(32, 24), - StateRoot: test_helpers.FillByteSlice(32, 25), - BodyRoot: test_helpers.FillByteSlice(32, 26), + ParentRoot: testhelpers.FillByteSlice(32, 24), + StateRoot: testhelpers.FillByteSlice(32, 25), + BodyRoot: testhelpers.FillByteSlice(32, 26), }, - Signature: test_helpers.FillByteSlice(96, 27), + Signature: testhelpers.FillByteSlice(96, 27), }, Header_2: ðpb.SignedBeaconBlockHeader{ Header: ðpb.BeaconBlockHeader{ Slot: 28, ProposerIndex: 29, - ParentRoot: test_helpers.FillByteSlice(32, 30), - StateRoot: test_helpers.FillByteSlice(32, 31), - BodyRoot: test_helpers.FillByteSlice(32, 32), + ParentRoot: testhelpers.FillByteSlice(32, 30), + StateRoot: testhelpers.FillByteSlice(32, 31), + BodyRoot: testhelpers.FillByteSlice(32, 32), }, - Signature: test_helpers.FillByteSlice(96, 33), + Signature: testhelpers.FillByteSlice(96, 33), }, }, }, @@ -164,34 +164,34 @@ func generateSignedBlindedBellatrixBlock() *ethpb.GenericSignedBeaconBlock_Blind Data: ðpb.AttestationData{ Slot: 36, CommitteeIndex: 37, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 39, - Root: test_helpers.FillByteSlice(32, 40), + Root: testhelpers.FillByteSlice(32, 40), }, Target: ðpb.Checkpoint{ Epoch: 41, - Root: test_helpers.FillByteSlice(32, 42), + Root: testhelpers.FillByteSlice(32, 42), }, }, - Signature: test_helpers.FillByteSlice(96, 43), + Signature: testhelpers.FillByteSlice(96, 43), }, Attestation_2: ðpb.IndexedAttestation{ AttestingIndices: []uint64{44, 45}, Data: ðpb.AttestationData{ Slot: 46, CommitteeIndex: 47, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 49, - Root: test_helpers.FillByteSlice(32, 50), + Root: testhelpers.FillByteSlice(32, 50), }, Target: ðpb.Checkpoint{ Epoch: 51, - Root: test_helpers.FillByteSlice(32, 52), + Root: testhelpers.FillByteSlice(32, 52), }, }, - Signature: test_helpers.FillByteSlice(96, 53), + Signature: testhelpers.FillByteSlice(96, 53), }, }, { @@ -200,90 +200,90 @@ func generateSignedBlindedBellatrixBlock() *ethpb.GenericSignedBeaconBlock_Blind Data: ðpb.AttestationData{ Slot: 56, CommitteeIndex: 57, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 59, - Root: test_helpers.FillByteSlice(32, 60), + Root: testhelpers.FillByteSlice(32, 60), }, Target: ðpb.Checkpoint{ Epoch: 61, - Root: test_helpers.FillByteSlice(32, 62), + Root: testhelpers.FillByteSlice(32, 62), }, }, - Signature: test_helpers.FillByteSlice(96, 63), + Signature: testhelpers.FillByteSlice(96, 63), }, Attestation_2: ðpb.IndexedAttestation{ AttestingIndices: []uint64{64, 65}, Data: ðpb.AttestationData{ Slot: 66, CommitteeIndex: 67, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 69, - Root: test_helpers.FillByteSlice(32, 70), + Root: testhelpers.FillByteSlice(32, 70), }, Target: ðpb.Checkpoint{ Epoch: 71, - Root: test_helpers.FillByteSlice(32, 72), + Root: testhelpers.FillByteSlice(32, 72), }, }, - Signature: test_helpers.FillByteSlice(96, 73), + Signature: testhelpers.FillByteSlice(96, 73), }, }, }, Attestations: []*ethpb.Attestation{ { - AggregationBits: test_helpers.FillByteSlice(4, 74), + AggregationBits: testhelpers.FillByteSlice(4, 74), Data: ðpb.AttestationData{ Slot: 75, CommitteeIndex: 76, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 78, - Root: test_helpers.FillByteSlice(32, 79), + Root: testhelpers.FillByteSlice(32, 79), }, Target: ðpb.Checkpoint{ Epoch: 80, - Root: test_helpers.FillByteSlice(32, 81), + Root: testhelpers.FillByteSlice(32, 81), }, }, - Signature: test_helpers.FillByteSlice(96, 82), + Signature: testhelpers.FillByteSlice(96, 82), }, { - AggregationBits: test_helpers.FillByteSlice(4, 83), + AggregationBits: testhelpers.FillByteSlice(4, 83), Data: ðpb.AttestationData{ Slot: 84, CommitteeIndex: 85, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 87, - Root: test_helpers.FillByteSlice(32, 88), + Root: testhelpers.FillByteSlice(32, 88), }, Target: ðpb.Checkpoint{ Epoch: 89, - Root: test_helpers.FillByteSlice(32, 90), + Root: testhelpers.FillByteSlice(32, 90), }, }, - Signature: test_helpers.FillByteSlice(96, 91), + Signature: testhelpers.FillByteSlice(96, 91), }, }, Deposits: []*ethpb.Deposit{ { - Proof: test_helpers.FillByteArraySlice(33, test_helpers.FillByteSlice(32, 92)), + Proof: testhelpers.FillByteArraySlice(33, testhelpers.FillByteSlice(32, 92)), Data: ðpb.Deposit_Data{ - PublicKey: test_helpers.FillByteSlice(48, 94), - WithdrawalCredentials: test_helpers.FillByteSlice(32, 95), + PublicKey: testhelpers.FillByteSlice(48, 94), + WithdrawalCredentials: testhelpers.FillByteSlice(32, 95), Amount: 96, - Signature: test_helpers.FillByteSlice(96, 97), + Signature: testhelpers.FillByteSlice(96, 97), }, }, { - Proof: test_helpers.FillByteArraySlice(33, test_helpers.FillByteSlice(32, 98)), + Proof: testhelpers.FillByteArraySlice(33, testhelpers.FillByteSlice(32, 98)), Data: ðpb.Deposit_Data{ - PublicKey: test_helpers.FillByteSlice(48, 100), - WithdrawalCredentials: test_helpers.FillByteSlice(32, 101), + PublicKey: testhelpers.FillByteSlice(48, 100), + WithdrawalCredentials: testhelpers.FillByteSlice(32, 101), Amount: 102, - Signature: test_helpers.FillByteSlice(96, 103), + Signature: testhelpers.FillByteSlice(96, 103), }, }, }, @@ -293,39 +293,39 @@ func generateSignedBlindedBellatrixBlock() *ethpb.GenericSignedBeaconBlock_Blind Epoch: 104, ValidatorIndex: 105, }, - Signature: test_helpers.FillByteSlice(96, 106), + Signature: testhelpers.FillByteSlice(96, 106), }, { Exit: ðpb.VoluntaryExit{ Epoch: 107, ValidatorIndex: 108, }, - Signature: test_helpers.FillByteSlice(96, 109), + Signature: testhelpers.FillByteSlice(96, 109), }, }, SyncAggregate: ðpb.SyncAggregate{ - SyncCommitteeBits: test_helpers.FillByteSlice(64, 110), - SyncCommitteeSignature: test_helpers.FillByteSlice(96, 111), + SyncCommitteeBits: testhelpers.FillByteSlice(64, 110), + SyncCommitteeSignature: testhelpers.FillByteSlice(96, 111), }, ExecutionPayloadHeader: &enginev1.ExecutionPayloadHeader{ - ParentHash: test_helpers.FillByteSlice(32, 112), - FeeRecipient: test_helpers.FillByteSlice(20, 113), - StateRoot: test_helpers.FillByteSlice(32, 114), - ReceiptsRoot: test_helpers.FillByteSlice(32, 115), - LogsBloom: test_helpers.FillByteSlice(256, 116), - PrevRandao: test_helpers.FillByteSlice(32, 117), + ParentHash: testhelpers.FillByteSlice(32, 112), + FeeRecipient: testhelpers.FillByteSlice(20, 113), + StateRoot: testhelpers.FillByteSlice(32, 114), + ReceiptsRoot: testhelpers.FillByteSlice(32, 115), + LogsBloom: testhelpers.FillByteSlice(256, 116), + PrevRandao: testhelpers.FillByteSlice(32, 117), BlockNumber: 118, GasLimit: 119, GasUsed: 120, Timestamp: 121, - ExtraData: test_helpers.FillByteSlice(32, 122), - BaseFeePerGas: test_helpers.FillByteSlice(32, 123), - BlockHash: test_helpers.FillByteSlice(32, 124), - TransactionsRoot: test_helpers.FillByteSlice(32, 125), + ExtraData: testhelpers.FillByteSlice(32, 122), + BaseFeePerGas: testhelpers.FillByteSlice(32, 123), + BlockHash: testhelpers.FillByteSlice(32, 124), + TransactionsRoot: testhelpers.FillByteSlice(32, 125), }, }, }, - Signature: test_helpers.FillByteSlice(96, 126), + Signature: testhelpers.FillByteSlice(96, 126), }, } } diff --git a/validator/client/beacon-api/propose_beacon_block_blinded_capella_test.go b/validator/client/beacon-api/propose_beacon_block_blinded_capella_test.go index 092fb75d3804..ccdb37df0977 100644 --- a/validator/client/beacon-api/propose_beacon_block_blinded_capella_test.go +++ b/validator/client/beacon-api/propose_beacon_block_blinded_capella_test.go @@ -14,7 +14,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -103,37 +103,37 @@ func generateSignedBlindedCapellaBlock() *ethpb.GenericSignedBeaconBlock_Blinded Block: ðpb.BlindedBeaconBlockCapella{ Slot: 1, ProposerIndex: 2, - ParentRoot: test_helpers.FillByteSlice(32, 3), - StateRoot: test_helpers.FillByteSlice(32, 4), + ParentRoot: testhelpers.FillByteSlice(32, 3), + StateRoot: testhelpers.FillByteSlice(32, 4), Body: ðpb.BlindedBeaconBlockBodyCapella{ - RandaoReveal: test_helpers.FillByteSlice(96, 5), + RandaoReveal: testhelpers.FillByteSlice(96, 5), Eth1Data: ðpb.Eth1Data{ - DepositRoot: test_helpers.FillByteSlice(32, 6), + DepositRoot: testhelpers.FillByteSlice(32, 6), DepositCount: 7, - BlockHash: test_helpers.FillByteSlice(32, 8), + BlockHash: testhelpers.FillByteSlice(32, 8), }, - Graffiti: test_helpers.FillByteSlice(32, 9), + Graffiti: testhelpers.FillByteSlice(32, 9), ProposerSlashings: []*ethpb.ProposerSlashing{ { Header_1: ðpb.SignedBeaconBlockHeader{ Header: ðpb.BeaconBlockHeader{ Slot: 10, ProposerIndex: 11, - ParentRoot: test_helpers.FillByteSlice(32, 12), - StateRoot: test_helpers.FillByteSlice(32, 13), - BodyRoot: test_helpers.FillByteSlice(32, 14), + ParentRoot: testhelpers.FillByteSlice(32, 12), + StateRoot: testhelpers.FillByteSlice(32, 13), + BodyRoot: testhelpers.FillByteSlice(32, 14), }, - Signature: test_helpers.FillByteSlice(96, 15), + Signature: testhelpers.FillByteSlice(96, 15), }, Header_2: ðpb.SignedBeaconBlockHeader{ Header: ðpb.BeaconBlockHeader{ Slot: 16, ProposerIndex: 17, - ParentRoot: test_helpers.FillByteSlice(32, 18), - StateRoot: test_helpers.FillByteSlice(32, 19), - BodyRoot: test_helpers.FillByteSlice(32, 20), + ParentRoot: testhelpers.FillByteSlice(32, 18), + StateRoot: testhelpers.FillByteSlice(32, 19), + BodyRoot: testhelpers.FillByteSlice(32, 20), }, - Signature: test_helpers.FillByteSlice(96, 21), + Signature: testhelpers.FillByteSlice(96, 21), }, }, { @@ -141,21 +141,21 @@ func generateSignedBlindedCapellaBlock() *ethpb.GenericSignedBeaconBlock_Blinded Header: ðpb.BeaconBlockHeader{ Slot: 22, ProposerIndex: 23, - ParentRoot: test_helpers.FillByteSlice(32, 24), - StateRoot: test_helpers.FillByteSlice(32, 25), - BodyRoot: test_helpers.FillByteSlice(32, 26), + ParentRoot: testhelpers.FillByteSlice(32, 24), + StateRoot: testhelpers.FillByteSlice(32, 25), + BodyRoot: testhelpers.FillByteSlice(32, 26), }, - Signature: test_helpers.FillByteSlice(96, 27), + Signature: testhelpers.FillByteSlice(96, 27), }, Header_2: ðpb.SignedBeaconBlockHeader{ Header: ðpb.BeaconBlockHeader{ Slot: 28, ProposerIndex: 29, - ParentRoot: test_helpers.FillByteSlice(32, 30), - StateRoot: test_helpers.FillByteSlice(32, 31), - BodyRoot: test_helpers.FillByteSlice(32, 32), + ParentRoot: testhelpers.FillByteSlice(32, 30), + StateRoot: testhelpers.FillByteSlice(32, 31), + BodyRoot: testhelpers.FillByteSlice(32, 32), }, - Signature: test_helpers.FillByteSlice(96, 33), + Signature: testhelpers.FillByteSlice(96, 33), }, }, }, @@ -166,34 +166,34 @@ func generateSignedBlindedCapellaBlock() *ethpb.GenericSignedBeaconBlock_Blinded Data: ðpb.AttestationData{ Slot: 36, CommitteeIndex: 37, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 39, - Root: test_helpers.FillByteSlice(32, 40), + Root: testhelpers.FillByteSlice(32, 40), }, Target: ðpb.Checkpoint{ Epoch: 41, - Root: test_helpers.FillByteSlice(32, 42), + Root: testhelpers.FillByteSlice(32, 42), }, }, - Signature: test_helpers.FillByteSlice(96, 43), + Signature: testhelpers.FillByteSlice(96, 43), }, Attestation_2: ðpb.IndexedAttestation{ AttestingIndices: []uint64{44, 45}, Data: ðpb.AttestationData{ Slot: 46, CommitteeIndex: 47, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 49, - Root: test_helpers.FillByteSlice(32, 50), + Root: testhelpers.FillByteSlice(32, 50), }, Target: ðpb.Checkpoint{ Epoch: 51, - Root: test_helpers.FillByteSlice(32, 52), + Root: testhelpers.FillByteSlice(32, 52), }, }, - Signature: test_helpers.FillByteSlice(96, 53), + Signature: testhelpers.FillByteSlice(96, 53), }, }, { @@ -202,90 +202,90 @@ func generateSignedBlindedCapellaBlock() *ethpb.GenericSignedBeaconBlock_Blinded Data: ðpb.AttestationData{ Slot: 56, CommitteeIndex: 57, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 59, - Root: test_helpers.FillByteSlice(32, 60), + Root: testhelpers.FillByteSlice(32, 60), }, Target: ðpb.Checkpoint{ Epoch: 61, - Root: test_helpers.FillByteSlice(32, 62), + Root: testhelpers.FillByteSlice(32, 62), }, }, - Signature: test_helpers.FillByteSlice(96, 63), + Signature: testhelpers.FillByteSlice(96, 63), }, Attestation_2: ðpb.IndexedAttestation{ AttestingIndices: []uint64{64, 65}, Data: ðpb.AttestationData{ Slot: 66, CommitteeIndex: 67, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 69, - Root: test_helpers.FillByteSlice(32, 70), + Root: testhelpers.FillByteSlice(32, 70), }, Target: ðpb.Checkpoint{ Epoch: 71, - Root: test_helpers.FillByteSlice(32, 72), + Root: testhelpers.FillByteSlice(32, 72), }, }, - Signature: test_helpers.FillByteSlice(96, 73), + Signature: testhelpers.FillByteSlice(96, 73), }, }, }, Attestations: []*ethpb.Attestation{ { - AggregationBits: test_helpers.FillByteSlice(4, 74), + AggregationBits: testhelpers.FillByteSlice(4, 74), Data: ðpb.AttestationData{ Slot: 75, CommitteeIndex: 76, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 78, - Root: test_helpers.FillByteSlice(32, 79), + Root: testhelpers.FillByteSlice(32, 79), }, Target: ðpb.Checkpoint{ Epoch: 80, - Root: test_helpers.FillByteSlice(32, 81), + Root: testhelpers.FillByteSlice(32, 81), }, }, - Signature: test_helpers.FillByteSlice(96, 82), + Signature: testhelpers.FillByteSlice(96, 82), }, { - AggregationBits: test_helpers.FillByteSlice(4, 83), + AggregationBits: testhelpers.FillByteSlice(4, 83), Data: ðpb.AttestationData{ Slot: 84, CommitteeIndex: 85, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 87, - Root: test_helpers.FillByteSlice(32, 88), + Root: testhelpers.FillByteSlice(32, 88), }, Target: ðpb.Checkpoint{ Epoch: 89, - Root: test_helpers.FillByteSlice(32, 90), + Root: testhelpers.FillByteSlice(32, 90), }, }, - Signature: test_helpers.FillByteSlice(96, 91), + Signature: testhelpers.FillByteSlice(96, 91), }, }, Deposits: []*ethpb.Deposit{ { - Proof: test_helpers.FillByteArraySlice(33, test_helpers.FillByteSlice(32, 92)), + Proof: testhelpers.FillByteArraySlice(33, testhelpers.FillByteSlice(32, 92)), Data: ðpb.Deposit_Data{ - PublicKey: test_helpers.FillByteSlice(48, 94), - WithdrawalCredentials: test_helpers.FillByteSlice(32, 95), + PublicKey: testhelpers.FillByteSlice(48, 94), + WithdrawalCredentials: testhelpers.FillByteSlice(32, 95), Amount: 96, - Signature: test_helpers.FillByteSlice(96, 97), + Signature: testhelpers.FillByteSlice(96, 97), }, }, { - Proof: test_helpers.FillByteArraySlice(33, test_helpers.FillByteSlice(32, 98)), + Proof: testhelpers.FillByteArraySlice(33, testhelpers.FillByteSlice(32, 98)), Data: ðpb.Deposit_Data{ - PublicKey: test_helpers.FillByteSlice(48, 100), - WithdrawalCredentials: test_helpers.FillByteSlice(32, 101), + PublicKey: testhelpers.FillByteSlice(48, 100), + WithdrawalCredentials: testhelpers.FillByteSlice(32, 101), Amount: 102, - Signature: test_helpers.FillByteSlice(96, 103), + Signature: testhelpers.FillByteSlice(96, 103), }, }, }, @@ -295,58 +295,58 @@ func generateSignedBlindedCapellaBlock() *ethpb.GenericSignedBeaconBlock_Blinded Epoch: 104, ValidatorIndex: 105, }, - Signature: test_helpers.FillByteSlice(96, 106), + Signature: testhelpers.FillByteSlice(96, 106), }, { Exit: ðpb.VoluntaryExit{ Epoch: 107, ValidatorIndex: 108, }, - Signature: test_helpers.FillByteSlice(96, 109), + Signature: testhelpers.FillByteSlice(96, 109), }, }, SyncAggregate: ðpb.SyncAggregate{ - SyncCommitteeBits: test_helpers.FillByteSlice(64, 110), - SyncCommitteeSignature: test_helpers.FillByteSlice(96, 111), + SyncCommitteeBits: testhelpers.FillByteSlice(64, 110), + SyncCommitteeSignature: testhelpers.FillByteSlice(96, 111), }, ExecutionPayloadHeader: &enginev1.ExecutionPayloadHeaderCapella{ - ParentHash: test_helpers.FillByteSlice(32, 112), - FeeRecipient: test_helpers.FillByteSlice(20, 113), - StateRoot: test_helpers.FillByteSlice(32, 114), - ReceiptsRoot: test_helpers.FillByteSlice(32, 115), - LogsBloom: test_helpers.FillByteSlice(256, 116), - PrevRandao: test_helpers.FillByteSlice(32, 117), + ParentHash: testhelpers.FillByteSlice(32, 112), + FeeRecipient: testhelpers.FillByteSlice(20, 113), + StateRoot: testhelpers.FillByteSlice(32, 114), + ReceiptsRoot: testhelpers.FillByteSlice(32, 115), + LogsBloom: testhelpers.FillByteSlice(256, 116), + PrevRandao: testhelpers.FillByteSlice(32, 117), BlockNumber: 118, GasLimit: 119, GasUsed: 120, Timestamp: 121, - ExtraData: test_helpers.FillByteSlice(32, 122), - BaseFeePerGas: test_helpers.FillByteSlice(32, 123), - BlockHash: test_helpers.FillByteSlice(32, 124), - TransactionsRoot: test_helpers.FillByteSlice(32, 125), - WithdrawalsRoot: test_helpers.FillByteSlice(32, 126), + ExtraData: testhelpers.FillByteSlice(32, 122), + BaseFeePerGas: testhelpers.FillByteSlice(32, 123), + BlockHash: testhelpers.FillByteSlice(32, 124), + TransactionsRoot: testhelpers.FillByteSlice(32, 125), + WithdrawalsRoot: testhelpers.FillByteSlice(32, 126), }, BlsToExecutionChanges: []*ethpb.SignedBLSToExecutionChange{ { Message: ðpb.BLSToExecutionChange{ ValidatorIndex: 127, - FromBlsPubkey: test_helpers.FillByteSlice(48, 128), - ToExecutionAddress: test_helpers.FillByteSlice(20, 129), + FromBlsPubkey: testhelpers.FillByteSlice(48, 128), + ToExecutionAddress: testhelpers.FillByteSlice(20, 129), }, - Signature: test_helpers.FillByteSlice(96, 130), + Signature: testhelpers.FillByteSlice(96, 130), }, { Message: ðpb.BLSToExecutionChange{ ValidatorIndex: 131, - FromBlsPubkey: test_helpers.FillByteSlice(48, 132), - ToExecutionAddress: test_helpers.FillByteSlice(20, 133), + FromBlsPubkey: testhelpers.FillByteSlice(48, 132), + ToExecutionAddress: testhelpers.FillByteSlice(20, 133), }, - Signature: test_helpers.FillByteSlice(96, 134), + Signature: testhelpers.FillByteSlice(96, 134), }, }, }, }, - Signature: test_helpers.FillByteSlice(96, 135), + Signature: testhelpers.FillByteSlice(96, 135), }, } } diff --git a/validator/client/beacon-api/propose_beacon_block_capella_test.go b/validator/client/beacon-api/propose_beacon_block_capella_test.go index 3f6dadb54459..0ee2183d3b38 100644 --- a/validator/client/beacon-api/propose_beacon_block_capella_test.go +++ b/validator/client/beacon-api/propose_beacon_block_capella_test.go @@ -13,7 +13,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -97,8 +97,8 @@ func TestProposeBeaconBlock_Capella(t *testing.T) { func generateSignedCapellaBlock() *ethpb.GenericSignedBeaconBlock_Capella { return ðpb.GenericSignedBeaconBlock_Capella{ Capella: ðpb.SignedBeaconBlockCapella{ - Block: test_helpers.GenerateProtoCapellaBeaconBlock(), - Signature: test_helpers.FillByteSlice(96, 127), + Block: testhelpers.GenerateProtoCapellaBeaconBlock(), + Signature: testhelpers.FillByteSlice(96, 127), }, } } diff --git a/validator/client/beacon-api/propose_beacon_block_phase0_test.go b/validator/client/beacon-api/propose_beacon_block_phase0_test.go index dd8ef8bf89c9..c15ffe5556f5 100644 --- a/validator/client/beacon-api/propose_beacon_block_phase0_test.go +++ b/validator/client/beacon-api/propose_beacon_block_phase0_test.go @@ -12,7 +12,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -76,8 +76,8 @@ func TestProposeBeaconBlock_Phase0(t *testing.T) { func generateSignedPhase0Block() *ethpb.GenericSignedBeaconBlock_Phase0 { return ðpb.GenericSignedBeaconBlock_Phase0{ Phase0: ðpb.SignedBeaconBlock{ - Block: test_helpers.GenerateProtoPhase0BeaconBlock(), - Signature: test_helpers.FillByteSlice(96, 110), + Block: testhelpers.GenerateProtoPhase0BeaconBlock(), + Signature: testhelpers.FillByteSlice(96, 110), }, } } diff --git a/validator/client/beacon-api/propose_exit.go b/validator/client/beacon-api/propose_exit.go index 19cff924e865..2ea3858d9a6e 100644 --- a/validator/client/beacon-api/propose_exit.go +++ b/validator/client/beacon-api/propose_exit.go @@ -12,7 +12,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (c beaconApiValidatorClient) proposeExit(ctx context.Context, signedVoluntaryExit *ethpb.SignedVoluntaryExit) (*ethpb.ProposeExitResponse, error) { +func (c *beaconApiValidatorClient) proposeExit(ctx context.Context, signedVoluntaryExit *ethpb.SignedVoluntaryExit) (*ethpb.ProposeExitResponse, error) { if signedVoluntaryExit == nil { return nil, errors.New("signed voluntary exit is nil") } diff --git a/validator/client/beacon-api/state_validators.go b/validator/client/beacon-api/state_validators.go index c738906e0523..f183b31348df 100644 --- a/validator/client/beacon-api/state_validators.go +++ b/validator/client/beacon-api/state_validators.go @@ -41,8 +41,7 @@ func (c beaconApiStateValidatorsProvider) GetStateValidatorsForSlot( statuses []string, ) (*structs.GetValidatorsResponse, error) { stringIndices := convertValidatorIndicesToStrings(indices) - url := fmt.Sprintf("/eth/v1/beacon/states/%d/validators", slot) - return c.getStateValidatorsHelper(ctx, url, append(stringIndices, stringPubkeys...), statuses) + return c.getStateValidatorsHelper(ctx, fmt.Sprintf("/eth/v1/beacon/states/%d/validators", slot), append(stringIndices, stringPubkeys...), statuses) } func (c beaconApiStateValidatorsProvider) GetStateValidatorsForHead( diff --git a/validator/client/beacon-api/stream_blocks.go b/validator/client/beacon-api/stream_blocks.go index 19e3f1c3a824..ed7c63dde2d0 100644 --- a/validator/client/beacon-api/stream_blocks.go +++ b/validator/client/beacon-api/stream_blocks.go @@ -36,7 +36,7 @@ type headSignedBeaconBlockResult struct { slot primitives.Slot } -func (c beaconApiValidatorClient) streamBlocks(ctx context.Context, in *ethpb.StreamBlocksRequest, pingDelay time.Duration) ethpb.BeaconNodeValidator_StreamBlocksAltairClient { +func (c *beaconApiValidatorClient) streamBlocks(ctx context.Context, in *ethpb.StreamBlocksRequest, pingDelay time.Duration) ethpb.BeaconNodeValidator_StreamBlocksAltairClient { return &streamBlocksAltairClient{ ctx: ctx, beaconApiClient: c, @@ -68,7 +68,7 @@ func (c *streamBlocksAltairClient) Recv() (*ethpb.StreamBlocksResponse, error) { return result.streamBlocksResponse, nil } -func (c beaconApiValidatorClient) getHeadSignedBeaconBlock(ctx context.Context) (*headSignedBeaconBlockResult, error) { +func (c *beaconApiValidatorClient) getHeadSignedBeaconBlock(ctx context.Context) (*headSignedBeaconBlockResult, error) { // Since we don't know yet what the json looks like, we unmarshal into an abstract structure that has only a version // and a blob of data signedBlockResponseJson := abstractSignedBlockResponseJson{} diff --git a/validator/client/beacon-api/stream_blocks_test.go b/validator/client/beacon-api/stream_blocks_test.go index 3111c28a3d8c..ffb58d5032bc 100644 --- a/validator/client/beacon-api/stream_blocks_test.go +++ b/validator/client/beacon-api/stream_blocks_test.go @@ -15,7 +15,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -203,7 +203,7 @@ func TestStreamBlocks_Phase0Valid(t *testing.T) { // For the first call, return a block that satisfies the verifiedOnly condition. This block should be returned by the first Recv(). // For the second call, return the same block as the previous one. This block shouldn't be returned by the second Recv(). - phase0BeaconBlock1 := test_helpers.GenerateJsonPhase0BeaconBlock() + phase0BeaconBlock1 := testhelpers.GenerateJsonPhase0BeaconBlock() phase0BeaconBlock1.Slot = "1" signedBeaconBlockContainer1 := structs.SignedBeaconBlock{ Message: phase0BeaconBlock1, @@ -228,7 +228,7 @@ func TestStreamBlocks_Phase0Valid(t *testing.T) { }, ).Times(2) - phase0ProtoBeaconBlock1 := test_helpers.GenerateProtoPhase0BeaconBlock() + phase0ProtoBeaconBlock1 := testhelpers.GenerateProtoPhase0BeaconBlock() phase0ProtoBeaconBlock1.Slot = 1 beaconBlockConverter.EXPECT().ConvertRESTPhase0BlockToProto( @@ -240,7 +240,7 @@ func TestStreamBlocks_Phase0Valid(t *testing.T) { // For the third call, return a block with a different slot than the previous one, but with the verifiedOnly condition not satisfied. // If verifiedOnly == false, this block will be returned by the second Recv(); otherwise, another block will be requested. - phase0BeaconBlock2 := test_helpers.GenerateJsonPhase0BeaconBlock() + phase0BeaconBlock2 := testhelpers.GenerateJsonPhase0BeaconBlock() phase0BeaconBlock2.Slot = "2" signedBeaconBlockContainer2 := structs.SignedBeaconBlock{ Message: phase0BeaconBlock2, @@ -265,7 +265,7 @@ func TestStreamBlocks_Phase0Valid(t *testing.T) { }, ).Times(1) - phase0ProtoBeaconBlock2 := test_helpers.GenerateProtoPhase0BeaconBlock() + phase0ProtoBeaconBlock2 := testhelpers.GenerateProtoPhase0BeaconBlock() phase0ProtoBeaconBlock2.Slot = 2 beaconBlockConverter.EXPECT().ConvertRESTPhase0BlockToProto( @@ -364,7 +364,7 @@ func TestStreamBlocks_AltairValid(t *testing.T) { // For the first call, return a block that satisfies the verifiedOnly condition. This block should be returned by the first Recv(). // For the second call, return the same block as the previous one. This block shouldn't be returned by the second Recv(). - altairBeaconBlock1 := test_helpers.GenerateJsonAltairBeaconBlock() + altairBeaconBlock1 := testhelpers.GenerateJsonAltairBeaconBlock() altairBeaconBlock1.Slot = "1" signedBeaconBlockContainer1 := structs.SignedBeaconBlockAltair{ Message: altairBeaconBlock1, @@ -389,7 +389,7 @@ func TestStreamBlocks_AltairValid(t *testing.T) { }, ).Times(2) - altairProtoBeaconBlock1 := test_helpers.GenerateProtoAltairBeaconBlock() + altairProtoBeaconBlock1 := testhelpers.GenerateProtoAltairBeaconBlock() altairProtoBeaconBlock1.Slot = 1 beaconBlockConverter.EXPECT().ConvertRESTAltairBlockToProto( @@ -401,7 +401,7 @@ func TestStreamBlocks_AltairValid(t *testing.T) { // For the third call, return a block with a different slot than the previous one, but with the verifiedOnly condition not satisfied. // If verifiedOnly == false, this block will be returned by the second Recv(); otherwise, another block will be requested. - altairBeaconBlock2 := test_helpers.GenerateJsonAltairBeaconBlock() + altairBeaconBlock2 := testhelpers.GenerateJsonAltairBeaconBlock() altairBeaconBlock2.Slot = "2" signedBeaconBlockContainer2 := structs.SignedBeaconBlockAltair{ Message: altairBeaconBlock2, @@ -426,7 +426,7 @@ func TestStreamBlocks_AltairValid(t *testing.T) { }, ).Times(1) - altairProtoBeaconBlock2 := test_helpers.GenerateProtoAltairBeaconBlock() + altairProtoBeaconBlock2 := testhelpers.GenerateProtoAltairBeaconBlock() altairProtoBeaconBlock2.Slot = 2 beaconBlockConverter.EXPECT().ConvertRESTAltairBlockToProto( @@ -525,7 +525,7 @@ func TestStreamBlocks_BellatrixValid(t *testing.T) { // For the first call, return a block that satisfies the verifiedOnly condition. This block should be returned by the first Recv(). // For the second call, return the same block as the previous one. This block shouldn't be returned by the second Recv(). - bellatrixBeaconBlock1 := test_helpers.GenerateJsonBellatrixBeaconBlock() + bellatrixBeaconBlock1 := testhelpers.GenerateJsonBellatrixBeaconBlock() bellatrixBeaconBlock1.Slot = "1" signedBeaconBlockContainer1 := structs.SignedBeaconBlockBellatrix{ Message: bellatrixBeaconBlock1, @@ -550,7 +550,7 @@ func TestStreamBlocks_BellatrixValid(t *testing.T) { }, ).Times(2) - bellatrixProtoBeaconBlock1 := test_helpers.GenerateProtoBellatrixBeaconBlock() + bellatrixProtoBeaconBlock1 := testhelpers.GenerateProtoBellatrixBeaconBlock() bellatrixProtoBeaconBlock1.Slot = 1 beaconBlockConverter.EXPECT().ConvertRESTBellatrixBlockToProto( @@ -562,7 +562,7 @@ func TestStreamBlocks_BellatrixValid(t *testing.T) { // For the third call, return a block with a different slot than the previous one, but with the verifiedOnly condition not satisfied. // If verifiedOnly == false, this block will be returned by the second Recv(); otherwise, another block will be requested. - bellatrixBeaconBlock2 := test_helpers.GenerateJsonBellatrixBeaconBlock() + bellatrixBeaconBlock2 := testhelpers.GenerateJsonBellatrixBeaconBlock() bellatrixBeaconBlock2.Slot = "2" signedBeaconBlockContainer2 := structs.SignedBeaconBlockBellatrix{ Message: bellatrixBeaconBlock2, @@ -587,7 +587,7 @@ func TestStreamBlocks_BellatrixValid(t *testing.T) { }, ).Times(1) - bellatrixProtoBeaconBlock2 := test_helpers.GenerateProtoBellatrixBeaconBlock() + bellatrixProtoBeaconBlock2 := testhelpers.GenerateProtoBellatrixBeaconBlock() bellatrixProtoBeaconBlock2.Slot = 2 beaconBlockConverter.EXPECT().ConvertRESTBellatrixBlockToProto( @@ -686,7 +686,7 @@ func TestStreamBlocks_CapellaValid(t *testing.T) { // For the first call, return a block that satisfies the verifiedOnly condition. This block should be returned by the first Recv(). // For the second call, return the same block as the previous one. This block shouldn't be returned by the second Recv(). - capellaBeaconBlock1 := test_helpers.GenerateJsonCapellaBeaconBlock() + capellaBeaconBlock1 := testhelpers.GenerateJsonCapellaBeaconBlock() capellaBeaconBlock1.Slot = "1" signedBeaconBlockContainer1 := structs.SignedBeaconBlockCapella{ Message: capellaBeaconBlock1, @@ -711,7 +711,7 @@ func TestStreamBlocks_CapellaValid(t *testing.T) { }, ).Times(2) - capellaProtoBeaconBlock1 := test_helpers.GenerateProtoCapellaBeaconBlock() + capellaProtoBeaconBlock1 := testhelpers.GenerateProtoCapellaBeaconBlock() capellaProtoBeaconBlock1.Slot = 1 beaconBlockConverter.EXPECT().ConvertRESTCapellaBlockToProto( @@ -723,7 +723,7 @@ func TestStreamBlocks_CapellaValid(t *testing.T) { // For the third call, return a block with a different slot than the previous one, but with the verifiedOnly condition not satisfied. // If verifiedOnly == false, this block will be returned by the second Recv(); otherwise, another block will be requested. - capellaBeaconBlock2 := test_helpers.GenerateJsonCapellaBeaconBlock() + capellaBeaconBlock2 := testhelpers.GenerateJsonCapellaBeaconBlock() capellaBeaconBlock2.Slot = "2" signedBeaconBlockContainer2 := structs.SignedBeaconBlockCapella{ Message: capellaBeaconBlock2, @@ -748,7 +748,7 @@ func TestStreamBlocks_CapellaValid(t *testing.T) { }, ).Times(1) - capellaProtoBeaconBlock2 := test_helpers.GenerateProtoCapellaBeaconBlock() + capellaProtoBeaconBlock2 := testhelpers.GenerateProtoCapellaBeaconBlock() capellaProtoBeaconBlock2.Slot = 2 beaconBlockConverter.EXPECT().ConvertRESTCapellaBlockToProto( diff --git a/validator/client/beacon-api/submit_aggregate_selection_proof_test.go b/validator/client/beacon-api/submit_aggregate_selection_proof_test.go index 8e20bb0fb25d..5bb60d5aa85a 100644 --- a/validator/client/beacon-api/submit_aggregate_selection_proof_test.go +++ b/validator/client/beacon-api/submit_aggregate_selection_proof_test.go @@ -13,7 +13,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -37,9 +37,9 @@ func TestSubmitAggregateSelectionProof(t *testing.T) { require.NoError(t, err) aggregateAttestation := ðpb.Attestation{ - AggregationBits: test_helpers.FillByteSlice(4, 74), + AggregationBits: testhelpers.FillByteSlice(4, 74), Data: attestationDataProto, - Signature: test_helpers.FillByteSlice(96, 82), + Signature: testhelpers.FillByteSlice(96, 82), } ctrl := gomock.NewController(t) diff --git a/validator/client/beacon-api/submit_signed_aggregate_proof_test.go b/validator/client/beacon-api/submit_signed_aggregate_proof_test.go index f717febf4346..6a8e41668c64 100644 --- a/validator/client/beacon-api/submit_signed_aggregate_proof_test.go +++ b/validator/client/beacon-api/submit_signed_aggregate_proof_test.go @@ -12,7 +12,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/testing/assert" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "go.uber.org/mock/gomock" ) @@ -80,24 +80,24 @@ func generateSignedAggregateAndProofJson() *ethpb.SignedAggregateAttestationAndP Message: ðpb.AggregateAttestationAndProof{ AggregatorIndex: 72, Aggregate: ðpb.Attestation{ - AggregationBits: test_helpers.FillByteSlice(4, 74), + AggregationBits: testhelpers.FillByteSlice(4, 74), Data: ðpb.AttestationData{ Slot: 75, CommitteeIndex: 76, - BeaconBlockRoot: test_helpers.FillByteSlice(32, 38), + BeaconBlockRoot: testhelpers.FillByteSlice(32, 38), Source: ðpb.Checkpoint{ Epoch: 78, - Root: test_helpers.FillByteSlice(32, 79), + Root: testhelpers.FillByteSlice(32, 79), }, Target: ðpb.Checkpoint{ Epoch: 80, - Root: test_helpers.FillByteSlice(32, 81), + Root: testhelpers.FillByteSlice(32, 81), }, }, - Signature: test_helpers.FillByteSlice(96, 82), + Signature: testhelpers.FillByteSlice(96, 82), }, - SelectionProof: test_helpers.FillByteSlice(96, 82), + SelectionProof: testhelpers.FillByteSlice(96, 82), }, - Signature: test_helpers.FillByteSlice(96, 82), + Signature: testhelpers.FillByteSlice(96, 82), } } diff --git a/validator/client/beacon-api/submit_signed_contribution_and_proof.go b/validator/client/beacon-api/submit_signed_contribution_and_proof.go index a3ff81fe0c0e..3482702a88a4 100644 --- a/validator/client/beacon-api/submit_signed_contribution_and_proof.go +++ b/validator/client/beacon-api/submit_signed_contribution_and_proof.go @@ -12,7 +12,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (c beaconApiValidatorClient) submitSignedContributionAndProof(ctx context.Context, in *ethpb.SignedContributionAndProof) error { +func (c *beaconApiValidatorClient) submitSignedContributionAndProof(ctx context.Context, in *ethpb.SignedContributionAndProof) error { if in == nil { return errors.New("signed contribution and proof is nil") } diff --git a/validator/client/beacon-api/subscribe_committee_subnets.go b/validator/client/beacon-api/subscribe_committee_subnets.go index e46cafa4e3b1..aae716826293 100644 --- a/validator/client/beacon-api/subscribe_committee_subnets.go +++ b/validator/client/beacon-api/subscribe_committee_subnets.go @@ -11,7 +11,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (c beaconApiValidatorClient) subscribeCommitteeSubnets(ctx context.Context, in *ethpb.CommitteeSubnetsSubscribeRequest, duties []*ethpb.DutiesResponse_Duty) error { +func (c *beaconApiValidatorClient) subscribeCommitteeSubnets(ctx context.Context, in *ethpb.CommitteeSubnetsSubscribeRequest, duties []*ethpb.DutiesResponse_Duty) error { if in == nil { return errors.New("committee subnets subscribe request is nil") } diff --git a/validator/client/beacon-api/sync_committee.go b/validator/client/beacon-api/sync_committee.go index fcebba707c71..ff19e92f60ba 100644 --- a/validator/client/beacon-api/sync_committee.go +++ b/validator/client/beacon-api/sync_committee.go @@ -80,10 +80,8 @@ func (c *beaconApiValidatorClient) getSyncCommitteeContribution( params.Add("subcommittee_index", strconv.FormatUint(req.SubnetId, 10)) params.Add("beacon_block_root", blockRoot) - url := buildURL("/eth/v1/validator/sync_committee_contribution", params) - var resp structs.ProduceSyncCommitteeContributionResponse - if err = c.jsonRestHandler.Get(ctx, url, &resp); err != nil { + if err = c.jsonRestHandler.Get(ctx, buildURL("/eth/v1/validator/sync_committee_contribution", params), &resp); err != nil { return nil, err } diff --git a/validator/client/beacon-api/sync_committee_selections_test.go b/validator/client/beacon-api/sync_committee_selections_test.go index 4d0dc89e0469..00a61e8be414 100644 --- a/validator/client/beacon-api/sync_committee_selections_test.go +++ b/validator/client/beacon-api/sync_committee_selections_test.go @@ -9,7 +9,7 @@ import ( "github.com/pkg/errors" "github.com/prysmaticlabs/prysm/v5/testing/require" "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" - test_helpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" + testhelpers "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/test-helpers" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" "go.uber.org/mock/gomock" ) @@ -26,7 +26,7 @@ func TestGetAggregatedSyncSelections(t *testing.T) { name: "valid", req: []iface.SyncCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 82), + SelectionProof: testhelpers.FillByteSlice(96, 82), Slot: 75, ValidatorIndex: 76, SubcommitteeIndex: 77, @@ -34,7 +34,7 @@ func TestGetAggregatedSyncSelections(t *testing.T) { }, res: []iface.SyncCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 100), + SelectionProof: testhelpers.FillByteSlice(96, 100), Slot: 75, ValidatorIndex: 76, SubcommitteeIndex: 77, @@ -45,7 +45,7 @@ func TestGetAggregatedSyncSelections(t *testing.T) { name: "endpoint error", req: []iface.SyncCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 82), + SelectionProof: testhelpers.FillByteSlice(96, 82), Slot: 75, ValidatorIndex: 76, SubcommitteeIndex: 77, @@ -58,7 +58,7 @@ func TestGetAggregatedSyncSelections(t *testing.T) { name: "no response error", req: []iface.SyncCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 82), + SelectionProof: testhelpers.FillByteSlice(96, 82), Slot: 75, ValidatorIndex: 76, SubcommitteeIndex: 77, @@ -70,13 +70,13 @@ func TestGetAggregatedSyncSelections(t *testing.T) { name: "mismatch response", req: []iface.SyncCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 82), + SelectionProof: testhelpers.FillByteSlice(96, 82), Slot: 75, ValidatorIndex: 76, SubcommitteeIndex: 77, }, { - SelectionProof: test_helpers.FillByteSlice(96, 100), + SelectionProof: testhelpers.FillByteSlice(96, 100), Slot: 75, ValidatorIndex: 76, SubcommitteeIndex: 78, @@ -84,7 +84,7 @@ func TestGetAggregatedSyncSelections(t *testing.T) { }, res: []iface.SyncCommitteeSelection{ { - SelectionProof: test_helpers.FillByteSlice(96, 100), + SelectionProof: testhelpers.FillByteSlice(96, 100), Slot: 75, ValidatorIndex: 76, SubcommitteeIndex: 77, diff --git a/validator/client/beacon-api/sync_committee_test.go b/validator/client/beacon-api/sync_committee_test.go index 8888a3c63922..581dc1bb48bc 100644 --- a/validator/client/beacon-api/sync_committee_test.go +++ b/validator/client/beacon-api/sync_committee_test.go @@ -55,7 +55,7 @@ func TestSubmitSyncMessage_Valid(t *testing.T) { nil, ).Times(1) - protoSyncCommiteeMessage := ethpb.SyncCommitteeMessage{ + protoSyncCommitteeMessage := ethpb.SyncCommitteeMessage{ Slot: primitives.Slot(42), BlockRoot: decodedBeaconBlockRoot, ValidatorIndex: primitives.ValidatorIndex(12345), @@ -63,7 +63,7 @@ func TestSubmitSyncMessage_Valid(t *testing.T) { } validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - res, err := validatorClient.SubmitSyncMessage(context.Background(), &protoSyncCommiteeMessage) + res, err := validatorClient.SubmitSyncMessage(context.Background(), &protoSyncCommitteeMessage) assert.DeepEqual(t, new(empty.Empty), res) require.NoError(t, err) diff --git a/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go b/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go index f54787dbafa8..bc1f6c1ca26d 100644 --- a/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go +++ b/validator/client/grpc-api/grpc_prysm_beacon_chain_client_test.go @@ -83,8 +83,8 @@ func TestGetValidatorCount(t *testing.T) { Slashed: false, }, } - for _, validator := range validators { - require.NoError(t, st.AppendValidator(validator)) + for _, v := range validators { + require.NoError(t, st.AppendValidator(v)) require.NoError(t, st.AppendBalance(params.BeaconConfig().MaxEffectiveBalance)) } diff --git a/validator/client/grpc-api/grpc_validator_client.go b/validator/client/grpc-api/grpc_validator_client.go index 25cbb4fb698a..4aadcd4cfc16 100644 --- a/validator/client/grpc-api/grpc_validator_client.go +++ b/validator/client/grpc-api/grpc_validator_client.go @@ -142,11 +142,11 @@ func (c *grpcValidatorClient) AggregatedSigAndAggregationBits( return c.beaconNodeValidatorClient.AggregatedSigAndAggregationBits(ctx, in) } -func (grpcValidatorClient) AggregatedSelections(context.Context, []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { +func (*grpcValidatorClient) AggregatedSelections(context.Context, []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { return nil, iface.ErrNotSupported } -func (grpcValidatorClient) AggregatedSyncSelections(context.Context, []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { +func (*grpcValidatorClient) AggregatedSyncSelections(context.Context, []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { return nil, iface.ErrNotSupported } diff --git a/validator/client/iface/validator_client.go b/validator/client/iface/validator_client.go index b53044152af2..4b9dfacec11d 100644 --- a/validator/client/iface/validator_client.go +++ b/validator/client/iface/validator_client.go @@ -26,7 +26,7 @@ type beaconCommitteeSelectionJson struct { ValidatorIndex string `json:"validator_index"` } -func (b BeaconCommitteeSelection) MarshalJSON() ([]byte, error) { +func (b *BeaconCommitteeSelection) MarshalJSON() ([]byte, error) { return json.Marshal(beaconCommitteeSelectionJson{ SelectionProof: hexutil.Encode(b.SelectionProof), Slot: strconv.FormatUint(uint64(b.Slot), 10), @@ -77,7 +77,7 @@ type syncCommitteeSelectionJson struct { ValidatorIndex string `json:"validator_index"` } -func (s SyncCommitteeSelection) MarshalJSON() ([]byte, error) { +func (s *SyncCommitteeSelection) MarshalJSON() ([]byte, error) { return json.Marshal(syncCommitteeSelectionJson{ SelectionProof: hexutil.Encode(s.SelectionProof), Slot: strconv.FormatUint(uint64(s.Slot), 10), diff --git a/validator/client/metrics.go b/validator/client/metrics.go index 72a1c2ca9ef0..d8ea5f91e852 100644 --- a/validator/client/metrics.go +++ b/validator/client/metrics.go @@ -67,16 +67,6 @@ var ( "pubkey", }, ) - // ValidatorProposeFailVecSlasher used to count failed proposals by slashing protection. - ValidatorProposeFailVecSlasher = promauto.NewCounterVec( - prometheus.CounterOpts{ - Name: "validator_proposals_rejected_total", - Help: "Count the block proposals rejected by slashing protection.", - }, - []string{ - "pubkey", - }, - ) // ValidatorBalancesGaugeVec used to keep track of validator balances by public key. ValidatorBalancesGaugeVec = promauto.NewGaugeVec( prometheus.GaugeOpts{ @@ -158,16 +148,6 @@ var ( "pubkey", }, ) - // ValidatorAttestFailVecSlasher used to count failed attestations by slashing protection. - ValidatorAttestFailVecSlasher = promauto.NewCounterVec( - prometheus.CounterOpts{ - Name: "validator_attestations_rejected_total", - Help: "Count the attestations rejected by slashing protection.", - }, - []string{ - "pubkey", - }, - ) // ValidatorNextAttestationSlotGaugeVec used to track validator statuses by public key. ValidatorNextAttestationSlotGaugeVec = promauto.NewGaugeVec( prometheus.GaugeOpts{ @@ -195,7 +175,7 @@ var ( prometheus.GaugeOpts{ Namespace: "validator", Name: "in_sync_committee", - Help: "validator sync committee.New in Altair hardfork", + Help: "validator sync committee.New in Altair hard fork", }, []string{ "pubkey", @@ -206,7 +186,7 @@ var ( prometheus.GaugeOpts{ Namespace: "validator", Name: "in_next_sync_committee", - Help: "validator next sync committee. New in Altair hardfork", + Help: "validator next sync committee. New in Altair hard fork", }, []string{ "pubkey", @@ -217,7 +197,7 @@ var ( prometheus.GaugeOpts{ Namespace: "validator", Name: "inactivity_score", - Help: "Validator inactivity score. 0 is optimum number. New in Altair hardfork", + Help: "Validator inactivity score. 0 is optimum number. New in Altair hard fork", }, []string{ "pubkey", diff --git a/validator/client/propose.go b/validator/client/propose.go index cc92ff146bb1..4e546a419ce6 100644 --- a/validator/client/propose.go +++ b/validator/client/propose.go @@ -148,6 +148,8 @@ func (v *validator) ProposeBlock(ctx context.Context, slot primitives.Slot, pubK log.WithError(err).Error("Failed to build generic signed block") return } + default: + log.Errorf("Unsupported block version %s", version.String(blk.Version())) } } else { genericSignedBlock, err = blk.PbGenericBlock() @@ -426,7 +428,7 @@ func signVoluntaryExit( return sig.Marshal(), nil } -// GetGraffiti gets the graffiti from cli or file for the validator public key. +// Graffiti gets the graffiti from cli or file for the validator public key. func (v *validator) Graffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { if v.proposerSettings != nil { // Check proposer settings for specific key first diff --git a/validator/client/propose_test.go b/validator/client/propose_test.go index 36f2575ef501..05ea95983937 100644 --- a/validator/client/propose_test.go +++ b/validator/client/propose_test.go @@ -294,16 +294,16 @@ func TestProposeBlock_BlocksDoubleProposal(t *testing.T) { block0, block1 := util.NewBeaconBlock(), util.NewBeaconBlock() block1.Block.Body.Graffiti = blockGraffiti[:] - var blocks []*ethpb.GenericBeaconBlock + var bs []*ethpb.GenericBeaconBlock for _, block := range []*ethpb.SignedBeaconBlock{block0, block1} { block.Block.Slot = slot - blocks = append(blocks, ðpb.GenericBeaconBlock{ + bs = append(bs, ðpb.GenericBeaconBlock{ Block: ðpb.GenericBeaconBlock_Phase0{ Phase0: block.Block, }, }) } - return blocks + return bs }(), }, { @@ -312,16 +312,16 @@ func TestProposeBlock_BlocksDoubleProposal(t *testing.T) { block0, block1 := util.NewBeaconBlockAltair(), util.NewBeaconBlockAltair() block1.Block.Body.Graffiti = blockGraffiti[:] - var blocks []*ethpb.GenericBeaconBlock + var bs []*ethpb.GenericBeaconBlock for _, block := range []*ethpb.SignedBeaconBlockAltair{block0, block1} { block.Block.Slot = slot - blocks = append(blocks, ðpb.GenericBeaconBlock{ + bs = append(bs, ðpb.GenericBeaconBlock{ Block: ðpb.GenericBeaconBlock_Altair{ Altair: block.Block, }, }) } - return blocks + return bs }(), }, { @@ -330,16 +330,16 @@ func TestProposeBlock_BlocksDoubleProposal(t *testing.T) { block0, block1 := util.NewBeaconBlockBellatrix(), util.NewBeaconBlockBellatrix() block1.Block.Body.Graffiti = blockGraffiti[:] - var blocks []*ethpb.GenericBeaconBlock + var bs []*ethpb.GenericBeaconBlock for _, block := range []*ethpb.SignedBeaconBlockBellatrix{block0, block1} { block.Block.Slot = slot - blocks = append(blocks, ðpb.GenericBeaconBlock{ + bs = append(bs, ðpb.GenericBeaconBlock{ Block: ðpb.GenericBeaconBlock_Bellatrix{ Bellatrix: block.Block, }, }) } - return blocks + return bs }(), }, } diff --git a/validator/client/runner_test.go b/validator/client/runner_test.go index 3b4aedbb8d5e..dffadbabcc82 100644 --- a/validator/client/runner_test.go +++ b/validator/client/runner_test.go @@ -372,14 +372,14 @@ func TestUpdateProposerSettingsAt_EpochEndOk(t *testing.T) { } func TestUpdateProposerSettings_ContinuesAfterValidatorRegistrationFails(t *testing.T) { - errSomeotherError := errors.New("some internal error") + errSomeOtherError := errors.New("some internal error") ctrl := gomock.NewController(t) defer ctrl.Finish() node := healthTesting.NewMockHealthClient(ctrl) tracker := beacon.NewNodeHealthTracker(node) node.EXPECT().IsHealthy(gomock.Any()).Return(true).AnyTimes() v := &testutil.FakeValidator{ - ProposerSettingsErr: errors.Wrap(ErrBuilderValidatorRegistration, errSomeotherError.Error()), + ProposerSettingsErr: errors.Wrap(ErrBuilderValidatorRegistration, errSomeOtherError.Error()), Km: &mockKeymanager{accountsChangedFeed: &event.Feed{}}, Tracker: tracker, } diff --git a/validator/client/service.go b/validator/client/service.go index 8657458ac9a7..ec6fb1c29b97 100644 --- a/validator/client/service.go +++ b/validator/client/service.go @@ -261,7 +261,7 @@ func (v *ValidatorService) SetProposerSettings(ctx context.Context, settings *pr v.proposerSettings = settings // passes settings down to be updated in database and saved in memory. - // updates to validator porposer settings will be in the validator object and not validator service. + // updates to validator proposer settings will be in the validator object and not validator service. return v.validator.SetProposerSettings(ctx, settings) } diff --git a/validator/client/testutil/mock_validator.go b/validator/client/testutil/mock_validator.go index fecd9f300a89..4012807e1741 100644 --- a/validator/client/testutil/mock_validator.go +++ b/validator/client/testutil/mock_validator.go @@ -254,7 +254,7 @@ func (*FakeValidator) HasProposerSettings() bool { } // PushProposerSettings for mocking -func (fv *FakeValidator) PushProposerSettings(ctx context.Context, km keymanager.IKeymanager, slot primitives.Slot, deadline time.Time) error { +func (fv *FakeValidator) PushProposerSettings(ctx context.Context, _ keymanager.IKeymanager, _ primitives.Slot, deadline time.Time) error { nctx, cancel := context.WithDeadline(ctx, deadline) ctx = nctx defer cancel() @@ -294,7 +294,7 @@ func (fv *FakeValidator) SetProposerSettings(_ context.Context, settings *propos return nil } -// GetGraffiti for mocking +// Graffiti for mocking func (fv *FakeValidator) Graffiti(_ context.Context, _ [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { return []byte(fv.graffiti), nil } diff --git a/validator/client/validator.go b/validator/client/validator.go index 4f164adba02b..b50138f8b4a0 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -39,7 +39,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/time/slots" accountsiface "github.com/prysmaticlabs/prysm/v5/validator/accounts/iface" "github.com/prysmaticlabs/prysm/v5/validator/accounts/wallet" - beacon_api "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api" + beaconapi "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" "github.com/prysmaticlabs/prysm/v5/validator/db" dbCommon "github.com/prysmaticlabs/prysm/v5/validator/db/common" @@ -132,7 +132,7 @@ func (v *validator) Done() { v.ticker.Done() } -// WaitForKmInitialization checks if the validator needs to wait for keymanager initialization. +// WaitForKeymanagerInitialization checks if the validator needs to wait for keymanager initialization. func (v *validator) WaitForKeymanagerInitialization(ctx context.Context) error { genesisRoot, err := v.db.GenesisValidatorsRoot(ctx) if err != nil { @@ -255,7 +255,7 @@ func (v *validator) WaitForChainStart(ctx context.Context) error { return client.ErrConnectionIssue } - if ctx.Err() == context.Canceled { + if errors.Is(ctx.Err(), context.Canceled) { return errors.Wrap(ctx.Err(), "context has been canceled so shutting down the loop") } @@ -341,48 +341,48 @@ func (v *validator) WaitForSync(ctx context.Context) error { func (v *validator) checkAndLogValidatorStatus(statuses []*validatorStatus, activeValCount int64) bool { nonexistentIndex := primitives.ValidatorIndex(^uint64(0)) var validatorActivated bool - for _, status := range statuses { + for _, s := range statuses { fields := logrus.Fields{ - "pubkey": fmt.Sprintf("%#x", bytesutil.Trunc(status.publicKey)), - "status": status.status.Status.String(), + "pubkey": fmt.Sprintf("%#x", bytesutil.Trunc(s.publicKey)), + "status": s.status.Status.String(), } - if status.index != nonexistentIndex { - fields["validatorIndex"] = status.index + if s.index != nonexistentIndex { + fields["validatorIndex"] = s.index } log := log.WithFields(fields) if v.emitAccountMetrics { - fmtKey := fmt.Sprintf("%#x", status.publicKey) - ValidatorStatusesGaugeVec.WithLabelValues(fmtKey).Set(float64(status.status.Status)) + fmtKey := fmt.Sprintf("%#x", s.publicKey) + ValidatorStatusesGaugeVec.WithLabelValues(fmtKey).Set(float64(s.status.Status)) } - switch status.status.Status { + switch s.status.Status { case ethpb.ValidatorStatus_UNKNOWN_STATUS: log.Info("Waiting for deposit to be observed by beacon node") case ethpb.ValidatorStatus_DEPOSITED: - if status.status.PositionInActivationQueue != 0 { + if s.status.PositionInActivationQueue != 0 { log.WithField( - "positionInActivationQueue", status.status.PositionInActivationQueue, + "positionInActivationQueue", s.status.PositionInActivationQueue, ).Info("Deposit processed, entering activation queue after finalization") } case ethpb.ValidatorStatus_PENDING: - if activeValCount >= 0 && status.status.ActivationEpoch == params.BeaconConfig().FarFutureEpoch { + if activeValCount >= 0 && s.status.ActivationEpoch == params.BeaconConfig().FarFutureEpoch { activationsPerEpoch := uint64(math.Max(float64(params.BeaconConfig().MinPerEpochChurnLimit), float64(uint64(activeValCount)/params.BeaconConfig().ChurnLimitQuotient))) secondsPerEpoch := uint64(params.BeaconConfig().SlotsPerEpoch.Mul(params.BeaconConfig().SecondsPerSlot)) expectedWaitingTime := - time.Duration((status.status.PositionInActivationQueue+activationsPerEpoch)/activationsPerEpoch*secondsPerEpoch) * time.Second + time.Duration((s.status.PositionInActivationQueue+activationsPerEpoch)/activationsPerEpoch*secondsPerEpoch) * time.Second log.WithFields(logrus.Fields{ - "positionInActivationQueue": status.status.PositionInActivationQueue, + "positionInActivationQueue": s.status.PositionInActivationQueue, "expectedWaitingTime": expectedWaitingTime.String(), }).Info("Waiting to be assigned activation epoch") - } else if status.status.ActivationEpoch != params.BeaconConfig().FarFutureEpoch { + } else if s.status.ActivationEpoch != params.BeaconConfig().FarFutureEpoch { log.WithFields(logrus.Fields{ - "activationEpoch": status.status.ActivationEpoch, + "activationEpoch": s.status.ActivationEpoch, }).Info("Waiting for activation") } case ethpb.ValidatorStatus_ACTIVE, ethpb.ValidatorStatus_EXITING: validatorActivated = true log.WithFields(logrus.Fields{ - "index": status.index, + "index": s.index, }).Info("Validator activated") case ethpb.ValidatorStatus_EXITED: log.Info("Validator exited") @@ -390,7 +390,7 @@ func (v *validator) checkAndLogValidatorStatus(statuses []*validatorStatus, acti log.Warn("Invalid Eth1 deposit") default: log.WithFields(logrus.Fields{ - "activationEpoch": status.status.ActivationEpoch, + "activationEpoch": s.status.ActivationEpoch, }).Info("Validator status") } } @@ -1137,19 +1137,19 @@ func (v *validator) filterAndCacheActiveKeys(ctx context.Context, pubkeys [][fie if err != nil { return nil, err } - for i, status := range resp.Statuses { + for i, s := range resp.Statuses { currEpoch := primitives.Epoch(slot / params.BeaconConfig().SlotsPerEpoch) - currActivating := status.Status == ethpb.ValidatorStatus_PENDING && currEpoch >= status.ActivationEpoch + currActivating := s.Status == ethpb.ValidatorStatus_PENDING && currEpoch >= s.ActivationEpoch - active := status.Status == ethpb.ValidatorStatus_ACTIVE - exiting := status.Status == ethpb.ValidatorStatus_EXITING + active := s.Status == ethpb.ValidatorStatus_ACTIVE + exiting := s.Status == ethpb.ValidatorStatus_EXITING if currActivating || active || exiting { filteredKeys = append(filteredKeys, bytesutil.ToBytes48(resp.PublicKeys[i])) } else { log.WithFields(logrus.Fields{ "pubkey": hexutil.Encode(resp.PublicKeys[i]), - "status": status.Status.String(), + "status": s.Status.String(), }).Debugf("Skipping non-active status key.") } } @@ -1285,7 +1285,7 @@ func (v *validator) validatorIndex(ctx context.Context, pubkey [fieldparams.BLSP "Perhaps the validator is not yet active.", pubkey) return 0, false, nil case err != nil: - notFoundErr := &beacon_api.IndexNotFoundError{} + notFoundErr := &beaconapi.IndexNotFoundError{} if errors.As(err, ¬FoundErr) { log.Debugf("Could not find validator index for public key %#x. "+ "Perhaps the validator is not yet active.", pubkey) diff --git a/validator/client/validator_test.go b/validator/client/validator_test.go index 23d26e18aff6..c32f7a6605ef 100644 --- a/validator/client/validator_test.go +++ b/validator/client/validator_test.go @@ -103,7 +103,7 @@ func (m *mockKeymanager) add(pairs ...keypair) error { return nil } -func (m *mockKeymanager) FetchValidatingPublicKeys(ctx context.Context) ([][fieldparams.BLSPubkeyLength]byte, error) { +func (m *mockKeymanager) FetchValidatingPublicKeys(_ context.Context) ([][fieldparams.BLSPubkeyLength]byte, error) { m.lock.RLock() defer m.lock.RUnlock() if m.fetchNoKeys { diff --git a/validator/client/wait_for_activation.go b/validator/client/wait_for_activation.go index ff90f8201ceb..0c2f6b5f417c 100644 --- a/validator/client/wait_for_activation.go +++ b/validator/client/wait_for_activation.go @@ -96,7 +96,7 @@ func (v *validator) internalWaitForActivation(ctx context.Context, accountsChang break } // If context is canceled we return from the function. - if ctx.Err() == context.Canceled { + if errors.Is(ctx.Err(), context.Canceled) { return errors.Wrap(ctx.Err(), "context has been canceled so shutting down the loop") } if err != nil { From fab8fa23bc0b774caf7d477d996d9c28b83ca60e Mon Sep 17 00:00:00 2001 From: rkapka Date: Mon, 27 May 2024 19:32:06 +0900 Subject: [PATCH 4/9] regenerate pb and mock --- proto/prysm/v1alpha1/beacon_chain.pb.go | 120 +++++------ proto/prysm/v1alpha1/beacon_chain.pb.gw.go | 36 ++-- proto/prysm/v1alpha1/debug.pb.go | 12 +- proto/prysm/v1alpha1/debug.pb.gw.go | 4 +- proto/prysm/v1alpha1/node.pb.go | 48 ++--- proto/prysm/v1alpha1/node.pb.gw.go | 16 +- proto/prysm/v1alpha1/validator.pb.go | 84 ++++---- proto/prysm/v1alpha1/validator.pb.gw.go | 28 +-- testing/mock/beacon_service_mock.go | 24 +-- testing/mock/beacon_validator_client_mock.go | 28 +-- testing/mock/beacon_validator_server_mock.go | 28 +-- testing/mock/node_service_mock.go | 36 +++- testing/validator-mock/node_client_mock.go | 80 ++++---- .../validator-mock/validator_client_mock.go | 186 +++++++++--------- .../client/beacon-api/mock/genesis_mock.go | 4 +- .../beacon-api/mock/json_rest_handler_mock.go | 38 +++- 16 files changed, 403 insertions(+), 369 deletions(-) diff --git a/proto/prysm/v1alpha1/beacon_chain.pb.go b/proto/prysm/v1alpha1/beacon_chain.pb.go index f31a9fa5e198..b753957c7c6a 100755 --- a/proto/prysm/v1alpha1/beacon_chain.pb.go +++ b/proto/prysm/v1alpha1/beacon_chain.pb.go @@ -4200,16 +4200,16 @@ var file_proto_prysm_v1alpha1_beacon_chain_proto_depIdxs = []int32{ 0, // 25: ethereum.eth.v1alpha1.BeaconChain.ListIndexedAttestations:input_type -> ethereum.eth.v1alpha1.ListIndexedAttestationsRequest 24, // 26: ethereum.eth.v1alpha1.BeaconChain.AttestationPool:input_type -> ethereum.eth.v1alpha1.AttestationPoolRequest 4, // 27: ethereum.eth.v1alpha1.BeaconChain.ListBeaconBlocks:input_type -> ethereum.eth.v1alpha1.ListBlocksRequest - 52, // 28: ethereum.eth.v1alpha1.BeaconChain.ChainHead:input_type -> google.protobuf.Empty + 52, // 28: ethereum.eth.v1alpha1.BeaconChain.GetChainHead:input_type -> google.protobuf.Empty 8, // 29: ethereum.eth.v1alpha1.BeaconChain.ListBeaconCommittees:input_type -> ethereum.eth.v1alpha1.ListCommitteesRequest - 10, // 30: ethereum.eth.v1alpha1.BeaconChain.ValidatorBalances:input_type -> ethereum.eth.v1alpha1.ListValidatorBalancesRequest - 12, // 31: ethereum.eth.v1alpha1.BeaconChain.Validators:input_type -> ethereum.eth.v1alpha1.ListValidatorsRequest + 10, // 30: ethereum.eth.v1alpha1.BeaconChain.ListValidatorBalances:input_type -> ethereum.eth.v1alpha1.ListValidatorBalancesRequest + 12, // 31: ethereum.eth.v1alpha1.BeaconChain.ListValidators:input_type -> ethereum.eth.v1alpha1.ListValidatorsRequest 13, // 32: ethereum.eth.v1alpha1.BeaconChain.GetValidator:input_type -> ethereum.eth.v1alpha1.GetValidatorRequest 15, // 33: ethereum.eth.v1alpha1.BeaconChain.GetValidatorActiveSetChanges:input_type -> ethereum.eth.v1alpha1.GetValidatorActiveSetChangesRequest - 52, // 34: ethereum.eth.v1alpha1.BeaconChain.ValidatorQueue:input_type -> google.protobuf.Empty - 17, // 35: ethereum.eth.v1alpha1.BeaconChain.ValidatorPerformance:input_type -> ethereum.eth.v1alpha1.ValidatorPerformanceRequest + 52, // 34: ethereum.eth.v1alpha1.BeaconChain.GetValidatorQueue:input_type -> google.protobuf.Empty + 17, // 35: ethereum.eth.v1alpha1.BeaconChain.GetValidatorPerformance:input_type -> ethereum.eth.v1alpha1.ValidatorPerformanceRequest 20, // 36: ethereum.eth.v1alpha1.BeaconChain.ListValidatorAssignments:input_type -> ethereum.eth.v1alpha1.ListValidatorAssignmentsRequest - 22, // 37: ethereum.eth.v1alpha1.BeaconChain.ValidatorParticipation:input_type -> ethereum.eth.v1alpha1.GetValidatorParticipationRequest + 22, // 37: ethereum.eth.v1alpha1.BeaconChain.GetValidatorParticipation:input_type -> ethereum.eth.v1alpha1.GetValidatorParticipationRequest 52, // 38: ethereum.eth.v1alpha1.BeaconChain.GetBeaconConfig:input_type -> google.protobuf.Empty 53, // 39: ethereum.eth.v1alpha1.BeaconChain.SubmitAttesterSlashing:input_type -> ethereum.eth.v1alpha1.AttesterSlashing 54, // 40: ethereum.eth.v1alpha1.BeaconChain.SubmitProposerSlashing:input_type -> ethereum.eth.v1alpha1.ProposerSlashing @@ -4218,16 +4218,16 @@ var file_proto_prysm_v1alpha1_beacon_chain_proto_depIdxs = []int32{ 3, // 43: ethereum.eth.v1alpha1.BeaconChain.ListIndexedAttestations:output_type -> ethereum.eth.v1alpha1.ListIndexedAttestationsResponse 25, // 44: ethereum.eth.v1alpha1.BeaconChain.AttestationPool:output_type -> ethereum.eth.v1alpha1.AttestationPoolResponse 5, // 45: ethereum.eth.v1alpha1.BeaconChain.ListBeaconBlocks:output_type -> ethereum.eth.v1alpha1.ListBeaconBlocksResponse - 7, // 46: ethereum.eth.v1alpha1.BeaconChain.ChainHead:output_type -> ethereum.eth.v1alpha1.ChainHead + 7, // 46: ethereum.eth.v1alpha1.BeaconChain.GetChainHead:output_type -> ethereum.eth.v1alpha1.ChainHead 9, // 47: ethereum.eth.v1alpha1.BeaconChain.ListBeaconCommittees:output_type -> ethereum.eth.v1alpha1.BeaconCommittees - 11, // 48: ethereum.eth.v1alpha1.BeaconChain.ValidatorBalances:output_type -> ethereum.eth.v1alpha1.ValidatorBalances - 14, // 49: ethereum.eth.v1alpha1.BeaconChain.Validators:output_type -> ethereum.eth.v1alpha1.Validators + 11, // 48: ethereum.eth.v1alpha1.BeaconChain.ListValidatorBalances:output_type -> ethereum.eth.v1alpha1.ValidatorBalances + 14, // 49: ethereum.eth.v1alpha1.BeaconChain.ListValidators:output_type -> ethereum.eth.v1alpha1.Validators 51, // 50: ethereum.eth.v1alpha1.BeaconChain.GetValidator:output_type -> ethereum.eth.v1alpha1.Validator 16, // 51: ethereum.eth.v1alpha1.BeaconChain.GetValidatorActiveSetChanges:output_type -> ethereum.eth.v1alpha1.ActiveSetChanges - 19, // 52: ethereum.eth.v1alpha1.BeaconChain.ValidatorQueue:output_type -> ethereum.eth.v1alpha1.ValidatorQueue - 18, // 53: ethereum.eth.v1alpha1.BeaconChain.ValidatorPerformance:output_type -> ethereum.eth.v1alpha1.ValidatorPerformanceResponse + 19, // 52: ethereum.eth.v1alpha1.BeaconChain.GetValidatorQueue:output_type -> ethereum.eth.v1alpha1.ValidatorQueue + 18, // 53: ethereum.eth.v1alpha1.BeaconChain.GetValidatorPerformance:output_type -> ethereum.eth.v1alpha1.ValidatorPerformanceResponse 21, // 54: ethereum.eth.v1alpha1.BeaconChain.ListValidatorAssignments:output_type -> ethereum.eth.v1alpha1.ValidatorAssignments - 23, // 55: ethereum.eth.v1alpha1.BeaconChain.ValidatorParticipation:output_type -> ethereum.eth.v1alpha1.ValidatorParticipationResponse + 23, // 55: ethereum.eth.v1alpha1.BeaconChain.GetValidatorParticipation:output_type -> ethereum.eth.v1alpha1.ValidatorParticipationResponse 26, // 56: ethereum.eth.v1alpha1.BeaconChain.GetBeaconConfig:output_type -> ethereum.eth.v1alpha1.BeaconConfig 27, // 57: ethereum.eth.v1alpha1.BeaconChain.SubmitAttesterSlashing:output_type -> ethereum.eth.v1alpha1.SubmitSlashingResponse 27, // 58: ethereum.eth.v1alpha1.BeaconChain.SubmitProposerSlashing:output_type -> ethereum.eth.v1alpha1.SubmitSlashingResponse @@ -4836,7 +4836,7 @@ func (c *beaconChainClient) ListBeaconBlocks(ctx context.Context, in *ListBlocks // Deprecated: Do not use. func (c *beaconChainClient) GetChainHead(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ChainHead, error) { out := new(ChainHead) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/ChainHead", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/GetChainHead", in, out, opts...) if err != nil { return nil, err } @@ -4854,7 +4854,7 @@ func (c *beaconChainClient) ListBeaconCommittees(ctx context.Context, in *ListCo func (c *beaconChainClient) ListValidatorBalances(ctx context.Context, in *ListValidatorBalancesRequest, opts ...grpc.CallOption) (*ValidatorBalances, error) { out := new(ValidatorBalances) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorBalances", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/ListValidatorBalances", in, out, opts...) if err != nil { return nil, err } @@ -4863,7 +4863,7 @@ func (c *beaconChainClient) ListValidatorBalances(ctx context.Context, in *ListV func (c *beaconChainClient) ListValidators(ctx context.Context, in *ListValidatorsRequest, opts ...grpc.CallOption) (*Validators, error) { out := new(Validators) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/Validators", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/ListValidators", in, out, opts...) if err != nil { return nil, err } @@ -4890,7 +4890,7 @@ func (c *beaconChainClient) GetValidatorActiveSetChanges(ctx context.Context, in func (c *beaconChainClient) GetValidatorQueue(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ValidatorQueue, error) { out := new(ValidatorQueue) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorQueue", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorQueue", in, out, opts...) if err != nil { return nil, err } @@ -4899,7 +4899,7 @@ func (c *beaconChainClient) GetValidatorQueue(ctx context.Context, in *emptypb.E func (c *beaconChainClient) GetValidatorPerformance(ctx context.Context, in *ValidatorPerformanceRequest, opts ...grpc.CallOption) (*ValidatorPerformanceResponse, error) { out := new(ValidatorPerformanceResponse) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorPerformance", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorPerformance", in, out, opts...) if err != nil { return nil, err } @@ -4918,7 +4918,7 @@ func (c *beaconChainClient) ListValidatorAssignments(ctx context.Context, in *Li // Deprecated: Do not use. func (c *beaconChainClient) GetValidatorParticipation(ctx context.Context, in *GetValidatorParticipationRequest, opts ...grpc.CallOption) (*ValidatorParticipationResponse, error) { out := new(ValidatorParticipationResponse) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorParticipation", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorParticipation", in, out, opts...) if err != nil { return nil, err } @@ -4968,17 +4968,17 @@ type BeaconChainServer interface { AttestationPool(context.Context, *AttestationPoolRequest) (*AttestationPoolResponse, error) ListBeaconBlocks(context.Context, *ListBlocksRequest) (*ListBeaconBlocksResponse, error) // Deprecated: Do not use. - ChainHead(context.Context, *emptypb.Empty) (*ChainHead, error) + GetChainHead(context.Context, *emptypb.Empty) (*ChainHead, error) ListBeaconCommittees(context.Context, *ListCommitteesRequest) (*BeaconCommittees, error) - ValidatorBalances(context.Context, *ListValidatorBalancesRequest) (*ValidatorBalances, error) - Validators(context.Context, *ListValidatorsRequest) (*Validators, error) + ListValidatorBalances(context.Context, *ListValidatorBalancesRequest) (*ValidatorBalances, error) + ListValidators(context.Context, *ListValidatorsRequest) (*Validators, error) GetValidator(context.Context, *GetValidatorRequest) (*Validator, error) GetValidatorActiveSetChanges(context.Context, *GetValidatorActiveSetChangesRequest) (*ActiveSetChanges, error) - ValidatorQueue(context.Context, *emptypb.Empty) (*ValidatorQueue, error) - ValidatorPerformance(context.Context, *ValidatorPerformanceRequest) (*ValidatorPerformanceResponse, error) + GetValidatorQueue(context.Context, *emptypb.Empty) (*ValidatorQueue, error) + GetValidatorPerformance(context.Context, *ValidatorPerformanceRequest) (*ValidatorPerformanceResponse, error) ListValidatorAssignments(context.Context, *ListValidatorAssignmentsRequest) (*ValidatorAssignments, error) // Deprecated: Do not use. - ValidatorParticipation(context.Context, *GetValidatorParticipationRequest) (*ValidatorParticipationResponse, error) + GetValidatorParticipation(context.Context, *GetValidatorParticipationRequest) (*ValidatorParticipationResponse, error) GetBeaconConfig(context.Context, *emptypb.Empty) (*BeaconConfig, error) SubmitAttesterSlashing(context.Context, *AttesterSlashing) (*SubmitSlashingResponse, error) SubmitProposerSlashing(context.Context, *ProposerSlashing) (*SubmitSlashingResponse, error) @@ -5001,17 +5001,17 @@ func (*UnimplementedBeaconChainServer) AttestationPool(context.Context, *Attesta func (*UnimplementedBeaconChainServer) ListBeaconBlocks(context.Context, *ListBlocksRequest) (*ListBeaconBlocksResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListBeaconBlocks not implemented") } -func (*UnimplementedBeaconChainServer) ChainHead(context.Context, *emptypb.Empty) (*ChainHead, error) { - return nil, status.Errorf(codes.Unimplemented, "method ChainHead not implemented") +func (*UnimplementedBeaconChainServer) GetChainHead(context.Context, *emptypb.Empty) (*ChainHead, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetChainHead not implemented") } func (*UnimplementedBeaconChainServer) ListBeaconCommittees(context.Context, *ListCommitteesRequest) (*BeaconCommittees, error) { return nil, status.Errorf(codes.Unimplemented, "method ListBeaconCommittees not implemented") } -func (*UnimplementedBeaconChainServer) ValidatorBalances(context.Context, *ListValidatorBalancesRequest) (*ValidatorBalances, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidatorBalances not implemented") +func (*UnimplementedBeaconChainServer) ListValidatorBalances(context.Context, *ListValidatorBalancesRequest) (*ValidatorBalances, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListValidatorBalances not implemented") } -func (*UnimplementedBeaconChainServer) Validators(context.Context, *ListValidatorsRequest) (*Validators, error) { - return nil, status.Errorf(codes.Unimplemented, "method Validators not implemented") +func (*UnimplementedBeaconChainServer) ListValidators(context.Context, *ListValidatorsRequest) (*Validators, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListValidators not implemented") } func (*UnimplementedBeaconChainServer) GetValidator(context.Context, *GetValidatorRequest) (*Validator, error) { return nil, status.Errorf(codes.Unimplemented, "method GetValidator not implemented") @@ -5019,17 +5019,17 @@ func (*UnimplementedBeaconChainServer) GetValidator(context.Context, *GetValidat func (*UnimplementedBeaconChainServer) GetValidatorActiveSetChanges(context.Context, *GetValidatorActiveSetChangesRequest) (*ActiveSetChanges, error) { return nil, status.Errorf(codes.Unimplemented, "method GetValidatorActiveSetChanges not implemented") } -func (*UnimplementedBeaconChainServer) ValidatorQueue(context.Context, *emptypb.Empty) (*ValidatorQueue, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidatorQueue not implemented") +func (*UnimplementedBeaconChainServer) GetValidatorQueue(context.Context, *emptypb.Empty) (*ValidatorQueue, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetValidatorQueue not implemented") } -func (*UnimplementedBeaconChainServer) ValidatorPerformance(context.Context, *ValidatorPerformanceRequest) (*ValidatorPerformanceResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidatorPerformance not implemented") +func (*UnimplementedBeaconChainServer) GetValidatorPerformance(context.Context, *ValidatorPerformanceRequest) (*ValidatorPerformanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetValidatorPerformance not implemented") } func (*UnimplementedBeaconChainServer) ListValidatorAssignments(context.Context, *ListValidatorAssignmentsRequest) (*ValidatorAssignments, error) { return nil, status.Errorf(codes.Unimplemented, "method ListValidatorAssignments not implemented") } -func (*UnimplementedBeaconChainServer) ValidatorParticipation(context.Context, *GetValidatorParticipationRequest) (*ValidatorParticipationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ValidatorParticipation not implemented") +func (*UnimplementedBeaconChainServer) GetValidatorParticipation(context.Context, *GetValidatorParticipationRequest) (*ValidatorParticipationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetValidatorParticipation not implemented") } func (*UnimplementedBeaconChainServer) GetBeaconConfig(context.Context, *emptypb.Empty) (*BeaconConfig, error) { return nil, status.Errorf(codes.Unimplemented, "method GetBeaconConfig not implemented") @@ -5126,14 +5126,14 @@ func _BeaconChain_GetChainHead_Handler(srv interface{}, ctx context.Context, dec return nil, err } if interceptor == nil { - return srv.(BeaconChainServer).ChainHead(ctx, in) + return srv.(BeaconChainServer).GetChainHead(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/ChainHead", + FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/GetChainHead", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BeaconChainServer).ChainHead(ctx, req.(*emptypb.Empty)) + return srv.(BeaconChainServer).GetChainHead(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } @@ -5162,14 +5162,14 @@ func _BeaconChain_ListValidatorBalances_Handler(srv interface{}, ctx context.Con return nil, err } if interceptor == nil { - return srv.(BeaconChainServer).ValidatorBalances(ctx, in) + return srv.(BeaconChainServer).ListValidatorBalances(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/ValidatorBalances", + FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/ListValidatorBalances", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BeaconChainServer).ValidatorBalances(ctx, req.(*ListValidatorBalancesRequest)) + return srv.(BeaconChainServer).ListValidatorBalances(ctx, req.(*ListValidatorBalancesRequest)) } return interceptor(ctx, in, info, handler) } @@ -5180,14 +5180,14 @@ func _BeaconChain_ListValidators_Handler(srv interface{}, ctx context.Context, d return nil, err } if interceptor == nil { - return srv.(BeaconChainServer).Validators(ctx, in) + return srv.(BeaconChainServer).ListValidators(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/Validators", + FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/ListValidators", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BeaconChainServer).Validators(ctx, req.(*ListValidatorsRequest)) + return srv.(BeaconChainServer).ListValidators(ctx, req.(*ListValidatorsRequest)) } return interceptor(ctx, in, info, handler) } @@ -5234,14 +5234,14 @@ func _BeaconChain_GetValidatorQueue_Handler(srv interface{}, ctx context.Context return nil, err } if interceptor == nil { - return srv.(BeaconChainServer).ValidatorQueue(ctx, in) + return srv.(BeaconChainServer).GetValidatorQueue(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/ValidatorQueue", + FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorQueue", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BeaconChainServer).ValidatorQueue(ctx, req.(*emptypb.Empty)) + return srv.(BeaconChainServer).GetValidatorQueue(ctx, req.(*emptypb.Empty)) } return interceptor(ctx, in, info, handler) } @@ -5252,14 +5252,14 @@ func _BeaconChain_GetValidatorPerformance_Handler(srv interface{}, ctx context.C return nil, err } if interceptor == nil { - return srv.(BeaconChainServer).ValidatorPerformance(ctx, in) + return srv.(BeaconChainServer).GetValidatorPerformance(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/ValidatorPerformance", + FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorPerformance", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BeaconChainServer).ValidatorPerformance(ctx, req.(*ValidatorPerformanceRequest)) + return srv.(BeaconChainServer).GetValidatorPerformance(ctx, req.(*ValidatorPerformanceRequest)) } return interceptor(ctx, in, info, handler) } @@ -5288,14 +5288,14 @@ func _BeaconChain_GetValidatorParticipation_Handler(srv interface{}, ctx context return nil, err } if interceptor == nil { - return srv.(BeaconChainServer).ValidatorParticipation(ctx, in) + return srv.(BeaconChainServer).GetValidatorParticipation(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/ValidatorParticipation", + FullMethod: "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorParticipation", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(BeaconChainServer).ValidatorParticipation(ctx, req.(*GetValidatorParticipationRequest)) + return srv.(BeaconChainServer).GetValidatorParticipation(ctx, req.(*GetValidatorParticipationRequest)) } return interceptor(ctx, in, info, handler) } @@ -5393,7 +5393,7 @@ var _BeaconChain_serviceDesc = grpc.ServiceDesc{ Handler: _BeaconChain_ListBeaconBlocks_Handler, }, { - MethodName: "ChainHead", + MethodName: "GetChainHead", Handler: _BeaconChain_GetChainHead_Handler, }, { @@ -5401,11 +5401,11 @@ var _BeaconChain_serviceDesc = grpc.ServiceDesc{ Handler: _BeaconChain_ListBeaconCommittees_Handler, }, { - MethodName: "ValidatorBalances", + MethodName: "ListValidatorBalances", Handler: _BeaconChain_ListValidatorBalances_Handler, }, { - MethodName: "Validators", + MethodName: "ListValidators", Handler: _BeaconChain_ListValidators_Handler, }, { @@ -5417,11 +5417,11 @@ var _BeaconChain_serviceDesc = grpc.ServiceDesc{ Handler: _BeaconChain_GetValidatorActiveSetChanges_Handler, }, { - MethodName: "ValidatorQueue", + MethodName: "GetValidatorQueue", Handler: _BeaconChain_GetValidatorQueue_Handler, }, { - MethodName: "ValidatorPerformance", + MethodName: "GetValidatorPerformance", Handler: _BeaconChain_GetValidatorPerformance_Handler, }, { @@ -5429,7 +5429,7 @@ var _BeaconChain_serviceDesc = grpc.ServiceDesc{ Handler: _BeaconChain_ListValidatorAssignments_Handler, }, { - MethodName: "ValidatorParticipation", + MethodName: "GetValidatorParticipation", Handler: _BeaconChain_GetValidatorParticipation_Handler, }, { diff --git a/proto/prysm/v1alpha1/beacon_chain.pb.gw.go b/proto/prysm/v1alpha1/beacon_chain.pb.gw.go index 70f7141924c1..6622c0bcfcde 100755 --- a/proto/prysm/v1alpha1/beacon_chain.pb.gw.go +++ b/proto/prysm/v1alpha1/beacon_chain.pb.gw.go @@ -192,7 +192,7 @@ func local_request_BeaconChain_GetChainHead_0(ctx context.Context, marshaler run var protoReq emptypb.Empty var metadata runtime.ServerMetadata - msg, err := server.ChainHead(ctx, &protoReq) + msg, err := server.GetChainHead(ctx, &protoReq) return msg, metadata, err } @@ -264,7 +264,7 @@ func local_request_BeaconChain_ListValidatorBalances_0(ctx context.Context, mars return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ValidatorBalances(ctx, &protoReq) + msg, err := server.ListValidatorBalances(ctx, &protoReq) return msg, metadata, err } @@ -300,7 +300,7 @@ func local_request_BeaconChain_ListValidators_0(ctx context.Context, marshaler r return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.Validators(ctx, &protoReq) + msg, err := server.ListValidators(ctx, &protoReq) return msg, metadata, err } @@ -390,7 +390,7 @@ func local_request_BeaconChain_GetValidatorQueue_0(ctx context.Context, marshale var protoReq emptypb.Empty var metadata runtime.ServerMetadata - msg, err := server.ValidatorQueue(ctx, &protoReq) + msg, err := server.GetValidatorQueue(ctx, &protoReq) return msg, metadata, err } @@ -426,7 +426,7 @@ func local_request_BeaconChain_GetValidatorPerformance_0(ctx context.Context, ma return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ValidatorPerformance(ctx, &protoReq) + msg, err := server.GetValidatorPerformance(ctx, &protoReq) return msg, metadata, err } @@ -498,7 +498,7 @@ func local_request_BeaconChain_GetValidatorParticipation_0(ctx context.Context, return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ValidatorParticipation(ctx, &protoReq) + msg, err := server.GetValidatorParticipation(ctx, &protoReq) return msg, metadata, err } @@ -733,7 +733,7 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ChainHead") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetChainHead") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -779,7 +779,7 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorBalances") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidatorBalances") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -802,7 +802,7 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/Validators") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidators") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -871,7 +871,7 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorQueue") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorQueue") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -894,7 +894,7 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorPerformance") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorPerformance") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -940,7 +940,7 @@ func RegisterBeaconChainHandlerServer(ctx context.Context, mux *runtime.ServeMux var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorParticipation") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorParticipation") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1174,7 +1174,7 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ChainHead") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetChainHead") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1214,7 +1214,7 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorBalances") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidatorBalances") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1234,7 +1234,7 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/Validators") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ListValidators") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1294,7 +1294,7 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorQueue") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorQueue") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1314,7 +1314,7 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorPerformance") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorPerformance") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1354,7 +1354,7 @@ func RegisterBeaconChainHandlerClient(ctx context.Context, mux *runtime.ServeMux ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/ValidatorParticipation") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconChain/GetValidatorParticipation") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return diff --git a/proto/prysm/v1alpha1/debug.pb.go b/proto/prysm/v1alpha1/debug.pb.go index 0f3c9437e5d0..1ae0501d8175 100755 --- a/proto/prysm/v1alpha1/debug.pb.go +++ b/proto/prysm/v1alpha1/debug.pb.go @@ -1082,12 +1082,12 @@ var file_proto_prysm_v1alpha1_debug_proto_depIdxs = []int32{ 3, // 11: ethereum.eth.v1alpha1.Debug.GetBeaconState:input_type -> ethereum.eth.v1alpha1.BeaconStateRequest 4, // 12: ethereum.eth.v1alpha1.Debug.GetBlock:input_type -> ethereum.eth.v1alpha1.BlockRequestByRoot 6, // 13: ethereum.eth.v1alpha1.Debug.SetLoggingLevel:input_type -> ethereum.eth.v1alpha1.LoggingLevelRequest - 18, // 14: ethereum.eth.v1alpha1.Debug.Peers:input_type -> google.protobuf.Empty + 18, // 14: ethereum.eth.v1alpha1.Debug.ListPeers:input_type -> google.protobuf.Empty 19, // 15: ethereum.eth.v1alpha1.Debug.GetPeer:input_type -> ethereum.eth.v1alpha1.PeerRequest 5, // 16: ethereum.eth.v1alpha1.Debug.GetBeaconState:output_type -> ethereum.eth.v1alpha1.SSZResponse 5, // 17: ethereum.eth.v1alpha1.Debug.GetBlock:output_type -> ethereum.eth.v1alpha1.SSZResponse 18, // 18: ethereum.eth.v1alpha1.Debug.SetLoggingLevel:output_type -> google.protobuf.Empty - 7, // 19: ethereum.eth.v1alpha1.Debug.Peers:output_type -> ethereum.eth.v1alpha1.DebugPeerResponses + 7, // 19: ethereum.eth.v1alpha1.Debug.ListPeers:output_type -> ethereum.eth.v1alpha1.DebugPeerResponses 8, // 20: ethereum.eth.v1alpha1.Debug.GetPeer:output_type -> ethereum.eth.v1alpha1.DebugPeerResponse 16, // [16:21] is the sub-list for method output_type 11, // [11:16] is the sub-list for method input_type @@ -1318,7 +1318,7 @@ func (c *debugClient) SetLoggingLevel(ctx context.Context, in *LoggingLevelReque func (c *debugClient) ListPeers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*DebugPeerResponses, error) { out := new(DebugPeerResponses) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Debug/Peers", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Debug/ListPeers", in, out, opts...) if err != nil { return nil, err } @@ -1357,7 +1357,7 @@ func (*UnimplementedDebugServer) SetLoggingLevel(context.Context, *LoggingLevelR return nil, status.Errorf(codes.Unimplemented, "method SetLoggingLevel not implemented") } func (*UnimplementedDebugServer) ListPeers(context.Context, *emptypb.Empty) (*DebugPeerResponses, error) { - return nil, status.Errorf(codes.Unimplemented, "method Peers not implemented") + return nil, status.Errorf(codes.Unimplemented, "method ListPeers not implemented") } func (*UnimplementedDebugServer) GetPeer(context.Context, *PeerRequest) (*DebugPeerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetPeer not implemented") @@ -1431,7 +1431,7 @@ func _Debug_ListPeers_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.Debug/Peers", + FullMethod: "/ethereum.eth.v1alpha1.Debug/ListPeers", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(DebugServer).ListPeers(ctx, req.(*emptypb.Empty)) @@ -1474,7 +1474,7 @@ var _Debug_serviceDesc = grpc.ServiceDesc{ Handler: _Debug_SetLoggingLevel_Handler, }, { - MethodName: "Peers", + MethodName: "ListPeers", Handler: _Debug_ListPeers_Handler, }, { diff --git a/proto/prysm/v1alpha1/debug.pb.gw.go b/proto/prysm/v1alpha1/debug.pb.gw.go index 233316291f29..750a64dc7280 100755 --- a/proto/prysm/v1alpha1/debug.pb.gw.go +++ b/proto/prysm/v1alpha1/debug.pb.gw.go @@ -278,7 +278,7 @@ func RegisterDebugHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/Peers") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/ListPeers") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -423,7 +423,7 @@ func RegisterDebugHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/Peers") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Debug/ListPeers") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return diff --git a/proto/prysm/v1alpha1/node.pb.go b/proto/prysm/v1alpha1/node.pb.go index a76f7f153dd1..ac175b8329c1 100755 --- a/proto/prysm/v1alpha1/node.pb.go +++ b/proto/prysm/v1alpha1/node.pb.go @@ -895,23 +895,23 @@ var file_proto_prysm_v1alpha1_node_proto_depIdxs = []int32{ 9, // 1: ethereum.eth.v1alpha1.Peers.peers:type_name -> ethereum.eth.v1alpha1.Peer 0, // 2: ethereum.eth.v1alpha1.Peer.direction:type_name -> ethereum.eth.v1alpha1.PeerDirection 1, // 3: ethereum.eth.v1alpha1.Peer.connection_state:type_name -> ethereum.eth.v1alpha1.ConnectionState - 13, // 4: ethereum.eth.v1alpha1.Node.SyncStatus:input_type -> google.protobuf.Empty - 13, // 5: ethereum.eth.v1alpha1.Node.Genesis:input_type -> google.protobuf.Empty - 13, // 6: ethereum.eth.v1alpha1.Node.Version:input_type -> google.protobuf.Empty + 13, // 4: ethereum.eth.v1alpha1.Node.GetSyncStatus:input_type -> google.protobuf.Empty + 13, // 5: ethereum.eth.v1alpha1.Node.GetGenesis:input_type -> google.protobuf.Empty + 13, // 6: ethereum.eth.v1alpha1.Node.GetVersion:input_type -> google.protobuf.Empty 2, // 7: ethereum.eth.v1alpha1.Node.GetHealth:input_type -> ethereum.eth.v1alpha1.HealthRequest 13, // 8: ethereum.eth.v1alpha1.Node.ListImplementedServices:input_type -> google.protobuf.Empty 13, // 9: ethereum.eth.v1alpha1.Node.GetHost:input_type -> google.protobuf.Empty 7, // 10: ethereum.eth.v1alpha1.Node.GetPeer:input_type -> ethereum.eth.v1alpha1.PeerRequest - 13, // 11: ethereum.eth.v1alpha1.Node.Peers:input_type -> google.protobuf.Empty + 13, // 11: ethereum.eth.v1alpha1.Node.ListPeers:input_type -> google.protobuf.Empty 13, // 12: ethereum.eth.v1alpha1.Node.GetETH1ConnectionStatus:input_type -> google.protobuf.Empty - 3, // 13: ethereum.eth.v1alpha1.Node.SyncStatus:output_type -> ethereum.eth.v1alpha1.SyncStatus - 4, // 14: ethereum.eth.v1alpha1.Node.Genesis:output_type -> ethereum.eth.v1alpha1.Genesis - 5, // 15: ethereum.eth.v1alpha1.Node.Version:output_type -> ethereum.eth.v1alpha1.Version + 3, // 13: ethereum.eth.v1alpha1.Node.GetSyncStatus:output_type -> ethereum.eth.v1alpha1.SyncStatus + 4, // 14: ethereum.eth.v1alpha1.Node.GetGenesis:output_type -> ethereum.eth.v1alpha1.Genesis + 5, // 15: ethereum.eth.v1alpha1.Node.GetVersion:output_type -> ethereum.eth.v1alpha1.Version 13, // 16: ethereum.eth.v1alpha1.Node.GetHealth:output_type -> google.protobuf.Empty 6, // 17: ethereum.eth.v1alpha1.Node.ListImplementedServices:output_type -> ethereum.eth.v1alpha1.ImplementedServices 10, // 18: ethereum.eth.v1alpha1.Node.GetHost:output_type -> ethereum.eth.v1alpha1.HostData 9, // 19: ethereum.eth.v1alpha1.Node.GetPeer:output_type -> ethereum.eth.v1alpha1.Peer - 8, // 20: ethereum.eth.v1alpha1.Node.Peers:output_type -> ethereum.eth.v1alpha1.Peers + 8, // 20: ethereum.eth.v1alpha1.Node.ListPeers:output_type -> ethereum.eth.v1alpha1.Peers 11, // 21: ethereum.eth.v1alpha1.Node.GetETH1ConnectionStatus:output_type -> ethereum.eth.v1alpha1.ETH1ConnectionStatus 13, // [13:22] is the sub-list for method output_type 4, // [4:13] is the sub-list for method input_type @@ -1101,7 +1101,7 @@ func NewNodeClient(cc grpc.ClientConnInterface) NodeClient { func (c *nodeClient) GetSyncStatus(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*SyncStatus, error) { out := new(SyncStatus) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Node/SyncStatus", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Node/GetSyncStatus", in, out, opts...) if err != nil { return nil, err } @@ -1110,7 +1110,7 @@ func (c *nodeClient) GetSyncStatus(ctx context.Context, in *emptypb.Empty, opts func (c *nodeClient) GetGenesis(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Genesis, error) { out := new(Genesis) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Node/Genesis", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Node/GetGenesis", in, out, opts...) if err != nil { return nil, err } @@ -1119,7 +1119,7 @@ func (c *nodeClient) GetGenesis(ctx context.Context, in *emptypb.Empty, opts ... func (c *nodeClient) GetVersion(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Version, error) { out := new(Version) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Node/Version", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Node/GetVersion", in, out, opts...) if err != nil { return nil, err } @@ -1164,7 +1164,7 @@ func (c *nodeClient) GetPeer(ctx context.Context, in *PeerRequest, opts ...grpc. func (c *nodeClient) ListPeers(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*Peers, error) { out := new(Peers) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Node/Peers", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.Node/ListPeers", in, out, opts...) if err != nil { return nil, err } @@ -1198,13 +1198,13 @@ type UnimplementedNodeServer struct { } func (*UnimplementedNodeServer) GetSyncStatus(context.Context, *emptypb.Empty) (*SyncStatus, error) { - return nil, status.Errorf(codes.Unimplemented, "method SyncStatus not implemented") + return nil, status.Errorf(codes.Unimplemented, "method GetSyncStatus not implemented") } func (*UnimplementedNodeServer) GetGenesis(context.Context, *emptypb.Empty) (*Genesis, error) { - return nil, status.Errorf(codes.Unimplemented, "method Genesis not implemented") + return nil, status.Errorf(codes.Unimplemented, "method GetGenesis not implemented") } func (*UnimplementedNodeServer) GetVersion(context.Context, *emptypb.Empty) (*Version, error) { - return nil, status.Errorf(codes.Unimplemented, "method Version not implemented") + return nil, status.Errorf(codes.Unimplemented, "method GetVersion not implemented") } func (*UnimplementedNodeServer) GetHealth(context.Context, *HealthRequest) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method GetHealth not implemented") @@ -1219,7 +1219,7 @@ func (*UnimplementedNodeServer) GetPeer(context.Context, *PeerRequest) (*Peer, e return nil, status.Errorf(codes.Unimplemented, "method GetPeer not implemented") } func (*UnimplementedNodeServer) ListPeers(context.Context, *emptypb.Empty) (*Peers, error) { - return nil, status.Errorf(codes.Unimplemented, "method Peers not implemented") + return nil, status.Errorf(codes.Unimplemented, "method ListPeers not implemented") } func (*UnimplementedNodeServer) GetETH1ConnectionStatus(context.Context, *emptypb.Empty) (*ETH1ConnectionStatus, error) { return nil, status.Errorf(codes.Unimplemented, "method GetETH1ConnectionStatus not implemented") @@ -1239,7 +1239,7 @@ func _Node_GetSyncStatus_Handler(srv interface{}, ctx context.Context, dec func( } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.Node/SyncStatus", + FullMethod: "/ethereum.eth.v1alpha1.Node/GetSyncStatus", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NodeServer).GetSyncStatus(ctx, req.(*emptypb.Empty)) @@ -1257,7 +1257,7 @@ func _Node_GetGenesis_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.Node/Genesis", + FullMethod: "/ethereum.eth.v1alpha1.Node/GetGenesis", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NodeServer).GetGenesis(ctx, req.(*emptypb.Empty)) @@ -1275,7 +1275,7 @@ func _Node_GetVersion_Handler(srv interface{}, ctx context.Context, dec func(int } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.Node/Version", + FullMethod: "/ethereum.eth.v1alpha1.Node/GetVersion", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NodeServer).GetVersion(ctx, req.(*emptypb.Empty)) @@ -1365,7 +1365,7 @@ func _Node_ListPeers_Handler(srv interface{}, ctx context.Context, dec func(inte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.Node/Peers", + FullMethod: "/ethereum.eth.v1alpha1.Node/ListPeers", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NodeServer).ListPeers(ctx, req.(*emptypb.Empty)) @@ -1396,15 +1396,15 @@ var _Node_serviceDesc = grpc.ServiceDesc{ HandlerType: (*NodeServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "SyncStatus", + MethodName: "GetSyncStatus", Handler: _Node_GetSyncStatus_Handler, }, { - MethodName: "Genesis", + MethodName: "GetGenesis", Handler: _Node_GetGenesis_Handler, }, { - MethodName: "Version", + MethodName: "GetVersion", Handler: _Node_GetVersion_Handler, }, { @@ -1424,7 +1424,7 @@ var _Node_serviceDesc = grpc.ServiceDesc{ Handler: _Node_GetPeer_Handler, }, { - MethodName: "Peers", + MethodName: "ListPeers", Handler: _Node_ListPeers_Handler, }, { diff --git a/proto/prysm/v1alpha1/node.pb.gw.go b/proto/prysm/v1alpha1/node.pb.gw.go index 5a2bc2da2b36..104633765f54 100755 --- a/proto/prysm/v1alpha1/node.pb.gw.go +++ b/proto/prysm/v1alpha1/node.pb.gw.go @@ -245,7 +245,7 @@ func RegisterNodeHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/SyncStatus") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetSyncStatus") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -268,7 +268,7 @@ func RegisterNodeHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/Genesis") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetGenesis") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -291,7 +291,7 @@ func RegisterNodeHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/Version") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetVersion") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -406,7 +406,7 @@ func RegisterNodeHandlerServer(ctx context.Context, mux *runtime.ServeMux, serve var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/Peers") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/ListPeers") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -491,7 +491,7 @@ func RegisterNodeHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/SyncStatus") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetSyncStatus") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -511,7 +511,7 @@ func RegisterNodeHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/Genesis") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetGenesis") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -531,7 +531,7 @@ func RegisterNodeHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/Version") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/GetVersion") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -631,7 +631,7 @@ func RegisterNodeHandlerClient(ctx context.Context, mux *runtime.ServeMux, clien ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/Peers") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.Node/ListPeers") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return diff --git a/proto/prysm/v1alpha1/validator.pb.go b/proto/prysm/v1alpha1/validator.pb.go index dccecb9634b4..c88f93a09fd0 100755 --- a/proto/prysm/v1alpha1/validator.pb.go +++ b/proto/prysm/v1alpha1/validator.pb.go @@ -4025,56 +4025,56 @@ var file_proto_prysm_v1alpha1_validator_proto_depIdxs = []int32{ 58, // 19: ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsRequest.msgs:type_name -> ethereum.eth.v1alpha1.SyncCommitteeMessage 16, // 20: ethereum.eth.v1alpha1.ValidatorActivationResponse.Status.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatusResponse 0, // 21: ethereum.eth.v1alpha1.DutiesResponse.Duty.status:type_name -> ethereum.eth.v1alpha1.ValidatorStatus - 19, // 22: ethereum.eth.v1alpha1.BeaconNodeValidator.Duties:input_type -> ethereum.eth.v1alpha1.DutiesRequest + 19, // 22: ethereum.eth.v1alpha1.BeaconNodeValidator.GetDuties:input_type -> ethereum.eth.v1alpha1.DutiesRequest 7, // 23: ethereum.eth.v1alpha1.BeaconNodeValidator.DomainData:input_type -> ethereum.eth.v1alpha1.DomainRequest 59, // 24: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForChainStart:input_type -> google.protobuf.Empty 9, // 25: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForActivation:input_type -> ethereum.eth.v1alpha1.ValidatorActivationRequest 13, // 26: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorIndex:input_type -> ethereum.eth.v1alpha1.ValidatorIndexRequest 15, // 27: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorStatus:input_type -> ethereum.eth.v1alpha1.ValidatorStatusRequest 17, // 28: ethereum.eth.v1alpha1.BeaconNodeValidator.MultipleValidatorStatus:input_type -> ethereum.eth.v1alpha1.MultipleValidatorStatusRequest - 21, // 29: ethereum.eth.v1alpha1.BeaconNodeValidator.BeaconBlock:input_type -> ethereum.eth.v1alpha1.BlockRequest + 21, // 29: ethereum.eth.v1alpha1.BeaconNodeValidator.GetBeaconBlock:input_type -> ethereum.eth.v1alpha1.BlockRequest 60, // 30: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeBeaconBlock:input_type -> ethereum.eth.v1alpha1.GenericSignedBeaconBlock 38, // 31: ethereum.eth.v1alpha1.BeaconNodeValidator.PrepareBeaconProposer:input_type -> ethereum.eth.v1alpha1.PrepareBeaconProposerRequest - 39, // 32: ethereum.eth.v1alpha1.BeaconNodeValidator.FeeRecipientByPubKey:input_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyRequest - 24, // 33: ethereum.eth.v1alpha1.BeaconNodeValidator.AttestationData:input_type -> ethereum.eth.v1alpha1.AttestationDataRequest + 39, // 32: ethereum.eth.v1alpha1.BeaconNodeValidator.GetFeeRecipientByPubKey:input_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyRequest + 24, // 33: ethereum.eth.v1alpha1.BeaconNodeValidator.GetAttestationData:input_type -> ethereum.eth.v1alpha1.AttestationDataRequest 61, // 34: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestation:input_type -> ethereum.eth.v1alpha1.Attestation 26, // 35: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProof:input_type -> ethereum.eth.v1alpha1.AggregateSelectionRequest 28, // 36: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProof:input_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitRequest 62, // 37: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeExit:input_type -> ethereum.eth.v1alpha1.SignedVoluntaryExit 30, // 38: ethereum.eth.v1alpha1.BeaconNodeValidator.SubscribeCommitteeSubnets:input_type -> ethereum.eth.v1alpha1.CommitteeSubnetsSubscribeRequest 34, // 39: ethereum.eth.v1alpha1.BeaconNodeValidator.CheckDoppelGanger:input_type -> ethereum.eth.v1alpha1.DoppelGangerRequest - 59, // 40: ethereum.eth.v1alpha1.BeaconNodeValidator.SyncMessageBlockRoot:input_type -> google.protobuf.Empty + 59, // 40: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncMessageBlockRoot:input_type -> google.protobuf.Empty 58, // 41: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSyncMessage:input_type -> ethereum.eth.v1alpha1.SyncCommitteeMessage - 2, // 42: ethereum.eth.v1alpha1.BeaconNodeValidator.SyncSubcommitteeIndex:input_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexRequest - 3, // 43: ethereum.eth.v1alpha1.BeaconNodeValidator.SyncCommitteeContribution:input_type -> ethereum.eth.v1alpha1.SyncCommitteeContributionRequest + 2, // 42: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncSubcommitteeIndex:input_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexRequest + 3, // 43: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:input_type -> ethereum.eth.v1alpha1.SyncCommitteeContributionRequest 63, // 44: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:input_type -> ethereum.eth.v1alpha1.SignedContributionAndProof 36, // 45: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamSlots:input_type -> ethereum.eth.v1alpha1.StreamSlotsRequest 37, // 46: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:input_type -> ethereum.eth.v1alpha1.StreamBlocksRequest 64, // 47: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitValidatorRegistrations:input_type -> ethereum.eth.v1alpha1.SignedValidatorRegistrationsV1 41, // 48: ethereum.eth.v1alpha1.BeaconNodeValidator.AssignValidatorToSubnet:input_type -> ethereum.eth.v1alpha1.AssignValidatorToSubnetRequest 42, // 49: ethereum.eth.v1alpha1.BeaconNodeValidator.AggregatedSigAndAggregationBits:input_type -> ethereum.eth.v1alpha1.AggregatedSigAndAggregationBitsRequest - 20, // 50: ethereum.eth.v1alpha1.BeaconNodeValidator.Duties:output_type -> ethereum.eth.v1alpha1.DutiesResponse + 20, // 50: ethereum.eth.v1alpha1.BeaconNodeValidator.GetDuties:output_type -> ethereum.eth.v1alpha1.DutiesResponse 8, // 51: ethereum.eth.v1alpha1.BeaconNodeValidator.DomainData:output_type -> ethereum.eth.v1alpha1.DomainResponse 11, // 52: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForChainStart:output_type -> ethereum.eth.v1alpha1.ChainStartResponse 10, // 53: ethereum.eth.v1alpha1.BeaconNodeValidator.WaitForActivation:output_type -> ethereum.eth.v1alpha1.ValidatorActivationResponse 14, // 54: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorIndex:output_type -> ethereum.eth.v1alpha1.ValidatorIndexResponse 16, // 55: ethereum.eth.v1alpha1.BeaconNodeValidator.ValidatorStatus:output_type -> ethereum.eth.v1alpha1.ValidatorStatusResponse 18, // 56: ethereum.eth.v1alpha1.BeaconNodeValidator.MultipleValidatorStatus:output_type -> ethereum.eth.v1alpha1.MultipleValidatorStatusResponse - 65, // 57: ethereum.eth.v1alpha1.BeaconNodeValidator.BeaconBlock:output_type -> ethereum.eth.v1alpha1.GenericBeaconBlock + 65, // 57: ethereum.eth.v1alpha1.BeaconNodeValidator.GetBeaconBlock:output_type -> ethereum.eth.v1alpha1.GenericBeaconBlock 22, // 58: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeBeaconBlock:output_type -> ethereum.eth.v1alpha1.ProposeResponse 59, // 59: ethereum.eth.v1alpha1.BeaconNodeValidator.PrepareBeaconProposer:output_type -> google.protobuf.Empty - 40, // 60: ethereum.eth.v1alpha1.BeaconNodeValidator.FeeRecipientByPubKey:output_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyResponse - 66, // 61: ethereum.eth.v1alpha1.BeaconNodeValidator.AttestationData:output_type -> ethereum.eth.v1alpha1.AttestationData + 40, // 60: ethereum.eth.v1alpha1.BeaconNodeValidator.GetFeeRecipientByPubKey:output_type -> ethereum.eth.v1alpha1.FeeRecipientByPubKeyResponse + 66, // 61: ethereum.eth.v1alpha1.BeaconNodeValidator.GetAttestationData:output_type -> ethereum.eth.v1alpha1.AttestationData 25, // 62: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeAttestation:output_type -> ethereum.eth.v1alpha1.AttestResponse 27, // 63: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.AggregateSelectionResponse 29, // 64: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedAggregateSelectionProof:output_type -> ethereum.eth.v1alpha1.SignedAggregateSubmitResponse 23, // 65: ethereum.eth.v1alpha1.BeaconNodeValidator.ProposeExit:output_type -> ethereum.eth.v1alpha1.ProposeExitResponse 59, // 66: ethereum.eth.v1alpha1.BeaconNodeValidator.SubscribeCommitteeSubnets:output_type -> google.protobuf.Empty 35, // 67: ethereum.eth.v1alpha1.BeaconNodeValidator.CheckDoppelGanger:output_type -> ethereum.eth.v1alpha1.DoppelGangerResponse - 1, // 68: ethereum.eth.v1alpha1.BeaconNodeValidator.SyncMessageBlockRoot:output_type -> ethereum.eth.v1alpha1.SyncMessageBlockRootResponse + 1, // 68: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncMessageBlockRoot:output_type -> ethereum.eth.v1alpha1.SyncMessageBlockRootResponse 59, // 69: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSyncMessage:output_type -> google.protobuf.Empty - 4, // 70: ethereum.eth.v1alpha1.BeaconNodeValidator.SyncSubcommitteeIndex:output_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexResponse - 67, // 71: ethereum.eth.v1alpha1.BeaconNodeValidator.SyncCommitteeContribution:output_type -> ethereum.eth.v1alpha1.SyncCommitteeContribution + 4, // 70: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncSubcommitteeIndex:output_type -> ethereum.eth.v1alpha1.SyncSubcommitteeIndexResponse + 67, // 71: ethereum.eth.v1alpha1.BeaconNodeValidator.GetSyncCommitteeContribution:output_type -> ethereum.eth.v1alpha1.SyncCommitteeContribution 59, // 72: ethereum.eth.v1alpha1.BeaconNodeValidator.SubmitSignedContributionAndProof:output_type -> google.protobuf.Empty 5, // 73: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamSlots:output_type -> ethereum.eth.v1alpha1.StreamSlotsResponse 6, // 74: ethereum.eth.v1alpha1.BeaconNodeValidator.StreamBlocksAltair:output_type -> ethereum.eth.v1alpha1.StreamBlocksResponse @@ -4758,7 +4758,7 @@ func NewBeaconNodeValidatorClient(cc grpc.ClientConnInterface) BeaconNodeValidat func (c *beaconNodeValidatorClient) GetDuties(ctx context.Context, in *DutiesRequest, opts ...grpc.CallOption) (*DutiesResponse, error) { out := new(DutiesResponse) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/Duties", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetDuties", in, out, opts...) if err != nil { return nil, err } @@ -4868,7 +4868,7 @@ func (c *beaconNodeValidatorClient) MultipleValidatorStatus(ctx context.Context, func (c *beaconNodeValidatorClient) GetBeaconBlock(ctx context.Context, in *BlockRequest, opts ...grpc.CallOption) (*GenericBeaconBlock, error) { out := new(GenericBeaconBlock) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/BeaconBlock", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetBeaconBlock", in, out, opts...) if err != nil { return nil, err } @@ -4895,7 +4895,7 @@ func (c *beaconNodeValidatorClient) PrepareBeaconProposer(ctx context.Context, i func (c *beaconNodeValidatorClient) GetFeeRecipientByPubKey(ctx context.Context, in *FeeRecipientByPubKeyRequest, opts ...grpc.CallOption) (*FeeRecipientByPubKeyResponse, error) { out := new(FeeRecipientByPubKeyResponse) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/FeeRecipientByPubKey", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetFeeRecipientByPubKey", in, out, opts...) if err != nil { return nil, err } @@ -4904,7 +4904,7 @@ func (c *beaconNodeValidatorClient) GetFeeRecipientByPubKey(ctx context.Context, func (c *beaconNodeValidatorClient) GetAttestationData(ctx context.Context, in *AttestationDataRequest, opts ...grpc.CallOption) (*AttestationData, error) { out := new(AttestationData) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/AttestationData", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetAttestationData", in, out, opts...) if err != nil { return nil, err } @@ -4967,7 +4967,7 @@ func (c *beaconNodeValidatorClient) CheckDoppelGanger(ctx context.Context, in *D func (c *beaconNodeValidatorClient) GetSyncMessageBlockRoot(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*SyncMessageBlockRootResponse, error) { out := new(SyncMessageBlockRootResponse) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncMessageBlockRoot", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncMessageBlockRoot", in, out, opts...) if err != nil { return nil, err } @@ -4985,7 +4985,7 @@ func (c *beaconNodeValidatorClient) SubmitSyncMessage(ctx context.Context, in *S func (c *beaconNodeValidatorClient) GetSyncSubcommitteeIndex(ctx context.Context, in *SyncSubcommitteeIndexRequest, opts ...grpc.CallOption) (*SyncSubcommitteeIndexResponse, error) { out := new(SyncSubcommitteeIndexResponse) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncSubcommitteeIndex", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncSubcommitteeIndex", in, out, opts...) if err != nil { return nil, err } @@ -4994,7 +4994,7 @@ func (c *beaconNodeValidatorClient) GetSyncSubcommitteeIndex(ctx context.Context func (c *beaconNodeValidatorClient) GetSyncCommitteeContribution(ctx context.Context, in *SyncCommitteeContributionRequest, opts ...grpc.CallOption) (*SyncCommitteeContribution, error) { out := new(SyncCommitteeContribution) - err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncCommitteeContribution", in, out, opts...) + err := c.cc.Invoke(ctx, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncCommitteeContribution", in, out, opts...) if err != nil { return nil, err } @@ -5143,7 +5143,7 @@ type UnimplementedBeaconNodeValidatorServer struct { } func (*UnimplementedBeaconNodeValidatorServer) GetDuties(context.Context, *DutiesRequest) (*DutiesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Duties not implemented") + return nil, status.Errorf(codes.Unimplemented, "method GetDuties not implemented") } func (*UnimplementedBeaconNodeValidatorServer) DomainData(context.Context, *DomainRequest) (*DomainResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method DomainData not implemented") @@ -5164,7 +5164,7 @@ func (*UnimplementedBeaconNodeValidatorServer) MultipleValidatorStatus(context.C return nil, status.Errorf(codes.Unimplemented, "method MultipleValidatorStatus not implemented") } func (*UnimplementedBeaconNodeValidatorServer) GetBeaconBlock(context.Context, *BlockRequest) (*GenericBeaconBlock, error) { - return nil, status.Errorf(codes.Unimplemented, "method BeaconBlock not implemented") + return nil, status.Errorf(codes.Unimplemented, "method GetBeaconBlock not implemented") } func (*UnimplementedBeaconNodeValidatorServer) ProposeBeaconBlock(context.Context, *GenericSignedBeaconBlock) (*ProposeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ProposeBeaconBlock not implemented") @@ -5173,10 +5173,10 @@ func (*UnimplementedBeaconNodeValidatorServer) PrepareBeaconProposer(context.Con return nil, status.Errorf(codes.Unimplemented, "method PrepareBeaconProposer not implemented") } func (*UnimplementedBeaconNodeValidatorServer) GetFeeRecipientByPubKey(context.Context, *FeeRecipientByPubKeyRequest) (*FeeRecipientByPubKeyResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method FeeRecipientByPubKey not implemented") + return nil, status.Errorf(codes.Unimplemented, "method GetFeeRecipientByPubKey not implemented") } func (*UnimplementedBeaconNodeValidatorServer) GetAttestationData(context.Context, *AttestationDataRequest) (*AttestationData, error) { - return nil, status.Errorf(codes.Unimplemented, "method AttestationData not implemented") + return nil, status.Errorf(codes.Unimplemented, "method GetAttestationData not implemented") } func (*UnimplementedBeaconNodeValidatorServer) ProposeAttestation(context.Context, *Attestation) (*AttestResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ProposeAttestation not implemented") @@ -5197,16 +5197,16 @@ func (*UnimplementedBeaconNodeValidatorServer) CheckDoppelGanger(context.Context return nil, status.Errorf(codes.Unimplemented, "method CheckDoppelGanger not implemented") } func (*UnimplementedBeaconNodeValidatorServer) GetSyncMessageBlockRoot(context.Context, *emptypb.Empty) (*SyncMessageBlockRootResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SyncMessageBlockRoot not implemented") + return nil, status.Errorf(codes.Unimplemented, "method GetSyncMessageBlockRoot not implemented") } func (*UnimplementedBeaconNodeValidatorServer) SubmitSyncMessage(context.Context, *SyncCommitteeMessage) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitSyncMessage not implemented") } func (*UnimplementedBeaconNodeValidatorServer) GetSyncSubcommitteeIndex(context.Context, *SyncSubcommitteeIndexRequest) (*SyncSubcommitteeIndexResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SyncSubcommitteeIndex not implemented") + return nil, status.Errorf(codes.Unimplemented, "method GetSyncSubcommitteeIndex not implemented") } func (*UnimplementedBeaconNodeValidatorServer) GetSyncCommitteeContribution(context.Context, *SyncCommitteeContributionRequest) (*SyncCommitteeContribution, error) { - return nil, status.Errorf(codes.Unimplemented, "method SyncCommitteeContribution not implemented") + return nil, status.Errorf(codes.Unimplemented, "method GetSyncCommitteeContribution not implemented") } func (*UnimplementedBeaconNodeValidatorServer) SubmitSignedContributionAndProof(context.Context, *SignedContributionAndProof) (*emptypb.Empty, error) { return nil, status.Errorf(codes.Unimplemented, "method SubmitSignedContributionAndProof not implemented") @@ -5241,7 +5241,7 @@ func _BeaconNodeValidator_GetDuties_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/Duties", + FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetDuties", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BeaconNodeValidatorServer).GetDuties(ctx, req.(*DutiesRequest)) @@ -5373,7 +5373,7 @@ func _BeaconNodeValidator_GetBeaconBlock_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/BeaconBlock", + FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetBeaconBlock", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BeaconNodeValidatorServer).GetBeaconBlock(ctx, req.(*BlockRequest)) @@ -5427,7 +5427,7 @@ func _BeaconNodeValidator_GetFeeRecipientByPubKey_Handler(srv interface{}, ctx c } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/FeeRecipientByPubKey", + FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetFeeRecipientByPubKey", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BeaconNodeValidatorServer).GetFeeRecipientByPubKey(ctx, req.(*FeeRecipientByPubKeyRequest)) @@ -5445,7 +5445,7 @@ func _BeaconNodeValidator_GetAttestationData_Handler(srv interface{}, ctx contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/AttestationData", + FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetAttestationData", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BeaconNodeValidatorServer).GetAttestationData(ctx, req.(*AttestationDataRequest)) @@ -5571,7 +5571,7 @@ func _BeaconNodeValidator_GetSyncMessageBlockRoot_Handler(srv interface{}, ctx c } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncMessageBlockRoot", + FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncMessageBlockRoot", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BeaconNodeValidatorServer).GetSyncMessageBlockRoot(ctx, req.(*emptypb.Empty)) @@ -5607,7 +5607,7 @@ func _BeaconNodeValidator_GetSyncSubcommitteeIndex_Handler(srv interface{}, ctx } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncSubcommitteeIndex", + FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncSubcommitteeIndex", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BeaconNodeValidatorServer).GetSyncSubcommitteeIndex(ctx, req.(*SyncSubcommitteeIndexRequest)) @@ -5625,7 +5625,7 @@ func _BeaconNodeValidator_GetSyncCommitteeContribution_Handler(srv interface{}, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncCommitteeContribution", + FullMethod: "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncCommitteeContribution", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(BeaconNodeValidatorServer).GetSyncCommitteeContribution(ctx, req.(*SyncCommitteeContributionRequest)) @@ -5752,7 +5752,7 @@ var _BeaconNodeValidator_serviceDesc = grpc.ServiceDesc{ HandlerType: (*BeaconNodeValidatorServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "Duties", + MethodName: "GetDuties", Handler: _BeaconNodeValidator_GetDuties_Handler, }, { @@ -5772,7 +5772,7 @@ var _BeaconNodeValidator_serviceDesc = grpc.ServiceDesc{ Handler: _BeaconNodeValidator_MultipleValidatorStatus_Handler, }, { - MethodName: "BeaconBlock", + MethodName: "GetBeaconBlock", Handler: _BeaconNodeValidator_GetBeaconBlock_Handler, }, { @@ -5784,11 +5784,11 @@ var _BeaconNodeValidator_serviceDesc = grpc.ServiceDesc{ Handler: _BeaconNodeValidator_PrepareBeaconProposer_Handler, }, { - MethodName: "FeeRecipientByPubKey", + MethodName: "GetFeeRecipientByPubKey", Handler: _BeaconNodeValidator_GetFeeRecipientByPubKey_Handler, }, { - MethodName: "AttestationData", + MethodName: "GetAttestationData", Handler: _BeaconNodeValidator_GetAttestationData_Handler, }, { @@ -5816,7 +5816,7 @@ var _BeaconNodeValidator_serviceDesc = grpc.ServiceDesc{ Handler: _BeaconNodeValidator_CheckDoppelGanger_Handler, }, { - MethodName: "SyncMessageBlockRoot", + MethodName: "GetSyncMessageBlockRoot", Handler: _BeaconNodeValidator_GetSyncMessageBlockRoot_Handler, }, { @@ -5824,11 +5824,11 @@ var _BeaconNodeValidator_serviceDesc = grpc.ServiceDesc{ Handler: _BeaconNodeValidator_SubmitSyncMessage_Handler, }, { - MethodName: "SyncSubcommitteeIndex", + MethodName: "GetSyncSubcommitteeIndex", Handler: _BeaconNodeValidator_GetSyncSubcommitteeIndex_Handler, }, { - MethodName: "SyncCommitteeContribution", + MethodName: "GetSyncCommitteeContribution", Handler: _BeaconNodeValidator_GetSyncCommitteeContribution_Handler, }, { diff --git a/proto/prysm/v1alpha1/validator.pb.gw.go b/proto/prysm/v1alpha1/validator.pb.gw.go index ec4b762d202a..b5a85384e7a0 100755 --- a/proto/prysm/v1alpha1/validator.pb.gw.go +++ b/proto/prysm/v1alpha1/validator.pb.gw.go @@ -968,7 +968,7 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime. var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/Duties") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetDuties") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1097,7 +1097,7 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime. var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/BeaconBlock") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetBeaconBlock") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1166,7 +1166,7 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime. var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/FeeRecipientByPubKey") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetFeeRecipientByPubKey") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1189,7 +1189,7 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime. var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/AttestationData") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetAttestationData") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1350,7 +1350,7 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime. var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncMessageBlockRoot") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncMessageBlockRoot") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1396,7 +1396,7 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime. var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncSubcommitteeIndex") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncSubcommitteeIndex") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1419,7 +1419,7 @@ func RegisterBeaconNodeValidatorHandlerServer(ctx context.Context, mux *runtime. var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncCommitteeContribution") + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncCommitteeContribution") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1587,7 +1587,7 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime. ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/Duties") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetDuties") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1727,7 +1727,7 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime. ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/BeaconBlock") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetBeaconBlock") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1787,7 +1787,7 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime. ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/FeeRecipientByPubKey") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetFeeRecipientByPubKey") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1807,7 +1807,7 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime. ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/AttestationData") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetAttestationData") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1947,7 +1947,7 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime. ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncMessageBlockRoot") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncMessageBlockRoot") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1987,7 +1987,7 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime. ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncSubcommitteeIndex") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncSubcommitteeIndex") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -2007,7 +2007,7 @@ func RegisterBeaconNodeValidatorHandlerClient(ctx context.Context, mux *runtime. ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/SyncCommitteeContribution") + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/ethereum.eth.v1alpha1.BeaconNodeValidator/GetSyncCommitteeContribution") if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return diff --git a/testing/mock/beacon_service_mock.go b/testing/mock/beacon_service_mock.go index 9f0181fad4b8..78bf69ec1165 100644 --- a/testing/mock/beacon_service_mock.go +++ b/testing/mock/beacon_service_mock.go @@ -89,7 +89,7 @@ func (m *MockBeaconChainClient) GetChainHead(arg0 context.Context, arg1 *emptypb for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "ChainHead", varargs...) + ret := m.ctrl.Call(m, "GetChainHead", varargs...) ret0, _ := ret[0].(*eth.ChainHead) ret1, _ := ret[1].(error) return ret0, ret1 @@ -99,7 +99,7 @@ func (m *MockBeaconChainClient) GetChainHead(arg0 context.Context, arg1 *emptypb func (mr *MockBeaconChainClientMockRecorder) GetChainHead(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ChainHead", reflect.TypeOf((*MockBeaconChainClient)(nil).GetChainHead), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetChainHead", reflect.TypeOf((*MockBeaconChainClient)(nil).GetChainHead), varargs...) } // GetIndividualVotes mocks base method. @@ -169,7 +169,7 @@ func (m *MockBeaconChainClient) GetValidatorParticipation(arg0 context.Context, for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "ValidatorParticipation", varargs...) + ret := m.ctrl.Call(m, "GetValidatorParticipation", varargs...) ret0, _ := ret[0].(*eth.ValidatorParticipationResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -179,7 +179,7 @@ func (m *MockBeaconChainClient) GetValidatorParticipation(arg0 context.Context, func (mr *MockBeaconChainClientMockRecorder) GetValidatorParticipation(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorParticipation", reflect.TypeOf((*MockBeaconChainClient)(nil).GetValidatorParticipation), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorParticipation", reflect.TypeOf((*MockBeaconChainClient)(nil).GetValidatorParticipation), varargs...) } // GetValidatorPerformance mocks base method. @@ -189,7 +189,7 @@ func (m *MockBeaconChainClient) GetValidatorPerformance(arg0 context.Context, ar for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "ValidatorPerformance", varargs...) + ret := m.ctrl.Call(m, "GetValidatorPerformance", varargs...) ret0, _ := ret[0].(*eth.ValidatorPerformanceResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -199,7 +199,7 @@ func (m *MockBeaconChainClient) GetValidatorPerformance(arg0 context.Context, ar func (mr *MockBeaconChainClientMockRecorder) GetValidatorPerformance(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorPerformance", reflect.TypeOf((*MockBeaconChainClient)(nil).GetValidatorPerformance), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorPerformance", reflect.TypeOf((*MockBeaconChainClient)(nil).GetValidatorPerformance), varargs...) } // GetValidatorQueue mocks base method. @@ -209,7 +209,7 @@ func (m *MockBeaconChainClient) GetValidatorQueue(arg0 context.Context, arg1 *em for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "ValidatorQueue", varargs...) + ret := m.ctrl.Call(m, "GetValidatorQueue", varargs...) ret0, _ := ret[0].(*eth.ValidatorQueue) ret1, _ := ret[1].(error) return ret0, ret1 @@ -219,7 +219,7 @@ func (m *MockBeaconChainClient) GetValidatorQueue(arg0 context.Context, arg1 *em func (mr *MockBeaconChainClientMockRecorder) GetValidatorQueue(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorQueue", reflect.TypeOf((*MockBeaconChainClient)(nil).GetValidatorQueue), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetValidatorQueue", reflect.TypeOf((*MockBeaconChainClient)(nil).GetValidatorQueue), varargs...) } // ListAttestations mocks base method. @@ -329,7 +329,7 @@ func (m *MockBeaconChainClient) ListValidatorBalances(arg0 context.Context, arg1 for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "ValidatorBalances", varargs...) + ret := m.ctrl.Call(m, "ListValidatorBalances", varargs...) ret0, _ := ret[0].(*eth.ValidatorBalances) ret1, _ := ret[1].(error) return ret0, ret1 @@ -339,7 +339,7 @@ func (m *MockBeaconChainClient) ListValidatorBalances(arg0 context.Context, arg1 func (mr *MockBeaconChainClientMockRecorder) ListValidatorBalances(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorBalances", reflect.TypeOf((*MockBeaconChainClient)(nil).ListValidatorBalances), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListValidatorBalances", reflect.TypeOf((*MockBeaconChainClient)(nil).ListValidatorBalances), varargs...) } // ListValidators mocks base method. @@ -349,7 +349,7 @@ func (m *MockBeaconChainClient) ListValidators(arg0 context.Context, arg1 *eth.L for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "Validators", varargs...) + ret := m.ctrl.Call(m, "ListValidators", varargs...) ret0, _ := ret[0].(*eth.Validators) ret1, _ := ret[1].(error) return ret0, ret1 @@ -359,7 +359,7 @@ func (m *MockBeaconChainClient) ListValidators(arg0 context.Context, arg1 *eth.L func (mr *MockBeaconChainClientMockRecorder) ListValidators(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Validators", reflect.TypeOf((*MockBeaconChainClient)(nil).ListValidators), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListValidators", reflect.TypeOf((*MockBeaconChainClient)(nil).ListValidators), varargs...) } // SubmitAttesterSlashing mocks base method. diff --git a/testing/mock/beacon_validator_client_mock.go b/testing/mock/beacon_validator_client_mock.go index 7b3c13a02686..bed03fb8f49c 100644 --- a/testing/mock/beacon_validator_client_mock.go +++ b/testing/mock/beacon_validator_client_mock.go @@ -130,7 +130,7 @@ func (m *MockBeaconNodeValidatorClient) GetAttestationData(arg0 context.Context, for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "AttestationData", varargs...) + ret := m.ctrl.Call(m, "GetAttestationData", varargs...) ret0, _ := ret[0].(*eth.AttestationData) ret1, _ := ret[1].(error) return ret0, ret1 @@ -140,7 +140,7 @@ func (m *MockBeaconNodeValidatorClient) GetAttestationData(arg0 context.Context, func (mr *MockBeaconNodeValidatorClientMockRecorder) GetAttestationData(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AttestationData", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetAttestationData), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAttestationData", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetAttestationData), varargs...) } // GetBeaconBlock mocks base method. @@ -150,7 +150,7 @@ func (m *MockBeaconNodeValidatorClient) GetBeaconBlock(arg0 context.Context, arg for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "BeaconBlock", varargs...) + ret := m.ctrl.Call(m, "GetBeaconBlock", varargs...) ret0, _ := ret[0].(*eth.GenericBeaconBlock) ret1, _ := ret[1].(error) return ret0, ret1 @@ -160,7 +160,7 @@ func (m *MockBeaconNodeValidatorClient) GetBeaconBlock(arg0 context.Context, arg func (mr *MockBeaconNodeValidatorClientMockRecorder) GetBeaconBlock(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeaconBlock", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetBeaconBlock), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBeaconBlock", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetBeaconBlock), varargs...) } // GetDuties mocks base method. @@ -170,7 +170,7 @@ func (m *MockBeaconNodeValidatorClient) GetDuties(arg0 context.Context, arg1 *et for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "Duties", varargs...) + ret := m.ctrl.Call(m, "GetDuties", varargs...) ret0, _ := ret[0].(*eth.DutiesResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -180,7 +180,7 @@ func (m *MockBeaconNodeValidatorClient) GetDuties(arg0 context.Context, arg1 *et func (mr *MockBeaconNodeValidatorClientMockRecorder) GetDuties(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Duties", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetDuties), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDuties", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetDuties), varargs...) } // GetFeeRecipientByPubKey mocks base method. @@ -190,7 +190,7 @@ func (m *MockBeaconNodeValidatorClient) GetFeeRecipientByPubKey(arg0 context.Con for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "FeeRecipientByPubKey", varargs...) + ret := m.ctrl.Call(m, "GetFeeRecipientByPubKey", varargs...) ret0, _ := ret[0].(*eth.FeeRecipientByPubKeyResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -200,7 +200,7 @@ func (m *MockBeaconNodeValidatorClient) GetFeeRecipientByPubKey(arg0 context.Con func (mr *MockBeaconNodeValidatorClientMockRecorder) GetFeeRecipientByPubKey(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FeeRecipientByPubKey", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetFeeRecipientByPubKey), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFeeRecipientByPubKey", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetFeeRecipientByPubKey), varargs...) } // GetSyncCommitteeContribution mocks base method. @@ -210,7 +210,7 @@ func (m *MockBeaconNodeValidatorClient) GetSyncCommitteeContribution(arg0 contex for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "SyncCommitteeContribution", varargs...) + ret := m.ctrl.Call(m, "GetSyncCommitteeContribution", varargs...) ret0, _ := ret[0].(*eth.SyncCommitteeContribution) ret1, _ := ret[1].(error) return ret0, ret1 @@ -220,7 +220,7 @@ func (m *MockBeaconNodeValidatorClient) GetSyncCommitteeContribution(arg0 contex func (mr *MockBeaconNodeValidatorClientMockRecorder) GetSyncCommitteeContribution(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncCommitteeContribution", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetSyncCommitteeContribution), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncCommitteeContribution", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetSyncCommitteeContribution), varargs...) } // GetSyncMessageBlockRoot mocks base method. @@ -230,7 +230,7 @@ func (m *MockBeaconNodeValidatorClient) GetSyncMessageBlockRoot(arg0 context.Con for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "SyncMessageBlockRoot", varargs...) + ret := m.ctrl.Call(m, "GetSyncMessageBlockRoot", varargs...) ret0, _ := ret[0].(*eth.SyncMessageBlockRootResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -240,7 +240,7 @@ func (m *MockBeaconNodeValidatorClient) GetSyncMessageBlockRoot(arg0 context.Con func (mr *MockBeaconNodeValidatorClientMockRecorder) GetSyncMessageBlockRoot(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncMessageBlockRoot", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetSyncMessageBlockRoot), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncMessageBlockRoot", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetSyncMessageBlockRoot), varargs...) } // GetSyncSubcommitteeIndex mocks base method. @@ -250,7 +250,7 @@ func (m *MockBeaconNodeValidatorClient) GetSyncSubcommitteeIndex(arg0 context.Co for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "SyncSubcommitteeIndex", varargs...) + ret := m.ctrl.Call(m, "GetSyncSubcommitteeIndex", varargs...) ret0, _ := ret[0].(*eth.SyncSubcommitteeIndexResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -260,7 +260,7 @@ func (m *MockBeaconNodeValidatorClient) GetSyncSubcommitteeIndex(arg0 context.Co func (mr *MockBeaconNodeValidatorClientMockRecorder) GetSyncSubcommitteeIndex(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncSubcommitteeIndex", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetSyncSubcommitteeIndex), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncSubcommitteeIndex", reflect.TypeOf((*MockBeaconNodeValidatorClient)(nil).GetSyncSubcommitteeIndex), varargs...) } // MultipleValidatorStatus mocks base method. diff --git a/testing/mock/beacon_validator_server_mock.go b/testing/mock/beacon_validator_server_mock.go index aa343b948d4f..c1722b39eaf7 100644 --- a/testing/mock/beacon_validator_server_mock.go +++ b/testing/mock/beacon_validator_server_mock.go @@ -105,7 +105,7 @@ func (mr *MockBeaconNodeValidatorServerMockRecorder) DomainData(arg0, arg1 any) // GetAttestationData mocks base method. func (m *MockBeaconNodeValidatorServer) GetAttestationData(arg0 context.Context, arg1 *eth.AttestationDataRequest) (*eth.AttestationData, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "AttestationData", arg0, arg1) + ret := m.ctrl.Call(m, "GetAttestationData", arg0, arg1) ret0, _ := ret[0].(*eth.AttestationData) ret1, _ := ret[1].(error) return ret0, ret1 @@ -114,13 +114,13 @@ func (m *MockBeaconNodeValidatorServer) GetAttestationData(arg0 context.Context, // GetAttestationData indicates an expected call of GetAttestationData. func (mr *MockBeaconNodeValidatorServerMockRecorder) GetAttestationData(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AttestationData", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetAttestationData), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAttestationData", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetAttestationData), arg0, arg1) } // GetBeaconBlock mocks base method. func (m *MockBeaconNodeValidatorServer) GetBeaconBlock(arg0 context.Context, arg1 *eth.BlockRequest) (*eth.GenericBeaconBlock, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "BeaconBlock", arg0, arg1) + ret := m.ctrl.Call(m, "GetBeaconBlock", arg0, arg1) ret0, _ := ret[0].(*eth.GenericBeaconBlock) ret1, _ := ret[1].(error) return ret0, ret1 @@ -129,13 +129,13 @@ func (m *MockBeaconNodeValidatorServer) GetBeaconBlock(arg0 context.Context, arg // GetBeaconBlock indicates an expected call of GetBeaconBlock. func (mr *MockBeaconNodeValidatorServerMockRecorder) GetBeaconBlock(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeaconBlock", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetBeaconBlock), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBeaconBlock", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetBeaconBlock), arg0, arg1) } // GetDuties mocks base method. func (m *MockBeaconNodeValidatorServer) GetDuties(arg0 context.Context, arg1 *eth.DutiesRequest) (*eth.DutiesResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Duties", arg0, arg1) + ret := m.ctrl.Call(m, "GetDuties", arg0, arg1) ret0, _ := ret[0].(*eth.DutiesResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -144,13 +144,13 @@ func (m *MockBeaconNodeValidatorServer) GetDuties(arg0 context.Context, arg1 *et // GetDuties indicates an expected call of GetDuties. func (mr *MockBeaconNodeValidatorServerMockRecorder) GetDuties(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Duties", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetDuties), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDuties", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetDuties), arg0, arg1) } // GetFeeRecipientByPubKey mocks base method. func (m *MockBeaconNodeValidatorServer) GetFeeRecipientByPubKey(arg0 context.Context, arg1 *eth.FeeRecipientByPubKeyRequest) (*eth.FeeRecipientByPubKeyResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FeeRecipientByPubKey", arg0, arg1) + ret := m.ctrl.Call(m, "GetFeeRecipientByPubKey", arg0, arg1) ret0, _ := ret[0].(*eth.FeeRecipientByPubKeyResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -159,13 +159,13 @@ func (m *MockBeaconNodeValidatorServer) GetFeeRecipientByPubKey(arg0 context.Con // GetFeeRecipientByPubKey indicates an expected call of GetFeeRecipientByPubKey. func (mr *MockBeaconNodeValidatorServerMockRecorder) GetFeeRecipientByPubKey(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FeeRecipientByPubKey", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetFeeRecipientByPubKey), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetFeeRecipientByPubKey", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetFeeRecipientByPubKey), arg0, arg1) } // GetSyncCommitteeContribution mocks base method. func (m *MockBeaconNodeValidatorServer) GetSyncCommitteeContribution(arg0 context.Context, arg1 *eth.SyncCommitteeContributionRequest) (*eth.SyncCommitteeContribution, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SyncCommitteeContribution", arg0, arg1) + ret := m.ctrl.Call(m, "GetSyncCommitteeContribution", arg0, arg1) ret0, _ := ret[0].(*eth.SyncCommitteeContribution) ret1, _ := ret[1].(error) return ret0, ret1 @@ -174,13 +174,13 @@ func (m *MockBeaconNodeValidatorServer) GetSyncCommitteeContribution(arg0 contex // GetSyncCommitteeContribution indicates an expected call of GetSyncCommitteeContribution. func (mr *MockBeaconNodeValidatorServerMockRecorder) GetSyncCommitteeContribution(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncCommitteeContribution", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetSyncCommitteeContribution), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncCommitteeContribution", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetSyncCommitteeContribution), arg0, arg1) } // GetSyncMessageBlockRoot mocks base method. func (m *MockBeaconNodeValidatorServer) GetSyncMessageBlockRoot(arg0 context.Context, arg1 *emptypb.Empty) (*eth.SyncMessageBlockRootResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SyncMessageBlockRoot", arg0, arg1) + ret := m.ctrl.Call(m, "GetSyncMessageBlockRoot", arg0, arg1) ret0, _ := ret[0].(*eth.SyncMessageBlockRootResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -189,13 +189,13 @@ func (m *MockBeaconNodeValidatorServer) GetSyncMessageBlockRoot(arg0 context.Con // GetSyncMessageBlockRoot indicates an expected call of GetSyncMessageBlockRoot. func (mr *MockBeaconNodeValidatorServerMockRecorder) GetSyncMessageBlockRoot(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncMessageBlockRoot", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetSyncMessageBlockRoot), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncMessageBlockRoot", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetSyncMessageBlockRoot), arg0, arg1) } // GetSyncSubcommitteeIndex mocks base method. func (m *MockBeaconNodeValidatorServer) GetSyncSubcommitteeIndex(arg0 context.Context, arg1 *eth.SyncSubcommitteeIndexRequest) (*eth.SyncSubcommitteeIndexResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SyncSubcommitteeIndex", arg0, arg1) + ret := m.ctrl.Call(m, "GetSyncSubcommitteeIndex", arg0, arg1) ret0, _ := ret[0].(*eth.SyncSubcommitteeIndexResponse) ret1, _ := ret[1].(error) return ret0, ret1 @@ -204,7 +204,7 @@ func (m *MockBeaconNodeValidatorServer) GetSyncSubcommitteeIndex(arg0 context.Co // GetSyncSubcommitteeIndex indicates an expected call of GetSyncSubcommitteeIndex. func (mr *MockBeaconNodeValidatorServerMockRecorder) GetSyncSubcommitteeIndex(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncSubcommitteeIndex", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetSyncSubcommitteeIndex), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncSubcommitteeIndex", reflect.TypeOf((*MockBeaconNodeValidatorServer)(nil).GetSyncSubcommitteeIndex), arg0, arg1) } // MultipleValidatorStatus mocks base method. diff --git a/testing/mock/node_service_mock.go b/testing/mock/node_service_mock.go index 582398484354..72f268f582b4 100644 --- a/testing/mock/node_service_mock.go +++ b/testing/mock/node_service_mock.go @@ -69,7 +69,7 @@ func (m *MockNodeClient) GetGenesis(arg0 context.Context, arg1 *emptypb.Empty, a for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "Genesis", varargs...) + ret := m.ctrl.Call(m, "GetGenesis", varargs...) ret0, _ := ret[0].(*eth.Genesis) ret1, _ := ret[1].(error) return ret0, ret1 @@ -79,7 +79,27 @@ func (m *MockNodeClient) GetGenesis(arg0 context.Context, arg1 *emptypb.Empty, a func (mr *MockNodeClientMockRecorder) GetGenesis(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Genesis", reflect.TypeOf((*MockNodeClient)(nil).GetGenesis), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGenesis", reflect.TypeOf((*MockNodeClient)(nil).GetGenesis), varargs...) +} + +// GetHealth mocks base method. +func (m *MockNodeClient) GetHealth(arg0 context.Context, arg1 *eth.HealthRequest, arg2 ...grpc.CallOption) (*emptypb.Empty, error) { + m.ctrl.T.Helper() + varargs := []any{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetHealth", varargs...) + ret0, _ := ret[0].(*emptypb.Empty) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetHealth indicates an expected call of GetHealth. +func (mr *MockNodeClientMockRecorder) GetHealth(arg0, arg1 any, arg2 ...any) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]any{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetHealth", reflect.TypeOf((*MockNodeClient)(nil).GetHealth), varargs...) } // GetHost mocks base method. @@ -129,7 +149,7 @@ func (m *MockNodeClient) GetSyncStatus(arg0 context.Context, arg1 *emptypb.Empty for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "SyncStatus", varargs...) + ret := m.ctrl.Call(m, "GetSyncStatus", varargs...) ret0, _ := ret[0].(*eth.SyncStatus) ret1, _ := ret[1].(error) return ret0, ret1 @@ -139,7 +159,7 @@ func (m *MockNodeClient) GetSyncStatus(arg0 context.Context, arg1 *emptypb.Empty func (mr *MockNodeClientMockRecorder) GetSyncStatus(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncStatus", reflect.TypeOf((*MockNodeClient)(nil).GetSyncStatus), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncStatus", reflect.TypeOf((*MockNodeClient)(nil).GetSyncStatus), varargs...) } // GetVersion mocks base method. @@ -149,7 +169,7 @@ func (m *MockNodeClient) GetVersion(arg0 context.Context, arg1 *emptypb.Empty, a for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "Version", varargs...) + ret := m.ctrl.Call(m, "GetVersion", varargs...) ret0, _ := ret[0].(*eth.Version) ret1, _ := ret[1].(error) return ret0, ret1 @@ -159,7 +179,7 @@ func (m *MockNodeClient) GetVersion(arg0 context.Context, arg1 *emptypb.Empty, a func (mr *MockNodeClientMockRecorder) GetVersion(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Version", reflect.TypeOf((*MockNodeClient)(nil).GetVersion), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetVersion", reflect.TypeOf((*MockNodeClient)(nil).GetVersion), varargs...) } // ListImplementedServices mocks base method. @@ -189,7 +209,7 @@ func (m *MockNodeClient) ListPeers(arg0 context.Context, arg1 *emptypb.Empty, ar for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "Peers", varargs...) + ret := m.ctrl.Call(m, "ListPeers", varargs...) ret0, _ := ret[0].(*eth.Peers) ret1, _ := ret[1].(error) return ret0, ret1 @@ -199,5 +219,5 @@ func (m *MockNodeClient) ListPeers(arg0 context.Context, arg1 *emptypb.Empty, ar func (mr *MockNodeClientMockRecorder) ListPeers(arg0, arg1 any, arg2 ...any) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]any{arg0, arg1}, arg2...) - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Peers", reflect.TypeOf((*MockNodeClient)(nil).ListPeers), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListPeers", reflect.TypeOf((*MockNodeClient)(nil).ListPeers), varargs...) } diff --git a/testing/validator-mock/node_client_mock.go b/testing/validator-mock/node_client_mock.go index 27fc25bce8fc..a7826860e9e0 100644 --- a/testing/validator-mock/node_client_mock.go +++ b/testing/validator-mock/node_client_mock.go @@ -13,7 +13,7 @@ import ( context "context" reflect "reflect" - "github.com/prysmaticlabs/prysm/v5/api/client/beacon" + beacon "github.com/prysmaticlabs/prysm/v5/api/client/beacon" eth "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" gomock "go.uber.org/mock/gomock" emptypb "google.golang.org/protobuf/types/known/emptypb" @@ -21,9 +21,8 @@ import ( // MockNodeClient is a mock of NodeClient interface. type MockNodeClient struct { - ctrl *gomock.Controller - recorder *MockNodeClientMockRecorder - healthTracker *beacon.NodeHealthTracker + ctrl *gomock.Controller + recorder *MockNodeClientMockRecorder } // MockNodeClientMockRecorder is the mock recorder for MockNodeClient. @@ -35,7 +34,6 @@ type MockNodeClientMockRecorder struct { func NewMockNodeClient(ctrl *gomock.Controller) *MockNodeClient { mock := &MockNodeClient{ctrl: ctrl} mock.recorder = &MockNodeClientMockRecorder{mock} - mock.healthTracker = beacon.NewNodeHealthTracker(mock) return mock } @@ -44,7 +42,7 @@ func (m *MockNodeClient) EXPECT() *MockNodeClientMockRecorder { return m.recorder } -// GetGenesis mocks base method. +// Genesis mocks base method. func (m *MockNodeClient) Genesis(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Genesis, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Genesis", arg0, arg1) @@ -53,71 +51,67 @@ func (m *MockNodeClient) Genesis(arg0 context.Context, arg1 *emptypb.Empty) (*et return ret0, ret1 } -// GetGenesis indicates an expected call of GetGenesis. -func (mr *MockNodeClientMockRecorder) GetGenesis(arg0, arg1 any) *gomock.Call { +// Genesis indicates an expected call of Genesis. +func (mr *MockNodeClientMockRecorder) Genesis(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Genesis", reflect.TypeOf((*MockNodeClient)(nil).Genesis), arg0, arg1) } -// GetSyncStatus mocks base method. -func (m *MockNodeClient) SyncStatus(arg0 context.Context, arg1 *emptypb.Empty) (*eth.SyncStatus, error) { +// HealthTracker mocks base method. +func (m *MockNodeClient) HealthTracker() *beacon.NodeHealthTracker { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SyncStatus", arg0, arg1) - ret0, _ := ret[0].(*eth.SyncStatus) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret := m.ctrl.Call(m, "HealthTracker") + ret0, _ := ret[0].(*beacon.NodeHealthTracker) + return ret0 } -// GetSyncStatus indicates an expected call of GetSyncStatus. -func (mr *MockNodeClientMockRecorder) GetSyncStatus(arg0, arg1 any) *gomock.Call { +// HealthTracker indicates an expected call of HealthTracker. +func (mr *MockNodeClientMockRecorder) HealthTracker() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncStatus", reflect.TypeOf((*MockNodeClient)(nil).SyncStatus), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HealthTracker", reflect.TypeOf((*MockNodeClient)(nil).HealthTracker)) } -// GetVersion mocks base method. -func (m *MockNodeClient) Version(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Version, error) { +// Peers mocks base method. +func (m *MockNodeClient) Peers(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Peers, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Version", arg0, arg1) - ret0, _ := ret[0].(*eth.Version) + ret := m.ctrl.Call(m, "Peers", arg0, arg1) + ret0, _ := ret[0].(*eth.Peers) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetVersion indicates an expected call of GetVersion. -func (mr *MockNodeClientMockRecorder) GetVersion(arg0, arg1 any) *gomock.Call { +// Peers indicates an expected call of Peers. +func (mr *MockNodeClientMockRecorder) Peers(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Version", reflect.TypeOf((*MockNodeClient)(nil).Version), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Peers", reflect.TypeOf((*MockNodeClient)(nil).Peers), arg0, arg1) } -// IsHealthy mocks base method. -func (m *MockNodeClient) IsHealthy(arg0 context.Context) bool { +// SyncStatus mocks base method. +func (m *MockNodeClient) SyncStatus(arg0 context.Context, arg1 *emptypb.Empty) (*eth.SyncStatus, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "IsHealthy", arg0) - ret0, _ := ret[0].(bool) - return ret0 + ret := m.ctrl.Call(m, "SyncStatus", arg0, arg1) + ret0, _ := ret[0].(*eth.SyncStatus) + ret1, _ := ret[1].(error) + return ret0, ret1 } -// IsHealthy indicates an expected call of IsHealthy. -func (mr *MockNodeClientMockRecorder) IsHealthy(arg0 any) *gomock.Call { +// SyncStatus indicates an expected call of SyncStatus. +func (mr *MockNodeClientMockRecorder) SyncStatus(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "IsHealthy", reflect.TypeOf((*MockNodeClient)(nil).IsHealthy), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncStatus", reflect.TypeOf((*MockNodeClient)(nil).SyncStatus), arg0, arg1) } -// ListPeers mocks base method. -func (m *MockNodeClient) Peers(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Peers, error) { +// Version mocks base method. +func (m *MockNodeClient) Version(arg0 context.Context, arg1 *emptypb.Empty) (*eth.Version, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Peers", arg0, arg1) - ret0, _ := ret[0].(*eth.Peers) + ret := m.ctrl.Call(m, "Version", arg0, arg1) + ret0, _ := ret[0].(*eth.Version) ret1, _ := ret[1].(error) return ret0, ret1 } -// ListPeers indicates an expected call of ListPeers. -func (mr *MockNodeClientMockRecorder) ListPeers(arg0, arg1 any) *gomock.Call { +// Version indicates an expected call of Version. +func (mr *MockNodeClientMockRecorder) Version(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Peers", reflect.TypeOf((*MockNodeClient)(nil).Peers), arg0, arg1) -} - -func (m *MockNodeClient) HealthTracker() *beacon.NodeHealthTracker { - return m.healthTracker + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Version", reflect.TypeOf((*MockNodeClient)(nil).Version), arg0, arg1) } diff --git a/testing/validator-mock/validator_client_mock.go b/testing/validator-mock/validator_client_mock.go index 757071964512..5f5d6ecca720 100644 --- a/testing/validator-mock/validator_client_mock.go +++ b/testing/validator-mock/validator_client_mock.go @@ -44,51 +44,7 @@ func (m *MockValidatorClient) EXPECT() *MockValidatorClientMockRecorder { return m.recorder } -// CheckDoppelGanger mocks base method. -func (m *MockValidatorClient) CheckDoppelGanger(arg0 context.Context, arg1 *eth.DoppelGangerRequest) (*eth.DoppelGangerResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CheckDoppelGanger", arg0, arg1) - ret0, _ := ret[0].(*eth.DoppelGangerResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// CheckDoppelGanger indicates an expected call of CheckDoppelGanger. -func (mr *MockValidatorClientMockRecorder) CheckDoppelGanger(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckDoppelGanger", reflect.TypeOf((*MockValidatorClient)(nil).CheckDoppelGanger), arg0, arg1) -} - -// DomainData mocks base method. -func (m *MockValidatorClient) DomainData(arg0 context.Context, arg1 *eth.DomainRequest) (*eth.DomainResponse, error) { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "DomainData", arg0, arg1) - ret0, _ := ret[0].(*eth.DomainResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 -} - -// DomainData indicates an expected call of DomainData. -func (mr *MockValidatorClientMockRecorder) DomainData(arg0, arg1 any) *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DomainData", reflect.TypeOf((*MockValidatorClient)(nil).DomainData), arg0, arg1) -} - -// EventStreamIsRunning mocks base method. -func (m *MockValidatorClient) EventStreamIsRunning() bool { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "EventStreamIsRunning") - ret0, _ := ret[0].(bool) - return ret0 -} - -// EventStreamIsRunning indicates an expected call of EventStreamIsRunning. -func (mr *MockValidatorClientMockRecorder) EventStreamIsRunning() *gomock.Call { - mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EventStreamIsRunning", reflect.TypeOf((*MockValidatorClient)(nil).EventStreamIsRunning)) -} - -// GetAggregatedSelections mocks base method. +// AggregatedSelections mocks base method. func (m *MockValidatorClient) AggregatedSelections(arg0 context.Context, arg1 []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AggregatedSelections", arg0, arg1) @@ -97,13 +53,13 @@ func (m *MockValidatorClient) AggregatedSelections(arg0 context.Context, arg1 [] return ret0, ret1 } -// GetAggregatedSelections indicates an expected call of GetAggregatedSelections. -func (mr *MockValidatorClientMockRecorder) GetAggregatedSelections(arg0, arg1 any) *gomock.Call { +// AggregatedSelections indicates an expected call of AggregatedSelections. +func (mr *MockValidatorClientMockRecorder) AggregatedSelections(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AggregatedSelections", reflect.TypeOf((*MockValidatorClient)(nil).AggregatedSelections), arg0, arg1) } -// GetAggregatedSyncSelections mocks base method. +// AggregatedSyncSelections mocks base method. func (m *MockValidatorClient) AggregatedSyncSelections(arg0 context.Context, arg1 []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AggregatedSyncSelections", arg0, arg1) @@ -112,13 +68,13 @@ func (m *MockValidatorClient) AggregatedSyncSelections(arg0 context.Context, arg return ret0, ret1 } -// GetAggregatedSyncSelections indicates an expected call of GetAggregatedSyncSelections. -func (mr *MockValidatorClientMockRecorder) GetAggregatedSyncSelections(arg0, arg1 any) *gomock.Call { +// AggregatedSyncSelections indicates an expected call of AggregatedSyncSelections. +func (mr *MockValidatorClientMockRecorder) AggregatedSyncSelections(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AggregatedSyncSelections", reflect.TypeOf((*MockValidatorClient)(nil).AggregatedSyncSelections), arg0, arg1) } -// GetAttestationData mocks base method. +// AttestationData mocks base method. func (m *MockValidatorClient) AttestationData(arg0 context.Context, arg1 *eth.AttestationDataRequest) (*eth.AttestationData, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AttestationData", arg0, arg1) @@ -127,13 +83,13 @@ func (m *MockValidatorClient) AttestationData(arg0 context.Context, arg1 *eth.At return ret0, ret1 } -// GetAttestationData indicates an expected call of GetAttestationData. -func (mr *MockValidatorClientMockRecorder) GetAttestationData(arg0, arg1 any) *gomock.Call { +// AttestationData indicates an expected call of AttestationData. +func (mr *MockValidatorClientMockRecorder) AttestationData(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AttestationData", reflect.TypeOf((*MockValidatorClient)(nil).AttestationData), arg0, arg1) } -// GetBeaconBlock mocks base method. +// BeaconBlock mocks base method. func (m *MockValidatorClient) BeaconBlock(arg0 context.Context, arg1 *eth.BlockRequest) (*eth.GenericBeaconBlock, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeaconBlock", arg0, arg1) @@ -142,85 +98,84 @@ func (m *MockValidatorClient) BeaconBlock(arg0 context.Context, arg1 *eth.BlockR return ret0, ret1 } -// GetBeaconBlock indicates an expected call of GetBeaconBlock. -func (mr *MockValidatorClientMockRecorder) GetBeaconBlock(arg0, arg1 any) *gomock.Call { +// BeaconBlock indicates an expected call of BeaconBlock. +func (mr *MockValidatorClientMockRecorder) BeaconBlock(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BeaconBlock", reflect.TypeOf((*MockValidatorClient)(nil).BeaconBlock), arg0, arg1) } -// GetDuties mocks base method. -func (m *MockValidatorClient) Duties(arg0 context.Context, arg1 *eth.DutiesRequest) (*eth.DutiesResponse, error) { +// CheckDoppelGanger mocks base method. +func (m *MockValidatorClient) CheckDoppelGanger(arg0 context.Context, arg1 *eth.DoppelGangerRequest) (*eth.DoppelGangerResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Duties", arg0, arg1) - ret0, _ := ret[0].(*eth.DutiesResponse) + ret := m.ctrl.Call(m, "CheckDoppelGanger", arg0, arg1) + ret0, _ := ret[0].(*eth.DoppelGangerResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetDuties indicates an expected call of GetDuties. -func (mr *MockValidatorClientMockRecorder) GetDuties(arg0, arg1 any) *gomock.Call { +// CheckDoppelGanger indicates an expected call of CheckDoppelGanger. +func (mr *MockValidatorClientMockRecorder) CheckDoppelGanger(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Duties", reflect.TypeOf((*MockValidatorClient)(nil).Duties), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckDoppelGanger", reflect.TypeOf((*MockValidatorClient)(nil).CheckDoppelGanger), arg0, arg1) } -// GetFeeRecipientByPubKey mocks base method. -func (m *MockValidatorClient) FeeRecipientByPubKey(arg0 context.Context, arg1 *eth.FeeRecipientByPubKeyRequest) (*eth.FeeRecipientByPubKeyResponse, error) { +// DomainData mocks base method. +func (m *MockValidatorClient) DomainData(arg0 context.Context, arg1 *eth.DomainRequest) (*eth.DomainResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "FeeRecipientByPubKey", arg0, arg1) - ret0, _ := ret[0].(*eth.FeeRecipientByPubKeyResponse) + ret := m.ctrl.Call(m, "DomainData", arg0, arg1) + ret0, _ := ret[0].(*eth.DomainResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetFeeRecipientByPubKey indicates an expected call of GetFeeRecipientByPubKey. -func (mr *MockValidatorClientMockRecorder) GetFeeRecipientByPubKey(arg0, arg1 any) *gomock.Call { +// DomainData indicates an expected call of DomainData. +func (mr *MockValidatorClientMockRecorder) DomainData(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FeeRecipientByPubKey", reflect.TypeOf((*MockValidatorClient)(nil).FeeRecipientByPubKey), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DomainData", reflect.TypeOf((*MockValidatorClient)(nil).DomainData), arg0, arg1) } -// GetSyncCommitteeContribution mocks base method. -func (m *MockValidatorClient) SyncCommitteeContribution(arg0 context.Context, arg1 *eth.SyncCommitteeContributionRequest) (*eth.SyncCommitteeContribution, error) { +// Duties mocks base method. +func (m *MockValidatorClient) Duties(arg0 context.Context, arg1 *eth.DutiesRequest) (*eth.DutiesResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SyncCommitteeContribution", arg0, arg1) - ret0, _ := ret[0].(*eth.SyncCommitteeContribution) + ret := m.ctrl.Call(m, "Duties", arg0, arg1) + ret0, _ := ret[0].(*eth.DutiesResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetSyncCommitteeContribution indicates an expected call of GetSyncCommitteeContribution. -func (mr *MockValidatorClientMockRecorder) GetSyncCommitteeContribution(arg0, arg1 any) *gomock.Call { +// Duties indicates an expected call of Duties. +func (mr *MockValidatorClientMockRecorder) Duties(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncCommitteeContribution", reflect.TypeOf((*MockValidatorClient)(nil).SyncCommitteeContribution), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Duties", reflect.TypeOf((*MockValidatorClient)(nil).Duties), arg0, arg1) } -// GetSyncMessageBlockRoot mocks base method. -func (m *MockValidatorClient) SyncMessageBlockRoot(arg0 context.Context, arg1 *emptypb.Empty) (*eth.SyncMessageBlockRootResponse, error) { +// EventStreamIsRunning mocks base method. +func (m *MockValidatorClient) EventStreamIsRunning() bool { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SyncMessageBlockRoot", arg0, arg1) - ret0, _ := ret[0].(*eth.SyncMessageBlockRootResponse) - ret1, _ := ret[1].(error) - return ret0, ret1 + ret := m.ctrl.Call(m, "EventStreamIsRunning") + ret0, _ := ret[0].(bool) + return ret0 } -// GetSyncMessageBlockRoot indicates an expected call of GetSyncMessageBlockRoot. -func (mr *MockValidatorClientMockRecorder) GetSyncMessageBlockRoot(arg0, arg1 any) *gomock.Call { +// EventStreamIsRunning indicates an expected call of EventStreamIsRunning. +func (mr *MockValidatorClientMockRecorder) EventStreamIsRunning() *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncMessageBlockRoot", reflect.TypeOf((*MockValidatorClient)(nil).SyncMessageBlockRoot), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EventStreamIsRunning", reflect.TypeOf((*MockValidatorClient)(nil).EventStreamIsRunning)) } -// GetSyncSubcommitteeIndex mocks base method. -func (m *MockValidatorClient) SyncSubcommitteeIndex(arg0 context.Context, arg1 *eth.SyncSubcommitteeIndexRequest) (*eth.SyncSubcommitteeIndexResponse, error) { +// FeeRecipientByPubKey mocks base method. +func (m *MockValidatorClient) FeeRecipientByPubKey(arg0 context.Context, arg1 *eth.FeeRecipientByPubKeyRequest) (*eth.FeeRecipientByPubKeyResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SyncSubcommitteeIndex", arg0, arg1) - ret0, _ := ret[0].(*eth.SyncSubcommitteeIndexResponse) + ret := m.ctrl.Call(m, "FeeRecipientByPubKey", arg0, arg1) + ret0, _ := ret[0].(*eth.FeeRecipientByPubKeyResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetSyncSubcommitteeIndex indicates an expected call of GetSyncSubcommitteeIndex. -func (mr *MockValidatorClientMockRecorder) GetSyncSubcommitteeIndex(arg0, arg1 any) *gomock.Call { +// FeeRecipientByPubKey indicates an expected call of FeeRecipientByPubKey. +func (mr *MockValidatorClientMockRecorder) FeeRecipientByPubKey(arg0, arg1 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncSubcommitteeIndex", reflect.TypeOf((*MockValidatorClient)(nil).SyncSubcommitteeIndex), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FeeRecipientByPubKey", reflect.TypeOf((*MockValidatorClient)(nil).FeeRecipientByPubKey), arg0, arg1) } // MultipleValidatorStatus mocks base method. @@ -400,6 +355,51 @@ func (mr *MockValidatorClientMockRecorder) SubscribeCommitteeSubnets(arg0, arg1, return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SubscribeCommitteeSubnets", reflect.TypeOf((*MockValidatorClient)(nil).SubscribeCommitteeSubnets), arg0, arg1, arg2) } +// SyncCommitteeContribution mocks base method. +func (m *MockValidatorClient) SyncCommitteeContribution(arg0 context.Context, arg1 *eth.SyncCommitteeContributionRequest) (*eth.SyncCommitteeContribution, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SyncCommitteeContribution", arg0, arg1) + ret0, _ := ret[0].(*eth.SyncCommitteeContribution) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SyncCommitteeContribution indicates an expected call of SyncCommitteeContribution. +func (mr *MockValidatorClientMockRecorder) SyncCommitteeContribution(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncCommitteeContribution", reflect.TypeOf((*MockValidatorClient)(nil).SyncCommitteeContribution), arg0, arg1) +} + +// SyncMessageBlockRoot mocks base method. +func (m *MockValidatorClient) SyncMessageBlockRoot(arg0 context.Context, arg1 *emptypb.Empty) (*eth.SyncMessageBlockRootResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SyncMessageBlockRoot", arg0, arg1) + ret0, _ := ret[0].(*eth.SyncMessageBlockRootResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SyncMessageBlockRoot indicates an expected call of SyncMessageBlockRoot. +func (mr *MockValidatorClientMockRecorder) SyncMessageBlockRoot(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncMessageBlockRoot", reflect.TypeOf((*MockValidatorClient)(nil).SyncMessageBlockRoot), arg0, arg1) +} + +// SyncSubcommitteeIndex mocks base method. +func (m *MockValidatorClient) SyncSubcommitteeIndex(arg0 context.Context, arg1 *eth.SyncSubcommitteeIndexRequest) (*eth.SyncSubcommitteeIndexResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SyncSubcommitteeIndex", arg0, arg1) + ret0, _ := ret[0].(*eth.SyncSubcommitteeIndexResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// SyncSubcommitteeIndex indicates an expected call of SyncSubcommitteeIndex. +func (mr *MockValidatorClientMockRecorder) SyncSubcommitteeIndex(arg0, arg1 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncSubcommitteeIndex", reflect.TypeOf((*MockValidatorClient)(nil).SyncSubcommitteeIndex), arg0, arg1) +} + // ValidatorIndex mocks base method. func (m *MockValidatorClient) ValidatorIndex(arg0 context.Context, arg1 *eth.ValidatorIndexRequest) (*eth.ValidatorIndexResponse, error) { m.ctrl.T.Helper() diff --git a/validator/client/beacon-api/mock/genesis_mock.go b/validator/client/beacon-api/mock/genesis_mock.go index fce4c5ba2dd8..dd8e35e36eed 100644 --- a/validator/client/beacon-api/mock/genesis_mock.go +++ b/validator/client/beacon-api/mock/genesis_mock.go @@ -43,7 +43,7 @@ func (m *MockGenesisProvider) EXPECT() *MockGenesisProviderMockRecorder { // GetGenesis mocks base method. func (m *MockGenesisProvider) GetGenesis(ctx context.Context) (*structs.Genesis, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Genesis", ctx) + ret := m.ctrl.Call(m, "GetGenesis", ctx) ret0, _ := ret[0].(*structs.Genesis) ret1, _ := ret[1].(error) return ret0, ret1 @@ -52,5 +52,5 @@ func (m *MockGenesisProvider) GetGenesis(ctx context.Context) (*structs.Genesis, // GetGenesis indicates an expected call of GetGenesis. func (mr *MockGenesisProviderMockRecorder) GetGenesis(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Genesis", reflect.TypeOf((*MockGenesisProvider)(nil).GetGenesis), ctx) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGenesis", reflect.TypeOf((*MockGenesisProvider)(nil).GetGenesis), ctx) } diff --git a/validator/client/beacon-api/mock/json_rest_handler_mock.go b/validator/client/beacon-api/mock/json_rest_handler_mock.go index b79df47828b9..a625c20952f9 100644 --- a/validator/client/beacon-api/mock/json_rest_handler_mock.go +++ b/validator/client/beacon-api/mock/json_rest_handler_mock.go @@ -12,7 +12,7 @@ package mock import ( bytes "bytes" context "context" - "net/http" + http "net/http" reflect "reflect" gomock "go.uber.org/mock/gomock" @@ -36,14 +36,6 @@ func NewMockJsonRestHandler(ctrl *gomock.Controller) *MockJsonRestHandler { return mock } -func (mr *MockJsonRestHandler) HttpClient() *http.Client { - return nil -} - -func (mr *MockJsonRestHandler) Host() string { - return "" -} - // EXPECT returns an object that allows the caller to indicate expected use. func (m *MockJsonRestHandler) EXPECT() *MockJsonRestHandlerMockRecorder { return m.recorder @@ -63,6 +55,34 @@ func (mr *MockJsonRestHandlerMockRecorder) Get(ctx, endpoint, resp any) *gomock. return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockJsonRestHandler)(nil).Get), ctx, endpoint, resp) } +// Host mocks base method. +func (m *MockJsonRestHandler) Host() string { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "Host") + ret0, _ := ret[0].(string) + return ret0 +} + +// Host indicates an expected call of Host. +func (mr *MockJsonRestHandlerMockRecorder) Host() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Host", reflect.TypeOf((*MockJsonRestHandler)(nil).Host)) +} + +// HttpClient mocks base method. +func (m *MockJsonRestHandler) HttpClient() *http.Client { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "HttpClient") + ret0, _ := ret[0].(*http.Client) + return ret0 +} + +// HttpClient indicates an expected call of HttpClient. +func (mr *MockJsonRestHandlerMockRecorder) HttpClient() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HttpClient", reflect.TypeOf((*MockJsonRestHandler)(nil).HttpClient)) +} + // Post mocks base method. func (m *MockJsonRestHandler) Post(ctx context.Context, endpoint string, headers map[string]string, data *bytes.Buffer, resp any) error { m.ctrl.T.Helper() From 0218c98e105f938db6aea81c7034191c1fd9cbe0 Mon Sep 17 00:00:00 2001 From: rkapka Date: Mon, 27 May 2024 19:35:09 +0900 Subject: [PATCH 5/9] Revert beacon node changes --- beacon-chain/rpc/core/validator.go | 2 +- beacon-chain/rpc/endpoints.go | 16 ++-- beacon-chain/rpc/eth/beacon/handlers.go | 2 +- beacon-chain/rpc/eth/node/handlers.go | 4 +- beacon-chain/rpc/eth/validator/handlers.go | 2 +- .../rpc/prysm/beacon/validator_count.go | 2 +- .../rpc/prysm/v1alpha1/beacon/blocks.go | 2 +- .../rpc/prysm/v1alpha1/beacon/blocks_test.go | 8 +- .../rpc/prysm/v1alpha1/beacon/validators.go | 10 +-- .../prysm/v1alpha1/beacon/validators_test.go | 82 +++++++++---------- .../rpc/prysm/v1alpha1/validator/proposer.go | 2 +- .../prysm/validator/validator_performance.go | 2 +- 12 files changed, 67 insertions(+), 67 deletions(-) diff --git a/beacon-chain/rpc/core/validator.go b/beacon-chain/rpc/core/validator.go index f59d32068f53..9a5663bbfcad 100644 --- a/beacon-chain/rpc/core/validator.go +++ b/beacon-chain/rpc/core/validator.go @@ -327,7 +327,7 @@ func (s *Service) AggregatedSigAndAggregationBits( func (s *Service) GetAttestationData( ctx context.Context, req *ethpb.AttestationDataRequest, ) (*ethpb.AttestationData, *RpcError) { - ctx, span := trace.StartSpan(ctx, "coreService.AttestationData") + ctx, span := trace.StartSpan(ctx, "coreService.GetAttestationData") defer span.End() if req.Slot != s.GenesisTimeFetcher.CurrentSlot() { diff --git a/beacon-chain/rpc/endpoints.go b/beacon-chain/rpc/endpoints.go index 45681ed028f0..9809833c2338 100644 --- a/beacon-chain/rpc/endpoints.go +++ b/beacon-chain/rpc/endpoints.go @@ -192,7 +192,7 @@ func (s *Service) validatorEndpoints( }, { template: "/eth/v1/validator/attestation_data", - name: namespace + ".AttestationData", + name: namespace + ".GetAttestationData", handler: server.GetAttestationData, methods: []string{http.MethodGet}, }, @@ -283,7 +283,7 @@ func (s *Service) nodeEndpoints() []endpoint { return []endpoint{ { template: "/eth/v1/node/syncing", - name: namespace + ".SyncStatus", + name: namespace + ".GetSyncStatus", handler: server.GetSyncStatus, methods: []string{http.MethodGet}, }, @@ -313,7 +313,7 @@ func (s *Service) nodeEndpoints() []endpoint { }, { template: "/eth/v1/node/version", - name: namespace + ".Version", + name: namespace + ".GetVersion", handler: server.GetVersion, methods: []string{http.MethodGet}, }, @@ -520,7 +520,7 @@ func (s *Service) beaconEndpoints( }, { template: "/eth/v1/beacon/genesis", - name: namespace + ".Genesis", + name: namespace + ".GetGenesis", handler: server.GetGenesis, methods: []string{http.MethodGet}, }, @@ -690,13 +690,13 @@ func (s *Service) prysmBeaconEndpoints(ch *stategen.CanonicalHistory, stater loo }, { template: "/eth/v1/beacon/states/{state_id}/validator_count", - name: namespace + ".ValidatorCount", + name: namespace + ".GetValidatorCount", handler: server.GetValidatorCount, methods: []string{http.MethodGet}, }, { template: "/prysm/v1/beacon/states/{state_id}/validator_count", - name: namespace + ".ValidatorCount", + name: namespace + ".GetValidatorCount", handler: server.GetValidatorCount, methods: []string{http.MethodGet}, }, @@ -766,13 +766,13 @@ func (s *Service) prysmValidatorEndpoints(coreService *core.Service, stater look return []endpoint{ { template: "/prysm/validators/performance", - name: namespace + ".ValidatorPerformance", + name: namespace + ".GetValidatorPerformance", handler: server.GetValidatorPerformance, methods: []string{http.MethodPost}, }, { template: "/prysm/v1/validators/performance", - name: namespace + ".ValidatorPerformance", + name: namespace + ".GetValidatorPerformance", handler: server.GetValidatorPerformance, methods: []string{http.MethodPost}, }, diff --git a/beacon-chain/rpc/eth/beacon/handlers.go b/beacon-chain/rpc/eth/beacon/handlers.go index 16acb45298f2..4fc48d4eac68 100644 --- a/beacon-chain/rpc/eth/beacon/handlers.go +++ b/beacon-chain/rpc/eth/beacon/handlers.go @@ -1362,7 +1362,7 @@ func (s *Server) GetFinalityCheckpoints(w http.ResponseWriter, r *http.Request) // GetGenesis retrieves details of the chain's genesis which can be used to identify chain. func (s *Server) GetGenesis(w http.ResponseWriter, r *http.Request) { - _, span := trace.StartSpan(r.Context(), "beacon.Genesis") + _, span := trace.StartSpan(r.Context(), "beacon.GetGenesis") defer span.End() genesisTime := s.GenesisTimeFetcher.GenesisTime() diff --git a/beacon-chain/rpc/eth/node/handlers.go b/beacon-chain/rpc/eth/node/handlers.go index e6f716908389..7ccae43ed4ad 100644 --- a/beacon-chain/rpc/eth/node/handlers.go +++ b/beacon-chain/rpc/eth/node/handlers.go @@ -28,7 +28,7 @@ var ( // GetSyncStatus requests the beacon node to describe if it's currently syncing or not, and // if it is, what block it is up to. func (s *Server) GetSyncStatus(w http.ResponseWriter, r *http.Request) { - ctx, span := trace.StartSpan(r.Context(), "node.SyncStatus") + ctx, span := trace.StartSpan(r.Context(), "node.GetSyncStatus") defer span.End() isOptimistic, err := s.OptimisticModeFetcher.IsOptimistic(ctx) @@ -94,7 +94,7 @@ func (s *Server) GetIdentity(w http.ResponseWriter, r *http.Request) { // GetVersion requests that the beacon node identify information about its implementation in a // format similar to a HTTP User-Agent field. func (*Server) GetVersion(w http.ResponseWriter, r *http.Request) { - _, span := trace.StartSpan(r.Context(), "node.Version") + _, span := trace.StartSpan(r.Context(), "node.GetVersion") defer span.End() v := fmt.Sprintf("Prysm/%s (%s %s)", version.SemanticVersion(), runtime.GOOS, runtime.GOARCH) diff --git a/beacon-chain/rpc/eth/validator/handlers.go b/beacon-chain/rpc/eth/validator/handlers.go index 9c24bf9f5e6a..f10dbb9d2b78 100644 --- a/beacon-chain/rpc/eth/validator/handlers.go +++ b/beacon-chain/rpc/eth/validator/handlers.go @@ -396,7 +396,7 @@ func (s *Server) SubmitBeaconCommitteeSubscription(w http.ResponseWriter, r *htt // GetAttestationData requests that the beacon node produces attestation data for // the requested committee index and slot based on the nodes current head. func (s *Server) GetAttestationData(w http.ResponseWriter, r *http.Request) { - ctx, span := trace.StartSpan(r.Context(), "validator.AttestationData") + ctx, span := trace.StartSpan(r.Context(), "validator.GetAttestationData") defer span.End() if shared.IsSyncing(ctx, w, s.SyncChecker, s.HeadFetcher, s.TimeFetcher, s.OptimisticModeFetcher) { diff --git a/beacon-chain/rpc/prysm/beacon/validator_count.go b/beacon-chain/rpc/prysm/beacon/validator_count.go index 67688938e71d..166a8c5c684d 100644 --- a/beacon-chain/rpc/prysm/beacon/validator_count.go +++ b/beacon-chain/rpc/prysm/beacon/validator_count.go @@ -50,7 +50,7 @@ import ( // ] // } func (s *Server) GetValidatorCount(w http.ResponseWriter, r *http.Request) { - ctx, span := trace.StartSpan(r.Context(), "beacon.ValidatorCount") + ctx, span := trace.StartSpan(r.Context(), "beacon.GetValidatorCount") defer span.End() stateID := mux.Vars(r)["state_id"] diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go index 274bab8c54f7..b6315f886698 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go @@ -243,7 +243,7 @@ func (bs *Server) listBlocksForGenesis(ctx context.Context, _ *ethpb.ListBlocksR // This includes the head block slot and root as well as information about // the most recent finalized and justified slots. // DEPRECATED: This endpoint is superseded by the /eth/v1/beacon API endpoint -func (bs *Server) ChainHead(ctx context.Context, _ *emptypb.Empty) (*ethpb.ChainHead, error) { +func (bs *Server) GetChainHead(ctx context.Context, _ *emptypb.Empty) (*ethpb.ChainHead, error) { return bs.chainHeadRetrieval(ctx) } diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go index 756f0d5c84ef..fb6900d5eed1 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go @@ -76,7 +76,7 @@ func TestServer_GetChainHead_NoGenesis(t *testing.T) { PreviousJustifiedCheckPoint: s.PreviousJustifiedCheckpoint()}, OptimisticModeFetcher: &chainMock.ChainService{}, } - _, err = bs.ChainHead(context.Background(), nil) + _, err = bs.GetChainHead(context.Background(), nil) require.ErrorContains(t, "Could not get genesis block", err) } } @@ -111,7 +111,7 @@ func TestServer_GetChainHead_NoFinalizedBlock(t *testing.T) { OptimisticModeFetcher: &chainMock.ChainService{}, } - _, err = bs.ChainHead(context.Background(), nil) + _, err = bs.GetChainHead(context.Background(), nil) require.ErrorContains(t, "Could not get finalized block", err) } @@ -120,7 +120,7 @@ func TestServer_GetChainHead_NoHeadBlock(t *testing.T) { HeadFetcher: &chainMock.ChainService{Block: nil}, OptimisticModeFetcher: &chainMock.ChainService{}, } - _, err := bs.ChainHead(context.Background(), nil) + _, err := bs.GetChainHead(context.Background(), nil) assert.ErrorContains(t, "Head block of chain was nil", err) } @@ -181,7 +181,7 @@ func TestServer_GetChainHead(t *testing.T) { PreviousJustifiedCheckPoint: s.PreviousJustifiedCheckpoint()}, } - head, err := bs.ChainHead(context.Background(), nil) + head, err := bs.GetChainHead(context.Background(), nil) require.NoError(t, err) assert.Equal(t, primitives.Epoch(3), head.PreviousJustifiedEpoch, "Unexpected PreviousJustifiedEpoch") assert.Equal(t, primitives.Epoch(2), head.JustifiedEpoch, "Unexpected JustifiedEpoch") diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go index 98c70280cae3..efad2fa89da6 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go @@ -30,7 +30,7 @@ import ( // ListValidatorBalances retrieves the validator balances for a given set of public keys. // An optional Epoch parameter is provided to request historical validator balances from // archived, persistent data. -func (bs *Server) ValidatorBalances( +func (bs *Server) ListValidatorBalances( ctx context.Context, req *ethpb.ListValidatorBalancesRequest, ) (*ethpb.ValidatorBalances, error) { @@ -185,7 +185,7 @@ func (bs *Server) ValidatorBalances( // ListValidators retrieves the current list of active validators with an optional historical epoch flag to // retrieve validator set in time. -func (bs *Server) Validators( +func (bs *Server) ListValidators( ctx context.Context, req *ethpb.ListValidatorsRequest, ) (*ethpb.Validators, error) { @@ -474,7 +474,7 @@ func (bs *Server) GetValidatorActiveSetChanges( // GetValidatorParticipation retrieves the validator participation information for a given epoch, // it returns the information about validator's participation rate in voting on the proof of stake // rules based on their balance compared to the total active validator balance. -func (bs *Server) ValidatorParticipation( +func (bs *Server) GetValidatorParticipation( ctx context.Context, req *ethpb.GetValidatorParticipationRequest, ) (*ethpb.ValidatorParticipationResponse, error) { currentSlot := bs.GenesisTimeFetcher.CurrentSlot() @@ -565,7 +565,7 @@ func (bs *Server) ValidatorParticipation( } // GetValidatorQueue retrieves the current validator queue information. -func (bs *Server) ValidatorQueue( +func (bs *Server) GetValidatorQueue( ctx context.Context, _ *emptypb.Empty, ) (*ethpb.ValidatorQueue, error) { headState, err := bs.HeadFetcher.HeadState(ctx) @@ -657,7 +657,7 @@ func (bs *Server) ValidatorQueue( // GetValidatorPerformance reports the validator's latest balance along with other important metrics on // rewards and penalties throughout its lifecycle in the beacon chain. -func (bs *Server) ValidatorPerformance( +func (bs *Server) GetValidatorPerformance( ctx context.Context, req *ethpb.ValidatorPerformanceRequest, ) (*ethpb.ValidatorPerformanceResponse, error) { response, err := bs.CoreService.ComputeValidatorPerformance(ctx, req) diff --git a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go index d98232818e03..56a6a3f3e516 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go +++ b/beacon-chain/rpc/prysm/v1alpha1/beacon/validators_test.go @@ -89,7 +89,7 @@ func TestServer_ListValidatorBalances_CannotRequestFutureEpoch(t *testing.T) { } wanted := errNoEpochInfoError - _, err = bs.ValidatorBalances( + _, err = bs.ListValidatorBalances( ctx, ðpb.ListValidatorBalancesRequest{ QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{ @@ -128,7 +128,7 @@ func TestServer_ListValidatorBalances_NoResults(t *testing.T) { TotalSize: int32(0), NextPageToken: strconv.Itoa(0), } - res, err := bs.ValidatorBalances( + res, err := bs.ListValidatorBalances( ctx, ðpb.ListValidatorBalancesRequest{ QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{ @@ -182,7 +182,7 @@ func TestServer_ListValidatorBalances_DefaultResponse_NoArchive(t *testing.T) { }, ReplayerBuilder: mockstategen.NewReplayerBuilder(mockstategen.WithMockState(st)), } - res, err := bs.ValidatorBalances( + res, err := bs.ListValidatorBalances( ctx, ðpb.ListValidatorBalancesRequest{ QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{Epoch: 0}, @@ -213,7 +213,7 @@ func TestServer_ListValidatorBalances_PaginationOutOfRange(t *testing.T) { } wanted := fmt.Sprintf("page start %d >= list %d", 200, len(headState.Balances())) - _, err = bs.ValidatorBalances(context.Background(), ðpb.ListValidatorBalancesRequest{ + _, err = bs.ListValidatorBalances(context.Background(), ðpb.ListValidatorBalancesRequest{ PageToken: strconv.Itoa(2), PageSize: 100, QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{Epoch: 0}, @@ -231,7 +231,7 @@ func TestServer_ListValidatorBalances_ExceedsMaxPageSize(t *testing.T) { cmd.Get().MaxRPCPageSize, ) req := ðpb.ListValidatorBalancesRequest{PageSize: exceedsMax} - _, err := bs.ValidatorBalances(context.Background(), req) + _, err := bs.ListValidatorBalances(context.Background(), req) assert.ErrorContains(t, wanted, err) } @@ -316,7 +316,7 @@ func TestServer_ListValidatorBalances_Pagination_Default(t *testing.T) { }}, } for _, test := range tests { - res, err := bs.ValidatorBalances(context.Background(), test.req) + res, err := bs.ListValidatorBalances(context.Background(), test.req) require.NoError(t, err) if !proto.Equal(res, test.res) { t.Errorf("Expected %v, received %v", test.res, res) @@ -385,7 +385,7 @@ func TestServer_ListValidatorBalances_Pagination_CustomPageSizes(t *testing.T) { TotalSize: int32(count)}}, } for _, test := range tests { - res, err := bs.ValidatorBalances(context.Background(), test.req) + res, err := bs.ListValidatorBalances(context.Background(), test.req) require.NoError(t, err) if !proto.Equal(res, test.res) { t.Errorf("Expected %v, received %v", test.res, res) @@ -415,7 +415,7 @@ func TestServer_ListValidatorBalances_OutOfRange(t *testing.T) { req := ðpb.ListValidatorBalancesRequest{Indices: []primitives.ValidatorIndex{primitives.ValidatorIndex(1)}, QueryFilter: ðpb.ListValidatorBalancesRequest_Epoch{Epoch: 0}} wanted := "Validator index 1 >= balance list 1" - _, err = bs.ValidatorBalances(context.Background(), req) + _, err = bs.ListValidatorBalances(context.Background(), req) assert.ErrorContains(t, wanted, err) } @@ -438,7 +438,7 @@ func TestServer_ListValidators_CannotRequestFutureEpoch(t *testing.T) { } wanted := errNoEpochInfoError - _, err = bs.Validators( + _, err = bs.ListValidators( ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Epoch{ @@ -470,7 +470,7 @@ func TestServer_ListValidators_reqStateIsNil(t *testing.T) { // request uses HeadFetcher to get reqState. req1 := ðpb.ListValidatorsRequest{PageToken: strconv.Itoa(1), PageSize: 100} wanted := "Requested state is nil" - _, err := bs.Validators(context.Background(), req1) + _, err := bs.ListValidators(context.Background(), req1) assert.ErrorContains(t, wanted, err) // request uses StateGen to get reqState. @@ -479,7 +479,7 @@ func TestServer_ListValidators_reqStateIsNil(t *testing.T) { PageToken: strconv.Itoa(1), PageSize: 100, } - _, err = bs.Validators(context.Background(), req2) + _, err = bs.ListValidators(context.Background(), req2) assert.ErrorContains(t, wanted, err) } @@ -509,7 +509,7 @@ func TestServer_ListValidators_NoResults(t *testing.T) { TotalSize: int32(0), NextPageToken: strconv.Itoa(0), } - res, err := bs.Validators( + res, err := bs.ListValidators( ctx, ðpb.ListValidatorsRequest{ QueryFilter: ðpb.ListValidatorsRequest_Epoch{ @@ -579,7 +579,7 @@ func TestServer_ListValidators_OnlyActiveValidators(t *testing.T) { require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, gRoot)) require.NoError(t, beaconDB.SaveState(ctx, st, gRoot)) - received, err := bs.Validators(ctx, ðpb.ListValidatorsRequest{ + received, err := bs.ListValidators(ctx, ðpb.ListValidatorsRequest{ Active: true, }) require.NoError(t, err) @@ -647,7 +647,7 @@ func TestServer_ListValidators_InactiveInTheMiddle(t *testing.T) { require.NoError(t, beaconDB.SaveGenesisBlockRoot(ctx, gRoot)) require.NoError(t, beaconDB.SaveState(ctx, st, gRoot)) - received, err := bs.Validators(ctx, ðpb.ListValidatorsRequest{ + received, err := bs.ListValidators(ctx, ðpb.ListValidatorsRequest{ Active: true, }) require.NoError(t, err) @@ -695,7 +695,7 @@ func TestServer_ListValidatorBalances_UnknownValidatorInResponse(t *testing.T) { NextPageToken: "", TotalSize: 3, } - res, err := bs.ValidatorBalances(context.Background(), req) + res, err := bs.ListValidatorBalances(context.Background(), req) require.NoError(t, err) if !proto.Equal(res, wanted) { t.Errorf("Expected %v, received %v", wanted, res) @@ -730,7 +730,7 @@ func TestServer_ListValidators_NoPagination(t *testing.T) { StateGen: stategen.New(beaconDB, doublylinkedtree.New()), } - received, err := bs.Validators(context.Background(), ðpb.ListValidatorsRequest{}) + received, err := bs.ListValidators(context.Background(), ðpb.ListValidatorsRequest{}) require.NoError(t, err) assert.DeepSSZEqual(t, want, received.ValidatorList, "Incorrect respond of validators") } @@ -757,7 +757,7 @@ func TestServer_ListValidators_StategenNotUsed(t *testing.T) { }, } - received, err := bs.Validators(context.Background(), ðpb.ListValidatorsRequest{}) + received, err := bs.ListValidators(context.Background(), ðpb.ListValidatorsRequest{}) require.NoError(t, err) assert.DeepEqual(t, want, received.ValidatorList, "Incorrect respond of validators") } @@ -804,7 +804,7 @@ func TestServer_ListValidators_IndicesPubKeys(t *testing.T) { Indices: indicesWanted, PublicKeys: pubKeysWanted, } - received, err := bs.Validators(context.Background(), req) + received, err := bs.ListValidators(context.Background(), req) require.NoError(t, err) assert.DeepEqual(t, want, received.ValidatorList, "Incorrect respond of validators") } @@ -939,7 +939,7 @@ func TestServer_ListValidators_Pagination(t *testing.T) { TotalSize: int32(count)}}, } for _, test := range tests { - res, err := bs.Validators(context.Background(), test.req) + res, err := bs.ListValidators(context.Background(), test.req) require.NoError(t, err) if !proto.Equal(res, test.res) { t.Errorf("Incorrect validator response, wanted %v, received %v", test.res, res) @@ -971,7 +971,7 @@ func TestServer_ListValidators_PaginationOutOfRange(t *testing.T) { req := ðpb.ListValidatorsRequest{PageToken: strconv.Itoa(1), PageSize: 100} wanted := fmt.Sprintf("page start %d >= list %d", req.PageSize, len(validators)) - _, err := bs.Validators(context.Background(), req) + _, err := bs.ListValidators(context.Background(), req) assert.ErrorContains(t, wanted, err) } @@ -981,7 +981,7 @@ func TestServer_ListValidators_ExceedsMaxPageSize(t *testing.T) { wanted := fmt.Sprintf("Requested page size %d can not be greater than max size %d", exceedsMax, cmd.Get().MaxRPCPageSize) req := ðpb.ListValidatorsRequest{PageToken: strconv.Itoa(0), PageSize: exceedsMax} - _, err := bs.Validators(context.Background(), req) + _, err := bs.ListValidators(context.Background(), req) assert.ErrorContains(t, wanted, err) } @@ -1014,7 +1014,7 @@ func TestServer_ListValidators_DefaultPageSize(t *testing.T) { } req := ðpb.ListValidatorsRequest{} - res, err := bs.Validators(context.Background(), req) + res, err := bs.ListValidators(context.Background(), req) require.NoError(t, err) i := 0 @@ -1063,7 +1063,7 @@ func TestServer_ListValidators_FromOldEpoch(t *testing.T) { Genesis: true, }, } - res, err := bs.Validators(context.Background(), req) + res, err := bs.ListValidators(context.Background(), req) require.NoError(t, err) assert.Equal(t, epochs, len(res.ValidatorList)) @@ -1080,7 +1080,7 @@ func TestServer_ListValidators_FromOldEpoch(t *testing.T) { Epoch: 10, }, } - res, err = bs.Validators(context.Background(), req) + res, err = bs.ListValidators(context.Background(), req) require.NoError(t, err) require.Equal(t, len(want), len(res.ValidatorList), "incorrect number of validators") @@ -1142,7 +1142,7 @@ func TestServer_ListValidators_ProcessHeadStateSlots(t *testing.T) { Epoch: 1, }, } - res, err := bs.Validators(context.Background(), req) + res, err := bs.ListValidators(context.Background(), req) require.NoError(t, err) assert.Equal(t, len(want), len(res.ValidatorList), "Incorrect number of validators") for i := 0; i < len(res.ValidatorList); i++ { @@ -1360,7 +1360,7 @@ func TestServer_GetValidatorQueue_PendingActivation(t *testing.T) { State: headState, }, } - res, err := bs.ValidatorQueue(context.Background(), &emptypb.Empty{}) + res, err := bs.GetValidatorQueue(context.Background(), &emptypb.Empty{}) require.NoError(t, err) // We verify the keys are properly sorted by the validators' activation eligibility epoch. wanted := [][]byte{ @@ -1404,7 +1404,7 @@ func TestServer_GetValidatorQueue_ExitedValidatorLeavesQueue(t *testing.T) { } // First we check if validator with index 1 is in the exit queue. - res, err := bs.ValidatorQueue(context.Background(), &emptypb.Empty{}) + res, err := bs.GetValidatorQueue(context.Background(), &emptypb.Empty{}) require.NoError(t, err) wanted := [][]byte{ bytesutil.PadTo([]byte("2"), 48), @@ -1420,7 +1420,7 @@ func TestServer_GetValidatorQueue_ExitedValidatorLeavesQueue(t *testing.T) { // Now, we move the state.slot past the exit epoch of the validator, and now // the validator should no longer exist in the queue. require.NoError(t, headState.SetSlot(params.BeaconConfig().SlotsPerEpoch.Mul(uint64(validators[1].ExitEpoch+1)))) - res, err = bs.ValidatorQueue(context.Background(), &emptypb.Empty{}) + res, err = bs.GetValidatorQueue(context.Background(), &emptypb.Empty{}) require.NoError(t, err) assert.Equal(t, 0, len(res.ExitPublicKeys)) } @@ -1460,7 +1460,7 @@ func TestServer_GetValidatorQueue_PendingExit(t *testing.T) { State: headState, }, } - res, err := bs.ValidatorQueue(context.Background(), &emptypb.Empty{}) + res, err := bs.GetValidatorQueue(context.Background(), &emptypb.Empty{}) require.NoError(t, err) // We verify the keys are properly sorted by the validators' withdrawable epoch. wanted := [][]byte{ @@ -1492,7 +1492,7 @@ func TestServer_GetValidatorParticipation_CannotRequestFutureEpoch(t *testing.T) } wanted := "Cannot retrieve information about an epoch" - _, err = bs.ValidatorParticipation( + _, err = bs.GetValidatorParticipation( ctx, ðpb.GetValidatorParticipationRequest{ QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{ @@ -1564,7 +1564,7 @@ func TestServer_GetValidatorParticipation_CurrentAndPrevEpoch(t *testing.T) { } addDefaultReplayerBuilder(bs, beaconDB) - res, err := bs.ValidatorParticipation(ctx, ðpb.GetValidatorParticipationRequest{QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{Epoch: 1}}) + res, err := bs.GetValidatorParticipation(ctx, ðpb.GetValidatorParticipationRequest{QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{Epoch: 1}}) require.NoError(t, err) wanted := ðpb.ValidatorParticipation{ @@ -1643,7 +1643,7 @@ func TestServer_GetValidatorParticipation_OrphanedUntilGenesis(t *testing.T) { } addDefaultReplayerBuilder(bs, beaconDB) - res, err := bs.ValidatorParticipation(ctx, ðpb.GetValidatorParticipationRequest{QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{Epoch: 1}}) + res, err := bs.GetValidatorParticipation(ctx, ðpb.GetValidatorParticipationRequest{QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{Epoch: 1}}) require.NoError(t, err) wanted := ðpb.ValidatorParticipation{ @@ -1754,7 +1754,7 @@ func runGetValidatorParticipationCurrentAndPrevEpoch(t *testing.T, genState stat } addDefaultReplayerBuilder(bs, beaconDB) - res, err := bs.ValidatorParticipation(ctx, ðpb.GetValidatorParticipationRequest{QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{Epoch: 0}}) + res, err := bs.GetValidatorParticipation(ctx, ðpb.GetValidatorParticipationRequest{QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{Epoch: 0}}) require.NoError(t, err) wanted := ðpb.ValidatorParticipation{ @@ -1772,7 +1772,7 @@ func runGetValidatorParticipationCurrentAndPrevEpoch(t *testing.T, genState stat assert.DeepEqual(t, true, res.Finalized, "Incorrect validator participation respond") assert.DeepEqual(t, wanted, res.Participation, "Incorrect validator participation respond") - res, err = bs.ValidatorParticipation(ctx, ðpb.GetValidatorParticipationRequest{QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{Epoch: 1}}) + res, err = bs.GetValidatorParticipation(ctx, ðpb.GetValidatorParticipationRequest{QueryFilter: ðpb.GetValidatorParticipationRequest_Epoch{Epoch: 1}}) require.NoError(t, err) wanted = ðpb.ValidatorParticipation{ @@ -1801,7 +1801,7 @@ func TestGetValidatorPerformance_Syncing(t *testing.T) { } wanted := "Syncing to latest head, not ready to respond" - _, err := bs.ValidatorPerformance(ctx, nil) + _, err := bs.GetValidatorPerformance(ctx, nil) assert.ErrorContains(t, wanted, err) } @@ -1876,7 +1876,7 @@ func TestGetValidatorPerformance_OK(t *testing.T) { MissingValidators: [][]byte{publicKey1[:]}, } - res, err := bs.ValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ + res, err := bs.GetValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ PublicKeys: [][]byte{publicKey1[:], publicKey3[:], publicKey2[:]}, }) require.NoError(t, err) @@ -1947,7 +1947,7 @@ func TestGetValidatorPerformance_Indices(t *testing.T) { MissingValidators: [][]byte{publicKey1[:]}, } - res, err := bs.ValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ + res, err := bs.GetValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ Indices: []primitives.ValidatorIndex{2, 1, 0}, }) require.NoError(t, err) @@ -2020,7 +2020,7 @@ func TestGetValidatorPerformance_IndicesPubkeys(t *testing.T) { } // Index 2 and publicKey3 points to the same validator. // Should not return duplicates. - res, err := bs.ValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ + res, err := bs.GetValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ PublicKeys: [][]byte{publicKey1[:], publicKey3[:]}, Indices: []primitives.ValidatorIndex{1, 2}, }) require.NoError(t, err) @@ -2090,7 +2090,7 @@ func TestGetValidatorPerformanceAltair_OK(t *testing.T) { InactivityScores: []uint64{0, 0}, } - res, err := bs.ValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ + res, err := bs.GetValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ PublicKeys: [][]byte{publicKey1[:], publicKey3[:], publicKey2[:]}, }) require.NoError(t, err) @@ -2160,7 +2160,7 @@ func TestGetValidatorPerformanceBellatrix_OK(t *testing.T) { InactivityScores: []uint64{0, 0}, } - res, err := bs.ValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ + res, err := bs.GetValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ PublicKeys: [][]byte{publicKey1[:], publicKey3[:], publicKey2[:]}, }) require.NoError(t, err) @@ -2230,7 +2230,7 @@ func TestGetValidatorPerformanceCapella_OK(t *testing.T) { InactivityScores: []uint64{0, 0}, } - res, err := bs.ValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ + res, err := bs.GetValidatorPerformance(ctx, ðpb.ValidatorPerformanceRequest{ PublicKeys: [][]byte{publicKey1[:], publicKey3[:], publicKey2[:]}, }) require.NoError(t, err) diff --git a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go index 46b233307768..07bece2470f8 100644 --- a/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go +++ b/beacon-chain/rpc/prysm/v1alpha1/validator/proposer.go @@ -48,7 +48,7 @@ const ( // GetBeaconBlock is called by a proposer during its assigned slot to request a block to sign // by passing in the slot and the signed randao reveal of the slot. func (vs *Server) GetBeaconBlock(ctx context.Context, req *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) { - ctx, span := trace.StartSpan(ctx, "ProposerServer.BeaconBlock") + ctx, span := trace.StartSpan(ctx, "ProposerServer.GetBeaconBlock") defer span.End() span.AddAttributes(trace.Int64Attribute("slot", int64(req.Slot))) diff --git a/beacon-chain/rpc/prysm/validator/validator_performance.go b/beacon-chain/rpc/prysm/validator/validator_performance.go index fb79133842af..fbd7547ad273 100644 --- a/beacon-chain/rpc/prysm/validator/validator_performance.go +++ b/beacon-chain/rpc/prysm/validator/validator_performance.go @@ -13,7 +13,7 @@ import ( // GetValidatorPerformance is an HTTP handler for GetValidatorPerformance. func (s *Server) GetValidatorPerformance(w http.ResponseWriter, r *http.Request) { - ctx, span := trace.StartSpan(r.Context(), "validator.ValidatorPerformance") + ctx, span := trace.StartSpan(r.Context(), "validator.GetValidatorPerformance") defer span.End() var req structs.GetValidatorPerformanceRequest From 174846756d30ebcf50005b5d85b039c3c1a3fe6f Mon Sep 17 00:00:00 2001 From: rkapka Date: Mon, 27 May 2024 19:39:42 +0900 Subject: [PATCH 6/9] build fix --- cmd/validator/accounts/exit_test.go | 8 ++--- validator/client/attest_test.go | 24 ++++++------- validator/client/beacon-api/activation.go | 2 +- validator/client/beacon-api/stream_blocks.go | 2 +- validator/client/propose_test.go | 18 +++++----- validator/client/service.go | 8 ++--- validator/client/sync_committee_test.go | 28 +++++++-------- validator/client/validator_test.go | 36 ++++++++++---------- validator/rpc/handlers_accounts_test.go | 2 +- validator/rpc/handlers_beacon_test.go | 6 ++-- validator/rpc/handlers_health_test.go | 2 +- validator/rpc/handlers_keymanager_test.go | 4 +-- 12 files changed, 70 insertions(+), 70 deletions(-) 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/service.go b/validator/client/service.go index ec6fb1c29b97..91ac12915965 100644 --- a/validator/client/service.go +++ b/validator/client/service.go @@ -23,8 +23,8 @@ import ( beaconApi "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api" beaconChainClientFactory "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-chain-client-factory" "github.com/prysmaticlabs/prysm/v5/validator/client/iface" - "github.com/prysmaticlabs/prysm/v5/validator/client/node-client-factory" - "github.com/prysmaticlabs/prysm/v5/validator/client/validator-client-factory" + nodeclientfactory "github.com/prysmaticlabs/prysm/v5/validator/client/node-client-factory" + validatorclientfactory "github.com/prysmaticlabs/prysm/v5/validator/client/validator-client-factory" "github.com/prysmaticlabs/prysm/v5/validator/db" "github.com/prysmaticlabs/prysm/v5/validator/graffiti" validatorHelpers "github.com/prysmaticlabs/prysm/v5/validator/helpers" @@ -170,7 +170,7 @@ func (v *ValidatorService) Start() { v.conn.GetBeaconApiUrl(), ) - validatorClient := validator_client_factory.NewValidatorClient(v.conn, restHandler) + validatorClient := validatorclientfactory.NewValidatorClient(v.conn, restHandler) valStruct := &validator{ slotFeed: new(event.Feed), @@ -186,7 +186,7 @@ func (v *ValidatorService) Start() { graffitiOrderedIndex: graffitiOrderedIndex, validatorClient: validatorClient, chainClient: beaconChainClientFactory.NewChainClient(v.conn, restHandler), - nodeClient: node_client_factory.NewNodeClient(v.conn, restHandler), + nodeClient: nodeclientfactory.NewNodeClient(v.conn, restHandler), prysmChainClient: beaconChainClientFactory.NewPrysmChainClient(v.conn, restHandler), db: v.db, km: nil, 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/client/validator_test.go b/validator/client/validator_test.go index c32f7a6605ef..94257c46b074 100644 --- a/validator/client/validator_test.go +++ b/validator/client/validator_test.go @@ -385,7 +385,7 @@ func TestWaitSync_ContextCanceled(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) cancel() - n.EXPECT().GetSyncStatus( + n.EXPECT().SyncStatus( gomock.Any(), gomock.Any(), ).Return(ðpb.SyncStatus{Syncing: true}, nil) @@ -402,7 +402,7 @@ func TestWaitSync_NotSyncing(t *testing.T) { nodeClient: n, } - n.EXPECT().GetSyncStatus( + n.EXPECT().SyncStatus( gomock.Any(), gomock.Any(), ).Return(ðpb.SyncStatus{Syncing: false}, nil) @@ -419,12 +419,12 @@ func TestWaitSync_Syncing(t *testing.T) { nodeClient: n, } - n.EXPECT().GetSyncStatus( + n.EXPECT().SyncStatus( gomock.Any(), gomock.Any(), ).Return(ðpb.SyncStatus{Syncing: true}, nil) - n.EXPECT().GetSyncStatus( + n.EXPECT().SyncStatus( gomock.Any(), gomock.Any(), ).Return(ðpb.SyncStatus{Syncing: false}, nil) @@ -450,7 +450,7 @@ func TestUpdateDuties_DoesNothingWhenNotEpochStart_AlreadyExistingAssignments(t }, }, } - client.EXPECT().GetDuties( + client.EXPECT().Duties( gomock.Any(), gomock.Any(), ).Times(0) @@ -477,7 +477,7 @@ func TestUpdateDuties_ReturnsError(t *testing.T) { expected := errors.New("bad") - client.EXPECT().GetDuties( + client.EXPECT().Duties( gomock.Any(), gomock.Any(), ).Return(nil, expected) @@ -508,7 +508,7 @@ func TestUpdateDuties_OK(t *testing.T) { km: newMockKeymanager(t, randKeypair(t)), validatorClient: client, } - client.EXPECT().GetDuties( + client.EXPECT().Duties( gomock.Any(), gomock.Any(), ).Return(resp, nil) @@ -557,7 +557,7 @@ func TestUpdateDuties_OK_FilterBlacklistedPublicKeys(t *testing.T) { resp := ðpb.DutiesResponse{ CurrentEpochDuties: []*ethpb.DutiesResponse_Duty{}, } - client.EXPECT().GetDuties( + client.EXPECT().Duties( gomock.Any(), gomock.Any(), ).Return(resp, nil) @@ -614,7 +614,7 @@ func TestUpdateDuties_AllValidatorsExited(t *testing.T) { km: newMockKeymanager(t, randKeypair(t)), validatorClient: client, } - client.EXPECT().GetDuties( + client.EXPECT().Duties( gomock.Any(), gomock.Any(), ).Return(resp, nil) @@ -661,7 +661,7 @@ func TestUpdateDuties_Distributed(t *testing.T) { sigDomain := make([]byte, 32) - client.EXPECT().GetDuties( + client.EXPECT().Duties( gomock.Any(), gomock.Any(), ).Return(resp, nil) @@ -674,7 +674,7 @@ func TestUpdateDuties_Distributed(t *testing.T) { nil, /*err*/ ).Times(2) - client.EXPECT().GetAggregatedSelections( + client.EXPECT().AggregatedSelections( gomock.Any(), gomock.Any(), // fill this properly ).Return( @@ -740,7 +740,7 @@ func TestRolesAt_OK(t *testing.T) { gomock.Any(), // epoch ).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/) - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ PublicKey: validatorKey.PublicKey().Marshal(), @@ -775,7 +775,7 @@ func TestRolesAt_OK(t *testing.T) { }, } - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ PublicKey: validatorKey.PublicKey().Marshal(), @@ -1250,7 +1250,7 @@ func TestIsSyncCommitteeAggregator_OK(t *testing.T) { slot := primitives.Slot(1) pubKey := validatorKey.PublicKey().Marshal() - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ PublicKey: validatorKey.PublicKey().Marshal(), @@ -1271,7 +1271,7 @@ func TestIsSyncCommitteeAggregator_OK(t *testing.T) { gomock.Any(), // epoch ).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/) - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ PublicKey: validatorKey.PublicKey().Marshal(), @@ -1297,7 +1297,7 @@ func TestIsSyncCommitteeAggregator_Distributed_OK(t *testing.T) { slot := primitives.Slot(1) pubKey := validatorKey.PublicKey().Marshal() - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ PublicKey: validatorKey.PublicKey().Marshal(), @@ -1318,7 +1318,7 @@ func TestIsSyncCommitteeAggregator_Distributed_OK(t *testing.T) { gomock.Any(), // epoch ).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/).Times(2) - m.validatorClient.EXPECT().GetSyncSubcommitteeIndex( + m.validatorClient.EXPECT().SyncSubcommitteeIndex( gomock.Any(), // ctx ðpb.SyncSubcommitteeIndexRequest{ PublicKey: validatorKey.PublicKey().Marshal(), @@ -1335,7 +1335,7 @@ func TestIsSyncCommitteeAggregator_Distributed_OK(t *testing.T) { ValidatorIndex: 123, SubcommitteeIndex: 0, } - m.validatorClient.EXPECT().GetAggregatedSyncSelections( + m.validatorClient.EXPECT().AggregatedSyncSelections( gomock.Any(), // ctx []iface.SyncCommitteeSelection{selection}, ).Return([]iface.SyncCommitteeSelection{selection}, nil) 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) From 1b7a8bf749f45c9c21a4dce8f623369b5874f7d4 Mon Sep 17 00:00:00 2001 From: rkapka Date: Wed, 29 May 2024 19:16:55 +0900 Subject: [PATCH 7/9] review --- .../beacon-api/beacon_api_validator_client.go | 2 +- validator/client/beacon-api/duties.go | 8 ++++---- validator/client/beacon-api/duties_test.go | 18 +++++++++--------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/validator/client/beacon-api/beacon_api_validator_client.go b/validator/client/beacon-api/beacon_api_validator_client.go index 490500be8ff0..3aedd10d4b2e 100644 --- a/validator/client/beacon-api/beacon_api_validator_client.go +++ b/validator/client/beacon-api/beacon_api_validator_client.go @@ -48,7 +48,7 @@ func NewBeaconApiValidatorClient(jsonRestHandler JsonRestHandler, opts ...Valida func (c *beaconApiValidatorClient) Duties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { return wrapInMetrics[*ethpb.DutiesResponse]("Duties", func() (*ethpb.DutiesResponse, error) { - return c.getDuties(ctx, in) + return c.duties(ctx, in) }) } diff --git a/validator/client/beacon-api/duties.go b/validator/client/beacon-api/duties.go index b673a16ac07b..8ae3243c923f 100644 --- a/validator/client/beacon-api/duties.go +++ b/validator/client/beacon-api/duties.go @@ -40,7 +40,7 @@ type validatorForDuty struct { status ethpb.ValidatorStatus } -func (c *beaconApiValidatorClient) getDuties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { +func (c *beaconApiValidatorClient) duties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { vals, err := c.getValidatorsForDuties(ctx, in.PublicKeys) if err != nil { return nil, errors.Wrap(err, "failed to get validators for duties") @@ -53,7 +53,7 @@ func (c *beaconApiValidatorClient) getDuties(ctx context.Context, in *ethpb.Duti var currentEpochDuties []*ethpb.DutiesResponse_Duty go func() { - currentEpochDuties, err = c.getDutiesForEpoch(ctx, in.Epoch, vals, fetchSyncDuties) + currentEpochDuties, err = c.dutiesForEpoch(ctx, in.Epoch, vals, fetchSyncDuties) if err != nil { errCh <- errors.Wrapf(err, "failed to get duties for current epoch `%d`", in.Epoch) return @@ -61,7 +61,7 @@ func (c *beaconApiValidatorClient) getDuties(ctx context.Context, in *ethpb.Duti errCh <- nil }() - nextEpochDuties, err := c.getDutiesForEpoch(ctx, in.Epoch+1, vals, fetchSyncDuties) + nextEpochDuties, err := c.dutiesForEpoch(ctx, in.Epoch+1, vals, fetchSyncDuties) if err != nil { return nil, errors.Wrapf(err, "failed to get duties for next epoch `%d`", in.Epoch+1) } @@ -76,7 +76,7 @@ func (c *beaconApiValidatorClient) getDuties(ctx context.Context, in *ethpb.Duti }, nil } -func (c *beaconApiValidatorClient) getDutiesForEpoch( +func (c *beaconApiValidatorClient) dutiesForEpoch( ctx context.Context, epoch primitives.Epoch, vals []validatorForDuty, diff --git a/validator/client/beacon-api/duties_test.go b/validator/client/beacon-api/duties_test.go index e29aab292ab2..8d8139f939d4 100644 --- a/validator/client/beacon-api/duties_test.go +++ b/validator/client/beacon-api/duties_test.go @@ -726,7 +726,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) { } validatorClient := &beaconApiValidatorClient{dutiesProvider: dutiesProvider} - _, err := validatorClient.getDutiesForEpoch( + _, err := validatorClient.dutiesForEpoch( ctx, epoch, vals, @@ -951,7 +951,7 @@ func TestGetDutiesForEpoch_Valid(t *testing.T) { status: ethpb.ValidatorStatus_ACTIVE, } } - duties, err := validatorClient.getDutiesForEpoch( + duties, err := validatorClient.dutiesForEpoch( ctx, epoch, vals, @@ -1187,13 +1187,13 @@ func TestGetDuties_Valid(t *testing.T) { nil, ).MinTimes(1) - // Make sure that our values are equal to what would be returned by calling getDutiesForEpoch individually + // Make sure that our values are equal to what would be returned by calling dutiesForEpoch individually validatorClient := &beaconApiValidatorClient{ dutiesProvider: dutiesProvider, stateValidatorsProvider: stateValidatorsProvider, } - expectedCurrentEpochDuties, err := validatorClient.getDutiesForEpoch( + expectedCurrentEpochDuties, err := validatorClient.dutiesForEpoch( ctx, testCase.epoch, vals, @@ -1201,7 +1201,7 @@ func TestGetDuties_Valid(t *testing.T) { ) require.NoError(t, err) - expectedNextEpochDuties, err := validatorClient.getDutiesForEpoch( + expectedNextEpochDuties, err := validatorClient.dutiesForEpoch( ctx, testCase.epoch+1, vals, @@ -1214,7 +1214,7 @@ func TestGetDuties_Valid(t *testing.T) { NextEpochDuties: expectedNextEpochDuties, } - duties, err := validatorClient.getDuties(ctx, ðpb.DutiesRequest{ + duties, err := validatorClient.duties(ctx, ðpb.DutiesRequest{ Epoch: testCase.epoch, PublicKeys: append(pubkeys, []byte("0xunknown")), }) @@ -1246,7 +1246,7 @@ func TestGetDuties_GetStateValidatorsFailed(t *testing.T) { stateValidatorsProvider: stateValidatorsProvider, } - _, err := validatorClient.getDuties(ctx, ðpb.DutiesRequest{ + _, err := validatorClient.duties(ctx, ðpb.DutiesRequest{ Epoch: 1, PublicKeys: [][]byte{}, }) @@ -1308,7 +1308,7 @@ func TestGetDuties_GetDutiesForEpochFailed(t *testing.T) { dutiesProvider: dutiesProvider, } - _, err := validatorClient.getDuties(ctx, ðpb.DutiesRequest{ + _, err := validatorClient.duties(ctx, ðpb.DutiesRequest{ Epoch: 1, PublicKeys: [][]byte{pubkey}, }) @@ -1456,7 +1456,7 @@ func generateValidSyncDuties(pubkeys [][]byte, validatorIndices []primitives.Val } } -// We will use a reverse function to easily make sure that the current epoch and next epoch data returned by getDutiesForEpoch +// We will use a reverse function to easily make sure that the current epoch and next epoch data returned by dutiesForEpoch // are not the same func reverseSlice[T interface{}](slice []T) []T { reversedSlice := make([]T, len(slice)) From d21d203027410cbc9a6ac43aafdf8480affe018b Mon Sep 17 00:00:00 2001 From: rkapka Date: Thu, 30 May 2024 13:47:44 +0900 Subject: [PATCH 8/9] more functions --- validator/accounts/testing/mock.go | 2 +- validator/client/aggregate.go | 2 +- validator/client/attest.go | 6 +- validator/client/attest_test.go | 2 +- validator/client/beacon-api/activation.go | 2 +- .../client/beacon-api/attestation_data.go | 2 +- .../beacon-api/attestation_data_test.go | 6 +- .../beacon_api_beacon_chain_client.go | 12 +-- .../beacon_api_beacon_chain_client_test.go | 14 ++-- .../client/beacon-api/beacon_api_helpers.go | 12 +-- .../beacon-api/beacon_api_helpers_test.go | 12 +-- .../beacon-api/beacon_api_node_client.go | 2 +- .../beacon-api/beacon_api_node_client_test.go | 2 +- .../beacon-api/beacon_api_validator_client.go | 16 ++-- .../beacon_api_validator_client_test.go | 10 +-- .../beacon-api/beacon_committee_selections.go | 2 +- validator/client/beacon-api/domain_data.go | 4 +- .../client/beacon-api/domain_data_test.go | 12 +-- validator/client/beacon-api/doppelganger.go | 14 ++-- .../client/beacon-api/doppelganger_test.go | 6 +- validator/client/beacon-api/duties.go | 30 +++---- validator/client/beacon-api/duties_test.go | 76 +++++++++--------- validator/client/beacon-api/genesis.go | 8 +- validator/client/beacon-api/genesis_test.go | 12 +-- .../client/beacon-api/get_beacon_block.go | 2 +- .../beacon-api/get_beacon_block_test.go | 24 +++--- validator/client/beacon-api/index.go | 2 +- .../client/beacon-api/mock/duties_mock.go | 48 ++++++------ .../client/beacon-api/mock/genesis_mock.go | 12 +-- .../beacon-api/mock/state_validators_mock.go | 36 ++++----- .../client/beacon-api/state_validators.go | 12 +-- .../beacon-api/state_validators_test.go | 10 +-- validator/client/beacon-api/status.go | 8 +- validator/client/beacon-api/status_test.go | 20 ++--- validator/client/beacon-api/stream_blocks.go | 6 +- .../submit_aggregate_selection_proof.go | 6 +- validator/client/beacon-api/sync_committee.go | 10 +-- .../beacon-api/sync_committee_selections.go | 2 +- .../client/beacon-api/sync_committee_test.go | 6 +- validator/client/service.go | 2 +- validator/client/validator.go | 8 +- validator/client/validator_test.go | 78 +++++++++---------- validator/rpc/handlers_keymanager.go | 2 +- 43 files changed, 280 insertions(+), 280 deletions(-) diff --git a/validator/accounts/testing/mock.go b/validator/accounts/testing/mock.go index 01647b99e559..2f1e3d0a9836 100644 --- a/validator/accounts/testing/mock.go +++ b/validator/accounts/testing/mock.go @@ -217,7 +217,7 @@ func (m *Validator) SetProposerSettings(_ context.Context, settings *proposer.Se return nil } -// GetGraffiti for mocking +// Graffiti for mocking func (m *Validator) Graffiti(_ context.Context, _ [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { return []byte(m.graffiti), nil } diff --git a/validator/client/aggregate.go b/validator/client/aggregate.go index 5cfd40fdf1b3..237acc3c7a11 100644 --- a/validator/client/aggregate.go +++ b/validator/client/aggregate.go @@ -55,7 +55,7 @@ func (v *validator) SubmitAggregateAndProof(ctx context.Context, slot primitives var slotSig []byte if v.distributed { - slotSig, err = v.getAttSelection(attSelectionKey{slot: slot, index: duty.ValidatorIndex}) + slotSig, err = v.attSelection(attSelectionKey{slot: slot, index: duty.ValidatorIndex}) if err != nil { log.WithError(err).Error("Could not find aggregated selection proof") if v.emitAccountMetrics { diff --git a/validator/client/attest.go b/validator/client/attest.go index d5ace95f004a..80ee813a42e3 100644 --- a/validator/client/attest.go +++ b/validator/client/attest.go @@ -90,7 +90,7 @@ func (v *validator) SubmitAttestation(ctx context.Context, slot primitives.Slot, Data: data, } - _, signingRoot, err := v.getDomainAndSigningRoot(ctx, indexedAtt.Data) + _, signingRoot, err := v.domainAndSigningRoot(ctx, indexedAtt.Data) if err != nil { log.WithError(err).Error("Could not get domain and signing root from attestation") if v.emitAccountMetrics { @@ -199,7 +199,7 @@ func (v *validator) duty(pubKey [fieldparams.BLSPubkeyLength]byte) (*ethpb.Dutie // Given validator's public key, this function returns the signature of an attestation data and its signing root. func (v *validator) signAtt(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte, data *ethpb.AttestationData, slot primitives.Slot) ([]byte, [32]byte, error) { - domain, root, err := v.getDomainAndSigningRoot(ctx, data) + domain, root, err := v.domainAndSigningRoot(ctx, data) if err != nil { return nil, [32]byte{}, err } @@ -217,7 +217,7 @@ func (v *validator) signAtt(ctx context.Context, pubKey [fieldparams.BLSPubkeyLe return sig.Marshal(), root, nil } -func (v *validator) getDomainAndSigningRoot(ctx context.Context, data *ethpb.AttestationData) (*ethpb.DomainResponse, [32]byte, error) { +func (v *validator) domainAndSigningRoot(ctx context.Context, data *ethpb.AttestationData) (*ethpb.DomainResponse, [32]byte, error) { domain, err := v.domainData(ctx, data.Target.Epoch, params.BeaconConfig().DomainBeaconAttester[:]) if err != nil { return nil, [32]byte{}, err diff --git a/validator/client/attest_test.go b/validator/client/attest_test.go index 8f7307a7ffc7..2ecab88bc167 100644 --- a/validator/client/attest_test.go +++ b/validator/client/attest_test.go @@ -643,7 +643,7 @@ func Test_slashableAttestationCheck_UpdatesLowestSignedEpochs(t *testing.T) { gomock.Any(), // ctx ðpb.DomainRequest{Epoch: 10, Domain: []byte{1, 0, 0, 0}}, ).Return(ðpb.DomainResponse{SignatureDomain: make([]byte, 32)}, nil /*err*/) - _, sr, err := validator.getDomainAndSigningRoot(ctx, att.Data) + _, sr, err := validator.domainAndSigningRoot(ctx, att.Data) require.NoError(t, err) err = validator.db.SlashableAttestationCheck(context.Background(), att, pubKey, sr, false, nil) diff --git a/validator/client/beacon-api/activation.go b/validator/client/beacon-api/activation.go index 5a3251cbed21..9e26ebbf734b 100644 --- a/validator/client/beacon-api/activation.go +++ b/validator/client/beacon-api/activation.go @@ -68,7 +68,7 @@ func (c *waitForActivationClient) Recv() (*ethpb.ValidatorActivationResponse, er stringTargetPubKeys[index] = stringPubKey } - stateValidators, err := c.stateValidatorsProvider.GetStateValidators(c.ctx, stringTargetPubKeys, nil, nil) + stateValidators, err := c.stateValidatorsProvider.StateValidators(c.ctx, stringTargetPubKeys, nil, nil) if err != nil { return nil, errors.Wrap(err, "failed to get state validators") } diff --git a/validator/client/beacon-api/attestation_data.go b/validator/client/beacon-api/attestation_data.go index 066244564208..084b785a392e 100644 --- a/validator/client/beacon-api/attestation_data.go +++ b/validator/client/beacon-api/attestation_data.go @@ -12,7 +12,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (c *beaconApiValidatorClient) getAttestationData( +func (c *beaconApiValidatorClient) attestationData( ctx context.Context, reqSlot primitives.Slot, reqCommitteeIndex primitives.CommitteeIndex, diff --git a/validator/client/beacon-api/attestation_data_test.go b/validator/client/beacon-api/attestation_data_test.go index ef3e212da501..d87ae4d6ecad 100644 --- a/validator/client/beacon-api/attestation_data_test.go +++ b/validator/client/beacon-api/attestation_data_test.go @@ -58,7 +58,7 @@ func TestGetAttestationData_ValidAttestation(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - resp, err := validatorClient.getAttestationData(ctx, primitives.Slot(expectedSlot), primitives.CommitteeIndex(expectedCommitteeIndex)) + resp, err := validatorClient.attestationData(ctx, primitives.Slot(expectedSlot), primitives.CommitteeIndex(expectedCommitteeIndex)) assert.NoError(t, err) require.NotNil(t, resp) @@ -194,7 +194,7 @@ func TestGetAttestationData_InvalidData(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - _, err := validatorClient.getAttestationData(ctx, 1, 2) + _, err := validatorClient.attestationData(ctx, 1, 2) assert.ErrorContains(t, testCase.expectedErrorMessage, err) }) } @@ -220,7 +220,7 @@ func TestGetAttestationData_JsonResponseError(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - _, err := validatorClient.getAttestationData(ctx, slot, committeeIndex) + _, err := validatorClient.attestationData(ctx, slot, committeeIndex) assert.ErrorContains(t, "some specific json response error", err) } diff --git a/validator/client/beacon-api/beacon_api_beacon_chain_client.go b/validator/client/beacon-api/beacon_api_beacon_chain_client.go index 231969522b79..0b8c7f2073ac 100644 --- a/validator/client/beacon-api/beacon_api_beacon_chain_client.go +++ b/validator/client/beacon-api/beacon_api_beacon_chain_client.go @@ -25,7 +25,7 @@ type beaconApiChainClient struct { const getValidatorPerformanceEndpoint = "/prysm/validators/performance" -func (c beaconApiChainClient) getHeadBlockHeaders(ctx context.Context) (*structs.GetBlockHeaderResponse, error) { +func (c beaconApiChainClient) headBlockHeaders(ctx context.Context) (*structs.GetBlockHeaderResponse, error) { blockHeader := structs.GetBlockHeaderResponse{} err := c.jsonRestHandler.Get(ctx, "/eth/v1/beacon/headers/head", &blockHeader) if err != nil { @@ -112,7 +112,7 @@ func (c beaconApiChainClient) ChainHead(ctx context.Context, _ *empty.Empty) (*e return nil, errors.Wrapf(err, "failed to decode previous justified checkpoint root `%s`", finalityCheckpoints.Data.PreviousJustified.Root) } - blockHeader, err := c.getHeadBlockHeaders(ctx) + blockHeader, err := c.headBlockHeaders(ctx) if err != nil { return nil, errors.Wrap(err, "failed to get head block headers") } @@ -191,21 +191,21 @@ func (c beaconApiChainClient) Validators(ctx context.Context, in *ethpb.ListVali if err != nil { return nil, errors.Wrapf(err, "failed to get first slot for epoch `%d`", queryFilter.Epoch) } - if stateValidators, err = c.stateValidatorsProvider.GetStateValidatorsForSlot(ctx, slot, pubkeys, in.Indices, statuses); err != nil { + if stateValidators, err = c.stateValidatorsProvider.StateValidatorsForSlot(ctx, slot, pubkeys, in.Indices, statuses); err != nil { return nil, errors.Wrapf(err, "failed to get state validators for slot `%d`", slot) } epoch = slots.ToEpoch(slot) case *ethpb.ListValidatorsRequest_Genesis: - if stateValidators, err = c.stateValidatorsProvider.GetStateValidatorsForSlot(ctx, 0, pubkeys, in.Indices, statuses); err != nil { + if stateValidators, err = c.stateValidatorsProvider.StateValidatorsForSlot(ctx, 0, pubkeys, in.Indices, statuses); err != nil { return nil, errors.Wrapf(err, "failed to get genesis state validators") } epoch = 0 case nil: - if stateValidators, err = c.stateValidatorsProvider.GetStateValidatorsForHead(ctx, pubkeys, in.Indices, statuses); err != nil { + if stateValidators, err = c.stateValidatorsProvider.StateValidatorsForHead(ctx, pubkeys, in.Indices, statuses); err != nil { return nil, errors.Wrap(err, "failed to get head state validators") } - blockHeader, err := c.getHeadBlockHeaders(ctx) + blockHeader, err := c.headBlockHeaders(ctx) if err != nil { return nil, errors.Wrap(err, "failed to get head block headers") } diff --git a/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go b/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go index 29579b826a73..b31b309eed0a 100644 --- a/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go +++ b/validator/client/beacon-api/beacon_api_beacon_chain_client_test.go @@ -58,7 +58,7 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( nil, errors.New("foo error"), ) @@ -78,7 +78,7 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( nil, errors.New("bar error"), ) @@ -96,7 +96,7 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return( nil, errors.New("foo error"), ) @@ -114,7 +114,7 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return( nil, nil, ) @@ -187,7 +187,7 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForHead(ctx, gomock.Any(), gomock.Any(), gomock.Any()).Return( nil, nil, ) @@ -328,7 +328,7 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForSlot(ctx, gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return( testCase.generateStateValidatorsResponse(), nil, ) @@ -556,7 +556,7 @@ func TestListValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidatorsForSlot(ctx, primitives.Slot(0), make([]string, 0), []primitives.ValidatorIndex{}, nil).Return( + stateValidatorsProvider.EXPECT().StateValidatorsForSlot(ctx, primitives.Slot(0), make([]string, 0), []primitives.ValidatorIndex{}, nil).Return( testCase.generateJsonStateValidatorsResponse(), nil, ) diff --git a/validator/client/beacon-api/beacon_api_helpers.go b/validator/client/beacon-api/beacon_api_helpers.go index 34908e1aa97c..a931e4d96905 100644 --- a/validator/client/beacon-api/beacon_api_helpers.go +++ b/validator/client/beacon-api/beacon_api_helpers.go @@ -48,7 +48,7 @@ func buildURL(path string, queryParams ...neturl.Values) string { return fmt.Sprintf("%s?%s", path, queryParams[0].Encode()) } -func (c *beaconApiValidatorClient) getFork(ctx context.Context) (*structs.GetStateForkResponse, error) { +func (c *beaconApiValidatorClient) fork(ctx context.Context) (*structs.GetStateForkResponse, error) { const endpoint = "/eth/v1/beacon/states/head/fork" stateForkResponseJson := &structs.GetStateForkResponse{} @@ -60,7 +60,7 @@ func (c *beaconApiValidatorClient) getFork(ctx context.Context) (*structs.GetSta return stateForkResponseJson, nil } -func (c *beaconApiValidatorClient) getHeaders(ctx context.Context) (*structs.GetBlockHeadersResponse, error) { +func (c *beaconApiValidatorClient) headers(ctx context.Context) (*structs.GetBlockHeadersResponse, error) { const endpoint = "/eth/v1/beacon/headers" blockHeadersResponseJson := &structs.GetBlockHeadersResponse{} @@ -72,7 +72,7 @@ func (c *beaconApiValidatorClient) getHeaders(ctx context.Context) (*structs.Get return blockHeadersResponseJson, nil } -func (c *beaconApiValidatorClient) getLiveness(ctx context.Context, epoch primitives.Epoch, validatorIndexes []string) (*structs.GetLivenessResponse, error) { +func (c *beaconApiValidatorClient) liveness(ctx context.Context, epoch primitives.Epoch, validatorIndexes []string) (*structs.GetLivenessResponse, error) { const endpoint = "/eth/v1/validator/liveness/" url := endpoint + strconv.FormatUint(uint64(epoch), 10) @@ -90,7 +90,7 @@ func (c *beaconApiValidatorClient) getLiveness(ctx context.Context, epoch primit return livenessResponseJson, nil } -func (c *beaconApiValidatorClient) getSyncing(ctx context.Context) (*structs.SyncStatusResponse, error) { +func (c *beaconApiValidatorClient) syncing(ctx context.Context) (*structs.SyncStatusResponse, error) { const endpoint = "/eth/v1/node/syncing" syncingResponseJson := &structs.SyncStatusResponse{} @@ -103,7 +103,7 @@ func (c *beaconApiValidatorClient) getSyncing(ctx context.Context) (*structs.Syn } func (c *beaconApiValidatorClient) isSyncing(ctx context.Context) (bool, error) { - response, err := c.getSyncing(ctx) + response, err := c.syncing(ctx) if err != nil || response == nil || response.Data == nil { return true, errors.Wrapf(err, "failed to get syncing status") } @@ -112,7 +112,7 @@ func (c *beaconApiValidatorClient) isSyncing(ctx context.Context) (bool, error) } func (c *beaconApiValidatorClient) isOptimistic(ctx context.Context) (bool, error) { - response, err := c.getSyncing(ctx) + response, err := c.syncing(ctx) if err != nil || response == nil || response.Data == nil { return true, errors.Wrapf(err, "failed to get syncing status") } diff --git a/validator/client/beacon-api/beacon_api_helpers_test.go b/validator/client/beacon-api/beacon_api_helpers_test.go index 9e00ec909b7d..e42d9da2ee60 100644 --- a/validator/client/beacon-api/beacon_api_helpers_test.go +++ b/validator/client/beacon-api/beacon_api_helpers_test.go @@ -123,7 +123,7 @@ func TestGetFork_Nominal(t *testing.T) { jsonRestHandler: jsonRestHandler, } - fork, err := validatorClient.getFork(ctx) + fork, err := validatorClient.fork(ctx) require.NoError(t, err) assert.DeepEqual(t, &expected, fork) } @@ -148,7 +148,7 @@ func TestGetFork_Invalid(t *testing.T) { jsonRestHandler: jsonRestHandler, } - _, err := validatorClient.getFork(ctx) + _, err := validatorClient.fork(ctx) require.ErrorContains(t, "custom error", err) } @@ -190,7 +190,7 @@ func TestGetHeaders_Nominal(t *testing.T) { jsonRestHandler: jsonRestHandler, } - headers, err := validatorClient.getHeaders(ctx) + headers, err := validatorClient.headers(ctx) require.NoError(t, err) assert.DeepEqual(t, &expected, headers) } @@ -215,7 +215,7 @@ func TestGetHeaders_Invalid(t *testing.T) { jsonRestHandler: jsonRestHandler, } - _, err := validatorClient.getHeaders(ctx) + _, err := validatorClient.headers(ctx) require.ErrorContains(t, "custom error", err) } @@ -261,7 +261,7 @@ func TestGetLiveness_Nominal(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - liveness, err := validatorClient.getLiveness(ctx, 42, indexes) + liveness, err := validatorClient.liveness(ctx, 42, indexes) require.NoError(t, err) assert.DeepEqual(t, &expected, liveness) @@ -285,7 +285,7 @@ func TestGetLiveness_Invalid(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - _, err := validatorClient.getLiveness(ctx, 42, nil) + _, err := validatorClient.liveness(ctx, 42, nil) require.ErrorContains(t, "custom error", err) } diff --git a/validator/client/beacon-api/beacon_api_node_client.go b/validator/client/beacon-api/beacon_api_node_client.go index 101e6da7f930..5b094a2e7bd2 100644 --- a/validator/client/beacon-api/beacon_api_node_client.go +++ b/validator/client/beacon-api/beacon_api_node_client.go @@ -41,7 +41,7 @@ func (c *beaconApiNodeClient) SyncStatus(ctx context.Context, _ *empty.Empty) (* } func (c *beaconApiNodeClient) Genesis(ctx context.Context, _ *empty.Empty) (*ethpb.Genesis, error) { - genesisJson, err := c.genesisProvider.GetGenesis(ctx) + genesisJson, err := c.genesisProvider.Genesis(ctx) if err != nil { return nil, errors.Wrap(err, "failed to get genesis") } diff --git a/validator/client/beacon-api/beacon_api_node_client_test.go b/validator/client/beacon-api/beacon_api_node_client_test.go index 7d564dc53cec..09ef15d31440 100644 --- a/validator/client/beacon-api/beacon_api_node_client_test.go +++ b/validator/client/beacon-api/beacon_api_node_client_test.go @@ -112,7 +112,7 @@ func TestGetGenesis(t *testing.T) { ctx := context.Background() genesisProvider := mock.NewMockGenesisProvider(ctrl) - genesisProvider.EXPECT().GetGenesis( + genesisProvider.EXPECT().Genesis( ctx, ).Return( testCase.genesisResponse, diff --git a/validator/client/beacon-api/beacon_api_validator_client.go b/validator/client/beacon-api/beacon_api_validator_client.go index 3e422db9492f..617832d30c55 100644 --- a/validator/client/beacon-api/beacon_api_validator_client.go +++ b/validator/client/beacon-api/beacon_api_validator_client.go @@ -65,19 +65,19 @@ func (c *beaconApiValidatorClient) DomainData(ctx context.Context, in *ethpb.Dom domainType := bytesutil.ToBytes4(in.Domain) return wrapInMetrics[*ethpb.DomainResponse]("DomainData", func() (*ethpb.DomainResponse, error) { - return c.getDomainData(ctx, in.Epoch, domainType) + return c.domainData(ctx, in.Epoch, domainType) }) } func (c *beaconApiValidatorClient) AttestationData(ctx context.Context, in *ethpb.AttestationDataRequest) (*ethpb.AttestationData, error) { return wrapInMetrics[*ethpb.AttestationData]("AttestationData", func() (*ethpb.AttestationData, error) { - return c.getAttestationData(ctx, in.Slot, in.CommitteeIndex) + return c.attestationData(ctx, in.Slot, in.CommitteeIndex) }) } func (c *beaconApiValidatorClient) BeaconBlock(ctx context.Context, in *ethpb.BlockRequest) (*ethpb.GenericBeaconBlock, error) { return wrapInMetrics[*ethpb.GenericBeaconBlock]("BeaconBlock", func() (*ethpb.GenericBeaconBlock, error) { - return c.getBeaconBlock(ctx, in.Slot, in.RandaoReveal, in.Graffiti) + return c.beaconBlock(ctx, in.Slot, in.RandaoReveal, in.Graffiti) }) } @@ -87,19 +87,19 @@ func (c *beaconApiValidatorClient) FeeRecipientByPubKey(_ context.Context, _ *et func (c *beaconApiValidatorClient) SyncCommitteeContribution(ctx context.Context, in *ethpb.SyncCommitteeContributionRequest) (*ethpb.SyncCommitteeContribution, error) { return wrapInMetrics[*ethpb.SyncCommitteeContribution]("SyncCommitteeContribution", func() (*ethpb.SyncCommitteeContribution, error) { - return c.getSyncCommitteeContribution(ctx, in) + return c.syncCommitteeContribution(ctx, in) }) } func (c *beaconApiValidatorClient) SyncMessageBlockRoot(ctx context.Context, _ *empty.Empty) (*ethpb.SyncMessageBlockRootResponse, error) { return wrapInMetrics[*ethpb.SyncMessageBlockRootResponse]("SyncMessageBlockRoot", func() (*ethpb.SyncMessageBlockRootResponse, error) { - return c.getSyncMessageBlockRoot(ctx) + return c.syncMessageBlockRoot(ctx) }) } func (c *beaconApiValidatorClient) SyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) { return wrapInMetrics[*ethpb.SyncSubcommitteeIndexResponse]("SyncSubcommitteeIndex", func() (*ethpb.SyncSubcommitteeIndexResponse, error) { - return c.getSyncSubcommitteeIndex(ctx, in) + return c.syncSubcommitteeIndex(ctx, in) }) } @@ -212,11 +212,11 @@ func (c *beaconApiValidatorClient) EventStreamIsRunning() bool { } func (c *beaconApiValidatorClient) AggregatedSelections(ctx context.Context, selections []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { - return c.getAggregatedSelection(ctx, selections) + return c.aggregatedSelection(ctx, selections) } func (c *beaconApiValidatorClient) AggregatedSyncSelections(ctx context.Context, selections []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { - return c.getAggregatedSyncSelections(ctx, selections) + return c.aggregatedSyncSelections(ctx, selections) } func wrapInMetrics[Resp any](action string, f func() (Resp, error)) (Resp, error) { diff --git a/validator/client/beacon-api/beacon_api_validator_client_test.go b/validator/client/beacon-api/beacon_api_validator_client_test.go index e14ba4e31dc7..19f00977adb8 100644 --- a/validator/client/beacon-api/beacon_api_validator_client_test.go +++ b/validator/client/beacon-api/beacon_api_validator_client_test.go @@ -19,7 +19,7 @@ import ( "github.com/prysmaticlabs/prysm/v5/validator/client/beacon-api/mock" ) -// Make sure that AttestationData() returns the same thing as the internal getAttestationData() +// Make sure that AttestationData() returns the same thing as the internal attestationData() func TestBeaconApiValidatorClient_GetAttestationDataValid(t *testing.T) { const slot = primitives.Slot(1) const committeeIndex = primitives.CommitteeIndex(2) @@ -43,7 +43,7 @@ func TestBeaconApiValidatorClient_GetAttestationDataValid(t *testing.T) { ).Times(2) validatorClient := beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - expectedResp, expectedErr := validatorClient.getAttestationData(ctx, slot, committeeIndex) + expectedResp, expectedErr := validatorClient.attestationData(ctx, slot, committeeIndex) resp, err := validatorClient.AttestationData( context.Background(), @@ -77,7 +77,7 @@ func TestBeaconApiValidatorClient_GetAttestationDataError(t *testing.T) { ).Times(2) validatorClient := beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - expectedResp, expectedErr := validatorClient.getAttestationData(ctx, slot, committeeIndex) + expectedResp, expectedErr := validatorClient.attestationData(ctx, slot, committeeIndex) resp, err := validatorClient.AttestationData( context.Background(), @@ -109,7 +109,7 @@ func TestBeaconApiValidatorClient_DomainDataValid(t *testing.T) { ctx := context.Background() genesisProvider := mock.NewMockGenesisProvider(ctrl) - genesisProvider.EXPECT().GetGenesis(ctx).Return( + genesisProvider.EXPECT().Genesis(ctx).Return( &structs.Genesis{GenesisValidatorsRoot: genesisValidatorRoot}, nil, ).Times(2) @@ -118,7 +118,7 @@ func TestBeaconApiValidatorClient_DomainDataValid(t *testing.T) { resp, err := validatorClient.DomainData(context.Background(), ðpb.DomainRequest{Epoch: epoch, Domain: domainType}) domainTypeArray := bytesutil.ToBytes4(domainType) - expectedResp, expectedErr := validatorClient.getDomainData(ctx, epoch, domainTypeArray) + expectedResp, expectedErr := validatorClient.domainData(ctx, epoch, domainTypeArray) assert.DeepEqual(t, expectedErr, err) assert.DeepEqual(t, expectedResp, resp) } diff --git a/validator/client/beacon-api/beacon_committee_selections.go b/validator/client/beacon-api/beacon_committee_selections.go index e57e7b98828f..304b2a7abfe4 100644 --- a/validator/client/beacon-api/beacon_committee_selections.go +++ b/validator/client/beacon-api/beacon_committee_selections.go @@ -14,7 +14,7 @@ type aggregatedSelectionResponse struct { Data []iface.BeaconCommitteeSelection `json:"data"` } -func (c *beaconApiValidatorClient) getAggregatedSelection(ctx context.Context, selections []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { +func (c *beaconApiValidatorClient) aggregatedSelection(ctx context.Context, selections []iface.BeaconCommitteeSelection) ([]iface.BeaconCommitteeSelection, error) { body, err := json.Marshal(selections) if err != nil { return nil, errors.Wrap(err, "failed to marshal selections") diff --git a/validator/client/beacon-api/domain_data.go b/validator/client/beacon-api/domain_data.go index bbc2d6605669..1956a2daf457 100644 --- a/validator/client/beacon-api/domain_data.go +++ b/validator/client/beacon-api/domain_data.go @@ -11,7 +11,7 @@ import ( ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1" ) -func (c *beaconApiValidatorClient) getDomainData(ctx context.Context, epoch primitives.Epoch, domainType [4]byte) (*ethpb.DomainResponse, error) { +func (c *beaconApiValidatorClient) domainData(ctx context.Context, epoch primitives.Epoch, domainType [4]byte) (*ethpb.DomainResponse, error) { // Get the fork version from the given epoch fork, err := forks.Fork(epoch) if err != nil { @@ -19,7 +19,7 @@ func (c *beaconApiValidatorClient) getDomainData(ctx context.Context, epoch prim } // Get the genesis validator root - genesis, err := c.genesisProvider.GetGenesis(ctx) + genesis, err := c.genesisProvider.Genesis(ctx) if err != nil { return nil, errors.Wrapf(err, "failed to get genesis info") } diff --git a/validator/client/beacon-api/domain_data_test.go b/validator/client/beacon-api/domain_data_test.go index 651eb399b516..9ac14ea2447f 100644 --- a/validator/client/beacon-api/domain_data_test.go +++ b/validator/client/beacon-api/domain_data_test.go @@ -37,13 +37,13 @@ func TestGetDomainData_ValidDomainData(t *testing.T) { // Make sure that Genesis() is called exactly once genesisProvider := mock.NewMockGenesisProvider(ctrl) - genesisProvider.EXPECT().GetGenesis(ctx).Return( + genesisProvider.EXPECT().Genesis(ctx).Return( &structs.Genesis{GenesisValidatorsRoot: genesisValidatorRoot}, nil, ).Times(1) validatorClient := &beaconApiValidatorClient{genesisProvider: genesisProvider} - resp, err := validatorClient.getDomainData(ctx, epoch, domainType) + resp, err := validatorClient.domainData(ctx, epoch, domainType) assert.NoError(t, err) require.NotNil(t, resp) @@ -66,10 +66,10 @@ func TestGetDomainData_GenesisError(t *testing.T) { // Make sure that Genesis() is called exactly once genesisProvider := mock.NewMockGenesisProvider(ctrl) - genesisProvider.EXPECT().GetGenesis(ctx).Return(nil, errors.New("foo error")).Times(1) + genesisProvider.EXPECT().Genesis(ctx).Return(nil, errors.New("foo error")).Times(1) validatorClient := &beaconApiValidatorClient{genesisProvider: genesisProvider} - _, err := validatorClient.getDomainData(ctx, epoch, domainType) + _, err := validatorClient.domainData(ctx, epoch, domainType) assert.ErrorContains(t, "failed to get genesis info", err) assert.ErrorContains(t, "foo error", err) } @@ -85,12 +85,12 @@ func TestGetDomainData_InvalidGenesisRoot(t *testing.T) { // Make sure that Genesis() is called exactly once genesisProvider := mock.NewMockGenesisProvider(ctrl) - genesisProvider.EXPECT().GetGenesis(ctx).Return( + genesisProvider.EXPECT().Genesis(ctx).Return( &structs.Genesis{GenesisValidatorsRoot: "foo"}, nil, ).Times(1) validatorClient := &beaconApiValidatorClient{genesisProvider: genesisProvider} - _, err := validatorClient.getDomainData(ctx, epoch, domainType) + _, err := validatorClient.domainData(ctx, epoch, domainType) assert.ErrorContains(t, "invalid genesis validators root: foo", err) } diff --git a/validator/client/beacon-api/doppelganger.go b/validator/client/beacon-api/doppelganger.go index 1025319b9c4b..3b9c52c4ca80 100644 --- a/validator/client/beacon-api/doppelganger.go +++ b/validator/client/beacon-api/doppelganger.go @@ -73,7 +73,7 @@ func (c *beaconApiValidatorClient) checkDoppelGanger(ctx context.Context, in *et } // Retrieve fork version -- Return early if we are in phase0. - forkResponse, err := c.getFork(ctx) + forkResponse, err := c.fork(ctx) if err != nil || forkResponse == nil || forkResponse.Data == nil { return nil, errors.Wrapf(err, "failed to get fork") } @@ -91,7 +91,7 @@ func (c *beaconApiValidatorClient) checkDoppelGanger(ctx context.Context, in *et } // Retrieve current epoch. - headers, err := c.getHeaders(ctx) + headers, err := c.headers(ctx) if err != nil || headers == nil || headers.Data == nil || len(headers.Data) == 0 || headers.Data[0].Header == nil || headers.Data[0].Header.Message == nil { return nil, errors.Wrapf(err, "failed to get headers") @@ -127,7 +127,7 @@ func (c *beaconApiValidatorClient) checkDoppelGanger(ctx context.Context, in *et } // Retrieve correspondence between validator pubkey and index. - stateValidators, err := c.stateValidatorsProvider.GetStateValidators(ctx, notRecentStringPubKeys, nil, nil) + stateValidators, err := c.stateValidatorsProvider.StateValidators(ctx, notRecentStringPubKeys, nil, nil) if err != nil || stateValidators == nil || stateValidators.Data == nil { return nil, errors.Wrapf(err, "failed to get state validators") } @@ -156,13 +156,13 @@ func (c *beaconApiValidatorClient) checkDoppelGanger(ctx context.Context, in *et // since we assume that we are not in phase0. previousEpoch := currentEpoch - 1 - indexToPreviousLiveness, err := c.getIndexToLiveness(ctx, previousEpoch, indexes) + indexToPreviousLiveness, err := c.indexToLiveness(ctx, previousEpoch, indexes) if err != nil { return nil, errors.Wrapf(err, "failed to get map from validator index to liveness for previous epoch %d", previousEpoch) } // Get validators liveness for the current epoch. - indexToCurrentLiveness, err := c.getIndexToLiveness(ctx, currentEpoch, indexes) + indexToCurrentLiveness, err := c.indexToLiveness(ctx, currentEpoch, indexes) if err != nil { return nil, errors.Wrapf(err, "failed to get map from validator index to liveness for current epoch %d", currentEpoch) } @@ -218,8 +218,8 @@ func buildResponse( } } -func (c *beaconApiValidatorClient) getIndexToLiveness(ctx context.Context, epoch primitives.Epoch, indexes []string) (map[string]bool, error) { - livenessResponse, err := c.getLiveness(ctx, epoch, indexes) +func (c *beaconApiValidatorClient) indexToLiveness(ctx context.Context, epoch primitives.Epoch, indexes []string) (map[string]bool, error) { + livenessResponse, err := c.liveness(ctx, epoch, indexes) if err != nil || livenessResponse.Data == nil { return nil, errors.Wrapf(err, fmt.Sprintf("failed to get liveness for epoch %d", epoch)) } diff --git a/validator/client/beacon-api/doppelganger_test.go b/validator/client/beacon-api/doppelganger_test.go index a8e4e0df32a7..bce18ae1ade6 100644 --- a/validator/client/beacon-api/doppelganger_test.go +++ b/validator/client/beacon-api/doppelganger_test.go @@ -363,7 +363,7 @@ func TestCheckDoppelGanger_Nominal(t *testing.T) { stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) if testCase.getStateValidatorsInterface != nil { - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, testCase.getStateValidatorsInterface.input, nil, @@ -489,7 +489,7 @@ func TestCheckDoppelGanger_Errors(t *testing.T) { }, }, { - name: "getFork on error", + name: "fork on error", expectedErrorMessage: "failed to get fork", inputValidatorRequests: standardInputValidatorRequests, getSyncingOutput: standardGetSyncingOutput, @@ -777,7 +777,7 @@ func TestCheckDoppelGanger_Errors(t *testing.T) { stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) if testCase.getStateValidatorsInterface != nil { - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, testCase.getStateValidatorsInterface.input, nil, diff --git a/validator/client/beacon-api/duties.go b/validator/client/beacon-api/duties.go index 8ae3243c923f..2cc26fdc20c5 100644 --- a/validator/client/beacon-api/duties.go +++ b/validator/client/beacon-api/duties.go @@ -19,10 +19,10 @@ import ( ) type dutiesProvider interface { - GetAttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.AttesterDuty, error) - GetProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*structs.ProposerDuty, error) - GetSyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.SyncCommitteeDuty, error) - GetCommittees(ctx context.Context, epoch primitives.Epoch) ([]*structs.Committee, error) + AttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.AttesterDuty, error) + ProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*structs.ProposerDuty, error) + SyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.SyncCommitteeDuty, error) + Committees(ctx context.Context, epoch primitives.Epoch) ([]*structs.Committee, error) } type beaconApiDutiesProvider struct { @@ -41,7 +41,7 @@ type validatorForDuty struct { } func (c *beaconApiValidatorClient) duties(ctx context.Context, in *ethpb.DutiesRequest) (*ethpb.DutiesResponse, error) { - vals, err := c.getValidatorsForDuties(ctx, in.PublicKeys) + vals, err := c.validatorsForDuties(ctx, in.PublicKeys) if err != nil { return nil, errors.Wrap(err, "failed to get validators for duties") } @@ -103,7 +103,7 @@ func (c *beaconApiValidatorClient) dutiesForEpoch( var wg errgroup.Group wg.Go(func() error { - attesterDuties, err := c.dutiesProvider.GetAttesterDuties(ctx, epoch, indices) + attesterDuties, err := c.dutiesProvider.AttesterDuties(ctx, epoch, indices) if err != nil { return errors.Wrapf(err, "failed to get attester duties for epoch `%d`", epoch) } @@ -131,7 +131,7 @@ func (c *beaconApiValidatorClient) dutiesForEpoch( if fetchSyncDuties { wg.Go(func() error { - syncDuties, err := c.dutiesProvider.GetSyncDuties(ctx, epoch, indices) + syncDuties, err := c.dutiesProvider.SyncDuties(ctx, epoch, indices) if err != nil { return errors.Wrapf(err, "failed to get sync duties for epoch `%d`", epoch) } @@ -148,7 +148,7 @@ func (c *beaconApiValidatorClient) dutiesForEpoch( } wg.Go(func() error { - proposerDuties, err := c.dutiesProvider.GetProposerDuties(ctx, epoch) + proposerDuties, err := c.dutiesProvider.ProposerDuties(ctx, epoch) if err != nil { return errors.Wrapf(err, "failed to get proposer duties for epoch `%d`", epoch) } @@ -168,7 +168,7 @@ func (c *beaconApiValidatorClient) dutiesForEpoch( return nil }) - committees, err := c.dutiesProvider.GetCommittees(ctx, epoch) + committees, err := c.dutiesProvider.Committees(ctx, epoch) if err != nil { return nil, errors.Wrapf(err, "failed to get committees for epoch `%d`", epoch) } @@ -242,7 +242,7 @@ func (c *beaconApiValidatorClient) dutiesForEpoch( return duties, nil } -func (c *beaconApiValidatorClient) getValidatorsForDuties(ctx context.Context, pubkeys [][]byte) ([]validatorForDuty, error) { +func (c *beaconApiValidatorClient) validatorsForDuties(ctx context.Context, pubkeys [][]byte) ([]validatorForDuty, error) { vals := make([]validatorForDuty, 0, len(pubkeys)) stringPubkeysToPubkeys := make(map[string][]byte, len(pubkeys)) stringPubkeys := make([]string, len(pubkeys)) @@ -254,7 +254,7 @@ func (c *beaconApiValidatorClient) getValidatorsForDuties(ctx context.Context, p } statusesWithDuties := []string{validator.ActiveOngoing.String(), validator.ActiveExiting.String()} - stateValidatorsResponse, err := c.stateValidatorsProvider.GetStateValidators(ctx, stringPubkeys, nil, statusesWithDuties) + stateValidatorsResponse, err := c.stateValidatorsProvider.StateValidators(ctx, stringPubkeys, nil, statusesWithDuties) if err != nil { return nil, errors.Wrap(err, "failed to get state validators") } @@ -288,7 +288,7 @@ func (c *beaconApiValidatorClient) getValidatorsForDuties(ctx context.Context, p } // GetCommittees retrieves the committees for the given epoch -func (c beaconApiDutiesProvider) GetCommittees(ctx context.Context, epoch primitives.Epoch) ([]*structs.Committee, error) { +func (c beaconApiDutiesProvider) Committees(ctx context.Context, epoch primitives.Epoch) ([]*structs.Committee, error) { committeeParams := url.Values{} committeeParams.Add("epoch", strconv.FormatUint(uint64(epoch), 10)) committeesRequest := buildURL("/eth/v1/beacon/states/head/committees", committeeParams) @@ -312,7 +312,7 @@ func (c beaconApiDutiesProvider) GetCommittees(ctx context.Context, epoch primit } // GetAttesterDuties retrieves the attester duties for the given epoch and validatorIndices -func (c beaconApiDutiesProvider) GetAttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.AttesterDuty, error) { +func (c beaconApiDutiesProvider) AttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.AttesterDuty, error) { jsonValidatorIndices := make([]string, len(validatorIndices)) for index, validatorIndex := range validatorIndices { jsonValidatorIndices[index] = strconv.FormatUint(uint64(validatorIndex), 10) @@ -344,7 +344,7 @@ func (c beaconApiDutiesProvider) GetAttesterDuties(ctx context.Context, epoch pr } // GetProposerDuties retrieves the proposer duties for the given epoch -func (c beaconApiDutiesProvider) GetProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*structs.ProposerDuty, error) { +func (c beaconApiDutiesProvider) ProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*structs.ProposerDuty, error) { proposerDuties := structs.GetProposerDutiesResponse{} if err := c.jsonRestHandler.Get(ctx, fmt.Sprintf("/eth/v1/validator/duties/proposer/%d", epoch), &proposerDuties); err != nil { return nil, err @@ -364,7 +364,7 @@ func (c beaconApiDutiesProvider) GetProposerDuties(ctx context.Context, epoch pr } // GetSyncDuties retrieves the sync committee duties for the given epoch and validatorIndices -func (c beaconApiDutiesProvider) GetSyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.SyncCommitteeDuty, error) { +func (c beaconApiDutiesProvider) SyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.SyncCommitteeDuty, error) { jsonValidatorIndices := make([]string, len(validatorIndices)) for index, validatorIndex := range validatorIndices { jsonValidatorIndices[index] = strconv.FormatUint(uint64(validatorIndex), 10) diff --git a/validator/client/beacon-api/duties_test.go b/validator/client/beacon-api/duties_test.go index 8d8139f939d4..1c12539eca0c 100644 --- a/validator/client/beacon-api/duties_test.go +++ b/validator/client/beacon-api/duties_test.go @@ -76,7 +76,7 @@ func TestGetAttesterDuties_Valid(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - attesterDuties, err := dutiesProvider.GetAttesterDuties(ctx, epoch, validatorIndices) + attesterDuties, err := dutiesProvider.AttesterDuties(ctx, epoch, validatorIndices) require.NoError(t, err) assert.DeepEqual(t, expectedAttesterDuties.Data, attesterDuties) } @@ -101,7 +101,7 @@ func TestGetAttesterDuties_HttpError(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetAttesterDuties(ctx, epoch, nil) + _, err := dutiesProvider.AttesterDuties(ctx, epoch, nil) assert.ErrorContains(t, "foo error", err) } @@ -130,7 +130,7 @@ func TestGetAttesterDuties_NilAttesterDuty(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetAttesterDuties(ctx, epoch, nil) + _, err := dutiesProvider.AttesterDuties(ctx, epoch, nil) assert.ErrorContains(t, "attester duty at index `0` is nil", err) } @@ -170,7 +170,7 @@ func TestGetProposerDuties_Valid(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - proposerDuties, err := dutiesProvider.GetProposerDuties(ctx, epoch) + proposerDuties, err := dutiesProvider.ProposerDuties(ctx, epoch) require.NoError(t, err) assert.DeepEqual(t, expectedProposerDuties.Data, proposerDuties) } @@ -193,7 +193,7 @@ func TestGetProposerDuties_HttpError(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetProposerDuties(ctx, epoch) + _, err := dutiesProvider.ProposerDuties(ctx, epoch) assert.ErrorContains(t, "foo error", err) } @@ -220,7 +220,7 @@ func TestGetProposerDuties_NilData(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetProposerDuties(ctx, epoch) + _, err := dutiesProvider.ProposerDuties(ctx, epoch) assert.ErrorContains(t, "proposer duties data is nil", err) } @@ -247,7 +247,7 @@ func TestGetProposerDuties_NilProposerDuty(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetProposerDuties(ctx, epoch) + _, err := dutiesProvider.ProposerDuties(ctx, epoch) assert.ErrorContains(t, "proposer duty at index `0` is nil", err) } @@ -300,7 +300,7 @@ func TestGetSyncDuties_Valid(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - syncDuties, err := dutiesProvider.GetSyncDuties(ctx, epoch, validatorIndices) + syncDuties, err := dutiesProvider.SyncDuties(ctx, epoch, validatorIndices) require.NoError(t, err) assert.DeepEqual(t, expectedSyncDuties.Data, syncDuties) } @@ -325,7 +325,7 @@ func TestGetSyncDuties_HttpError(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetSyncDuties(ctx, epoch, nil) + _, err := dutiesProvider.SyncDuties(ctx, epoch, nil) assert.ErrorContains(t, "foo error", err) } @@ -354,7 +354,7 @@ func TestGetSyncDuties_NilData(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetSyncDuties(ctx, epoch, nil) + _, err := dutiesProvider.SyncDuties(ctx, epoch, nil) assert.ErrorContains(t, "sync duties data is nil", err) } @@ -383,7 +383,7 @@ func TestGetSyncDuties_NilSyncDuty(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetSyncDuties(ctx, epoch, nil) + _, err := dutiesProvider.SyncDuties(ctx, epoch, nil) assert.ErrorContains(t, "sync duty at index `0` is nil", err) } @@ -429,7 +429,7 @@ func TestGetCommittees_Valid(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - committees, err := dutiesProvider.GetCommittees(ctx, epoch) + committees, err := dutiesProvider.Committees(ctx, epoch) require.NoError(t, err) assert.DeepEqual(t, expectedCommittees.Data, committees) } @@ -452,7 +452,7 @@ func TestGetCommittees_HttpError(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetCommittees(ctx, epoch) + _, err := dutiesProvider.Committees(ctx, epoch) assert.ErrorContains(t, "foo error", err) } @@ -479,7 +479,7 @@ func TestGetCommittees_NilData(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetCommittees(ctx, epoch) + _, err := dutiesProvider.Committees(ctx, epoch) assert.ErrorContains(t, "state committees data is nil", err) } @@ -506,7 +506,7 @@ func TestGetCommittees_NilCommittee(t *testing.T) { ).Times(1) dutiesProvider := &beaconApiDutiesProvider{jsonRestHandler: jsonRestHandler} - _, err := dutiesProvider.GetCommittees(ctx, epoch) + _, err := dutiesProvider.Committees(ctx, epoch) assert.ErrorContains(t, "committee at index `0` is nil", err) } @@ -682,7 +682,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) { } dutiesProvider := mock.NewMockdutiesProvider(ctrl) - dutiesProvider.EXPECT().GetAttesterDuties( + dutiesProvider.EXPECT().AttesterDuties( ctx, epoch, gomock.Any(), @@ -691,7 +691,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) { testCase.fetchAttesterDutiesError, ).AnyTimes() - dutiesProvider.EXPECT().GetProposerDuties( + dutiesProvider.EXPECT().ProposerDuties( ctx, epoch, ).Return( @@ -699,7 +699,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) { testCase.fetchProposerDutiesError, ).AnyTimes() - dutiesProvider.EXPECT().GetSyncDuties( + dutiesProvider.EXPECT().SyncDuties( ctx, epoch, gomock.Any(), @@ -708,7 +708,7 @@ func TestGetDutiesForEpoch_Error(t *testing.T) { testCase.fetchSyncDutiesError, ).AnyTimes() - dutiesProvider.EXPECT().GetCommittees( + dutiesProvider.EXPECT().Committees( ctx, epoch, ).Return( @@ -767,7 +767,7 @@ func TestGetDutiesForEpoch_Valid(t *testing.T) { ctx := context.Background() dutiesProvider := mock.NewMockdutiesProvider(ctrl) - dutiesProvider.EXPECT().GetCommittees( + dutiesProvider.EXPECT().Committees( ctx, epoch, ).Return( @@ -775,7 +775,7 @@ func TestGetDutiesForEpoch_Valid(t *testing.T) { nil, ).Times(1) - dutiesProvider.EXPECT().GetAttesterDuties( + dutiesProvider.EXPECT().AttesterDuties( ctx, epoch, validatorIndices, @@ -784,7 +784,7 @@ func TestGetDutiesForEpoch_Valid(t *testing.T) { nil, ).Times(1) - dutiesProvider.EXPECT().GetProposerDuties( + dutiesProvider.EXPECT().ProposerDuties( ctx, epoch, ).Return( @@ -793,7 +793,7 @@ func TestGetDutiesForEpoch_Valid(t *testing.T) { ).Times(1) if testCase.fetchSyncDuties { - dutiesProvider.EXPECT().GetSyncDuties( + dutiesProvider.EXPECT().SyncDuties( ctx, epoch, validatorIndices, @@ -1004,7 +1004,7 @@ func TestGetDuties_Valid(t *testing.T) { ctx := context.Background() dutiesProvider := mock.NewMockdutiesProvider(ctrl) - dutiesProvider.EXPECT().GetCommittees( + dutiesProvider.EXPECT().Committees( ctx, testCase.epoch, ).Return( @@ -1012,7 +1012,7 @@ func TestGetDuties_Valid(t *testing.T) { nil, ).Times(2) - dutiesProvider.EXPECT().GetAttesterDuties( + dutiesProvider.EXPECT().AttesterDuties( ctx, testCase.epoch, validatorIndices, @@ -1021,7 +1021,7 @@ func TestGetDuties_Valid(t *testing.T) { nil, ).Times(2) - dutiesProvider.EXPECT().GetProposerDuties( + dutiesProvider.EXPECT().ProposerDuties( ctx, testCase.epoch, ).Return( @@ -1031,7 +1031,7 @@ func TestGetDuties_Valid(t *testing.T) { fetchSyncDuties := testCase.epoch >= params.BeaconConfig().AltairForkEpoch if fetchSyncDuties { - dutiesProvider.EXPECT().GetSyncDuties( + dutiesProvider.EXPECT().SyncDuties( ctx, testCase.epoch, validatorIndices, @@ -1041,7 +1041,7 @@ func TestGetDuties_Valid(t *testing.T) { ).Times(2) } - dutiesProvider.EXPECT().GetCommittees( + dutiesProvider.EXPECT().Committees( ctx, testCase.epoch+1, ).Return( @@ -1049,7 +1049,7 @@ func TestGetDuties_Valid(t *testing.T) { nil, ).Times(2) - dutiesProvider.EXPECT().GetAttesterDuties( + dutiesProvider.EXPECT().AttesterDuties( ctx, testCase.epoch+1, validatorIndices, @@ -1058,7 +1058,7 @@ func TestGetDuties_Valid(t *testing.T) { nil, ).Times(2) - dutiesProvider.EXPECT().GetProposerDuties( + dutiesProvider.EXPECT().ProposerDuties( ctx, testCase.epoch+1, ).Return( @@ -1067,7 +1067,7 @@ func TestGetDuties_Valid(t *testing.T) { ).Times(2) if fetchSyncDuties { - dutiesProvider.EXPECT().GetSyncDuties( + dutiesProvider.EXPECT().SyncDuties( ctx, testCase.epoch+1, validatorIndices, @@ -1078,7 +1078,7 @@ func TestGetDuties_Valid(t *testing.T) { } stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, gomock.Any(), gomock.Any(), @@ -1232,7 +1232,7 @@ func TestGetDuties_GetStateValidatorsFailed(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, gomock.Any(), gomock.Any(), @@ -1262,7 +1262,7 @@ func TestGetDuties_GetDutiesForEpochFailed(t *testing.T) { pubkey := []byte{1, 2, 3} stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, gomock.Any(), gomock.Any(), @@ -1281,7 +1281,7 @@ func TestGetDuties_GetDutiesForEpochFailed(t *testing.T) { ).Times(1) dutiesProvider := mock.NewMockdutiesProvider(ctrl) - dutiesProvider.EXPECT().GetAttesterDuties( + dutiesProvider.EXPECT().AttesterDuties( ctx, primitives.Epoch(1), gomock.Any(), @@ -1289,16 +1289,16 @@ func TestGetDuties_GetDutiesForEpochFailed(t *testing.T) { nil, errors.New("foo error"), ).Times(1) - dutiesProvider.EXPECT().GetAttesterDuties( + dutiesProvider.EXPECT().AttesterDuties( ctx, primitives.Epoch(2), gomock.Any(), ).Times(1) - dutiesProvider.EXPECT().GetProposerDuties( + dutiesProvider.EXPECT().ProposerDuties( ctx, gomock.Any(), ).Times(2) - dutiesProvider.EXPECT().GetCommittees( + dutiesProvider.EXPECT().Committees( ctx, gomock.Any(), ).Times(2) diff --git a/validator/client/beacon-api/genesis.go b/validator/client/beacon-api/genesis.go index 061aec437d66..3b020f88d456 100644 --- a/validator/client/beacon-api/genesis.go +++ b/validator/client/beacon-api/genesis.go @@ -15,7 +15,7 @@ import ( ) type GenesisProvider interface { - GetGenesis(ctx context.Context) (*structs.Genesis, error) + Genesis(ctx context.Context) (*structs.Genesis, error) } type beaconApiGenesisProvider struct { @@ -25,7 +25,7 @@ type beaconApiGenesisProvider struct { } func (c *beaconApiValidatorClient) waitForChainStart(ctx context.Context) (*ethpb.ChainStartResponse, error) { - genesis, err := c.genesisProvider.GetGenesis(ctx) + genesis, err := c.genesisProvider.Genesis(ctx) for err != nil { jsonErr := &httputil.DefaultJsonError{} @@ -37,7 +37,7 @@ func (c *beaconApiValidatorClient) waitForChainStart(ctx context.Context) (*ethp // Error 404 means that the chain genesis info is not yet known, so we query it every second until it's ready select { case <-time.After(time.Second): - genesis, err = c.genesisProvider.GetGenesis(ctx) + genesis, err = c.genesisProvider.Genesis(ctx) case <-ctx.Done(): return nil, errors.New("context canceled") } @@ -67,7 +67,7 @@ func (c *beaconApiValidatorClient) waitForChainStart(ctx context.Context) (*ethp } // GetGenesis gets the genesis information from the beacon node via the /eth/v1/beacon/genesis endpoint -func (c *beaconApiGenesisProvider) GetGenesis(ctx context.Context) (*structs.Genesis, error) { +func (c *beaconApiGenesisProvider) Genesis(ctx context.Context) (*structs.Genesis, error) { genesisJson := &structs.GetGenesisResponse{} var doErr error c.once.Do(func() { diff --git a/validator/client/beacon-api/genesis_test.go b/validator/client/beacon-api/genesis_test.go index 1835068dde5d..b225078e1e62 100644 --- a/validator/client/beacon-api/genesis_test.go +++ b/validator/client/beacon-api/genesis_test.go @@ -37,7 +37,7 @@ func TestGetGenesis_ValidGenesis(t *testing.T) { ).Times(1) genesisProvider := &beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler} - resp, err := genesisProvider.GetGenesis(ctx) + resp, err := genesisProvider.Genesis(ctx) assert.NoError(t, err) require.NotNil(t, resp) assert.Equal(t, "1234", resp.GenesisTime) @@ -64,7 +64,7 @@ func TestGetGenesis_NilData(t *testing.T) { ).Times(1) genesisProvider := &beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler} - _, err := genesisProvider.GetGenesis(ctx) + _, err := genesisProvider.Genesis(ctx) assert.ErrorContains(t, "genesis data is nil", err) } @@ -93,9 +93,9 @@ func TestGetGenesis_EndpointCalledOnlyOnce(t *testing.T) { ).Times(1) genesisProvider := &beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler} - _, err := genesisProvider.GetGenesis(ctx) + _, err := genesisProvider.Genesis(ctx) assert.NoError(t, err) - resp, err := genesisProvider.GetGenesis(ctx) + resp, err := genesisProvider.Genesis(ctx) assert.NoError(t, err) require.NotNil(t, resp) assert.Equal(t, "1234", resp.GenesisTime) @@ -134,9 +134,9 @@ func TestGetGenesis_EndpointCanBeCalledAgainAfterError(t *testing.T) { ).Times(1) genesisProvider := &beaconApiGenesisProvider{jsonRestHandler: jsonRestHandler} - _, err := genesisProvider.GetGenesis(ctx) + _, err := genesisProvider.Genesis(ctx) require.ErrorContains(t, "foo", err) - resp, err := genesisProvider.GetGenesis(ctx) + resp, err := genesisProvider.Genesis(ctx) assert.NoError(t, err) require.NotNil(t, resp) assert.Equal(t, "1234", resp.GenesisTime) diff --git a/validator/client/beacon-api/get_beacon_block.go b/validator/client/beacon-api/get_beacon_block.go index f1a967da9864..5fcced2a5ff5 100644 --- a/validator/client/beacon-api/get_beacon_block.go +++ b/validator/client/beacon-api/get_beacon_block.go @@ -22,7 +22,7 @@ type abstractProduceBlockResponseJson struct { Data json.RawMessage `json:"data"` } -func (c *beaconApiValidatorClient) getBeaconBlock(ctx context.Context, slot primitives.Slot, randaoReveal []byte, graffiti []byte) (*ethpb.GenericBeaconBlock, error) { +func (c *beaconApiValidatorClient) beaconBlock(ctx context.Context, slot primitives.Slot, randaoReveal []byte, graffiti []byte) (*ethpb.GenericBeaconBlock, error) { queryParams := neturl.Values{} queryParams.Add("randao_reveal", hexutil.Encode(randaoReveal)) if len(graffiti) > 0 { diff --git a/validator/client/beacon-api/get_beacon_block_test.go b/validator/client/beacon-api/get_beacon_block_test.go index 0ee4a58253aa..0df3f410c05e 100644 --- a/validator/client/beacon-api/get_beacon_block_test.go +++ b/validator/client/beacon-api/get_beacon_block_test.go @@ -36,7 +36,7 @@ func TestGetBeaconBlock_RequestFailed(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - _, err := validatorClient.getBeaconBlock(ctx, 1, []byte{1}, []byte{2}) + _, err := validatorClient.beaconBlock(ctx, 1, []byte{1}, []byte{2}) assert.ErrorContains(t, "foo error", err) } @@ -139,7 +139,7 @@ func TestGetBeaconBlock_Error(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - _, err := validatorClient.getBeaconBlock(ctx, 1, []byte{1}, []byte{2}) + _, err := validatorClient.beaconBlock(ctx, 1, []byte{1}, []byte{2}) assert.ErrorContains(t, testCase.expectedErrorMessage, err) }) } @@ -175,7 +175,7 @@ func TestGetBeaconBlock_Phase0Valid(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ @@ -218,7 +218,7 @@ func TestGetBeaconBlock_AltairValid(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ @@ -262,7 +262,7 @@ func TestGetBeaconBlock_BellatrixValid(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ @@ -307,7 +307,7 @@ func TestGetBeaconBlock_BlindedBellatrixValid(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ @@ -352,7 +352,7 @@ func TestGetBeaconBlock_CapellaValid(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ @@ -397,7 +397,7 @@ func TestGetBeaconBlock_BlindedCapellaValid(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ @@ -442,7 +442,7 @@ func TestGetBeaconBlock_DenebValid(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ @@ -487,7 +487,7 @@ func TestGetBeaconBlock_BlindedDenebValid(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ @@ -538,7 +538,7 @@ func TestGetBeaconBlock_FallbackToBlindedBlock(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ @@ -596,7 +596,7 @@ func TestGetBeaconBlock_FallbackToFullBlock(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - beaconBlock, err := validatorClient.getBeaconBlock(ctx, slot, randaoReveal, graffiti) + beaconBlock, err := validatorClient.beaconBlock(ctx, slot, randaoReveal, graffiti) require.NoError(t, err) expectedBeaconBlock := ðpb.GenericBeaconBlock{ diff --git a/validator/client/beacon-api/index.go b/validator/client/beacon-api/index.go index a32d4f3361d9..3449c54fdcd3 100644 --- a/validator/client/beacon-api/index.go +++ b/validator/client/beacon-api/index.go @@ -31,7 +31,7 @@ func (e *IndexNotFoundError) Error() string { func (c *beaconApiValidatorClient) validatorIndex(ctx context.Context, in *ethpb.ValidatorIndexRequest) (*ethpb.ValidatorIndexResponse, error) { stringPubKey := hexutil.Encode(in.PublicKey) - stateValidator, err := c.stateValidatorsProvider.GetStateValidators(ctx, []string{stringPubKey}, nil, nil) + stateValidator, err := c.stateValidatorsProvider.StateValidators(ctx, []string{stringPubKey}, nil, nil) if err != nil { return nil, errors.Wrap(err, "failed to get state validator") } diff --git a/validator/client/beacon-api/mock/duties_mock.go b/validator/client/beacon-api/mock/duties_mock.go index b9527e0a04c0..4d7eda11e841 100644 --- a/validator/client/beacon-api/mock/duties_mock.go +++ b/validator/client/beacon-api/mock/duties_mock.go @@ -41,62 +41,62 @@ func (m *MockdutiesProvider) EXPECT() *MockdutiesProviderMockRecorder { return m.recorder } -// GetAttesterDuties mocks base method. -func (m *MockdutiesProvider) GetAttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.AttesterDuty, error) { +// AttesterDuties mocks base method. +func (m *MockdutiesProvider) AttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.AttesterDuty, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAttesterDuties", ctx, epoch, validatorIndices) + ret := m.ctrl.Call(m, "AttesterDuties", ctx, epoch, validatorIndices) ret0, _ := ret[0].([]*structs.AttesterDuty) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetAttesterDuties indicates an expected call of GetAttesterDuties. -func (mr *MockdutiesProviderMockRecorder) GetAttesterDuties(ctx, epoch, validatorIndices any) *gomock.Call { +// AttesterDuties indicates an expected call of AttesterDuties. +func (mr *MockdutiesProviderMockRecorder) AttesterDuties(ctx, epoch, validatorIndices any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAttesterDuties", reflect.TypeOf((*MockdutiesProvider)(nil).GetAttesterDuties), ctx, epoch, validatorIndices) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AttesterDuties", reflect.TypeOf((*MockdutiesProvider)(nil).AttesterDuties), ctx, epoch, validatorIndices) } -// GetCommittees mocks base method. -func (m *MockdutiesProvider) GetCommittees(ctx context.Context, epoch primitives.Epoch) ([]*structs.Committee, error) { +// Committees mocks base method. +func (m *MockdutiesProvider) Committees(ctx context.Context, epoch primitives.Epoch) ([]*structs.Committee, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetCommittees", ctx, epoch) + ret := m.ctrl.Call(m, "Committees", ctx, epoch) ret0, _ := ret[0].([]*structs.Committee) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetCommittees indicates an expected call of GetCommittees. -func (mr *MockdutiesProviderMockRecorder) GetCommittees(ctx, epoch any) *gomock.Call { +// Committees indicates an expected call of Committees. +func (mr *MockdutiesProviderMockRecorder) Committees(ctx, epoch any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCommittees", reflect.TypeOf((*MockdutiesProvider)(nil).GetCommittees), ctx, epoch) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Committees", reflect.TypeOf((*MockdutiesProvider)(nil).Committees), ctx, epoch) } -// GetProposerDuties mocks base method. -func (m *MockdutiesProvider) GetProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*structs.ProposerDuty, error) { +// ProposerDuties mocks base method. +func (m *MockdutiesProvider) ProposerDuties(ctx context.Context, epoch primitives.Epoch) ([]*structs.ProposerDuty, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetProposerDuties", ctx, epoch) + ret := m.ctrl.Call(m, "ProposerDuties", ctx, epoch) ret0, _ := ret[0].([]*structs.ProposerDuty) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetProposerDuties indicates an expected call of GetProposerDuties. -func (mr *MockdutiesProviderMockRecorder) GetProposerDuties(ctx, epoch any) *gomock.Call { +// ProposerDuties indicates an expected call of ProposerDuties. +func (mr *MockdutiesProviderMockRecorder) ProposerDuties(ctx, epoch any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProposerDuties", reflect.TypeOf((*MockdutiesProvider)(nil).GetProposerDuties), ctx, epoch) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ProposerDuties", reflect.TypeOf((*MockdutiesProvider)(nil).ProposerDuties), ctx, epoch) } -// GetSyncDuties mocks base method. -func (m *MockdutiesProvider) GetSyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.SyncCommitteeDuty, error) { +// SyncDuties mocks base method. +func (m *MockdutiesProvider) SyncDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*structs.SyncCommitteeDuty, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetSyncDuties", ctx, epoch, validatorIndices) + ret := m.ctrl.Call(m, "SyncDuties", ctx, epoch, validatorIndices) ret0, _ := ret[0].([]*structs.SyncCommitteeDuty) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetSyncDuties indicates an expected call of GetSyncDuties. -func (mr *MockdutiesProviderMockRecorder) GetSyncDuties(ctx, epoch, validatorIndices any) *gomock.Call { +// SyncDuties indicates an expected call of SyncDuties. +func (mr *MockdutiesProviderMockRecorder) SyncDuties(ctx, epoch, validatorIndices any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSyncDuties", reflect.TypeOf((*MockdutiesProvider)(nil).GetSyncDuties), ctx, epoch, validatorIndices) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SyncDuties", reflect.TypeOf((*MockdutiesProvider)(nil).SyncDuties), ctx, epoch, validatorIndices) } diff --git a/validator/client/beacon-api/mock/genesis_mock.go b/validator/client/beacon-api/mock/genesis_mock.go index dd8e35e36eed..afb90b09b85d 100644 --- a/validator/client/beacon-api/mock/genesis_mock.go +++ b/validator/client/beacon-api/mock/genesis_mock.go @@ -40,17 +40,17 @@ func (m *MockGenesisProvider) EXPECT() *MockGenesisProviderMockRecorder { return m.recorder } -// GetGenesis mocks base method. -func (m *MockGenesisProvider) GetGenesis(ctx context.Context) (*structs.Genesis, error) { +// Genesis mocks base method. +func (m *MockGenesisProvider) Genesis(ctx context.Context) (*structs.Genesis, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetGenesis", ctx) + ret := m.ctrl.Call(m, "Genesis", ctx) ret0, _ := ret[0].(*structs.Genesis) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetGenesis indicates an expected call of GetGenesis. -func (mr *MockGenesisProviderMockRecorder) GetGenesis(ctx any) *gomock.Call { +// Genesis indicates an expected call of Genesis. +func (mr *MockGenesisProviderMockRecorder) Genesis(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetGenesis", reflect.TypeOf((*MockGenesisProvider)(nil).GetGenesis), ctx) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Genesis", reflect.TypeOf((*MockGenesisProvider)(nil).Genesis), ctx) } diff --git a/validator/client/beacon-api/mock/state_validators_mock.go b/validator/client/beacon-api/mock/state_validators_mock.go index 5b9850bbe018..9807b5686241 100644 --- a/validator/client/beacon-api/mock/state_validators_mock.go +++ b/validator/client/beacon-api/mock/state_validators_mock.go @@ -41,47 +41,47 @@ func (m *MockStateValidatorsProvider) EXPECT() *MockStateValidatorsProviderMockR return m.recorder } -// GetStateValidators mocks base method. -func (m *MockStateValidatorsProvider) GetStateValidators(arg0 context.Context, arg1 []string, arg2 []primitives.ValidatorIndex, arg3 []string) (*structs.GetValidatorsResponse, error) { +// StateValidators mocks base method. +func (m *MockStateValidatorsProvider) StateValidators(arg0 context.Context, arg1 []string, arg2 []primitives.ValidatorIndex, arg3 []string) (*structs.GetValidatorsResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetStateValidators", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "StateValidators", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(*structs.GetValidatorsResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetStateValidators indicates an expected call of GetStateValidators. -func (mr *MockStateValidatorsProviderMockRecorder) GetStateValidators(arg0, arg1, arg2, arg3 any) *gomock.Call { +// StateValidators indicates an expected call of StateValidators. +func (mr *MockStateValidatorsProviderMockRecorder) StateValidators(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStateValidators", reflect.TypeOf((*MockStateValidatorsProvider)(nil).GetStateValidators), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateValidators", reflect.TypeOf((*MockStateValidatorsProvider)(nil).StateValidators), arg0, arg1, arg2, arg3) } -// GetStateValidatorsForHead mocks base method. -func (m *MockStateValidatorsProvider) GetStateValidatorsForHead(arg0 context.Context, arg1 []string, arg2 []primitives.ValidatorIndex, arg3 []string) (*structs.GetValidatorsResponse, error) { +// StateValidatorsForHead mocks base method. +func (m *MockStateValidatorsProvider) StateValidatorsForHead(arg0 context.Context, arg1 []string, arg2 []primitives.ValidatorIndex, arg3 []string) (*structs.GetValidatorsResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetStateValidatorsForHead", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "StateValidatorsForHead", arg0, arg1, arg2, arg3) ret0, _ := ret[0].(*structs.GetValidatorsResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetStateValidatorsForHead indicates an expected call of GetStateValidatorsForHead. -func (mr *MockStateValidatorsProviderMockRecorder) GetStateValidatorsForHead(arg0, arg1, arg2, arg3 any) *gomock.Call { +// StateValidatorsForHead indicates an expected call of StateValidatorsForHead. +func (mr *MockStateValidatorsProviderMockRecorder) StateValidatorsForHead(arg0, arg1, arg2, arg3 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStateValidatorsForHead", reflect.TypeOf((*MockStateValidatorsProvider)(nil).GetStateValidatorsForHead), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateValidatorsForHead", reflect.TypeOf((*MockStateValidatorsProvider)(nil).StateValidatorsForHead), arg0, arg1, arg2, arg3) } -// GetStateValidatorsForSlot mocks base method. -func (m *MockStateValidatorsProvider) GetStateValidatorsForSlot(arg0 context.Context, arg1 primitives.Slot, arg2 []string, arg3 []primitives.ValidatorIndex, arg4 []string) (*structs.GetValidatorsResponse, error) { +// StateValidatorsForSlot mocks base method. +func (m *MockStateValidatorsProvider) StateValidatorsForSlot(arg0 context.Context, arg1 primitives.Slot, arg2 []string, arg3 []primitives.ValidatorIndex, arg4 []string) (*structs.GetValidatorsResponse, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetStateValidatorsForSlot", arg0, arg1, arg2, arg3, arg4) + ret := m.ctrl.Call(m, "StateValidatorsForSlot", arg0, arg1, arg2, arg3, arg4) ret0, _ := ret[0].(*structs.GetValidatorsResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetStateValidatorsForSlot indicates an expected call of GetStateValidatorsForSlot. -func (mr *MockStateValidatorsProviderMockRecorder) GetStateValidatorsForSlot(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { +// StateValidatorsForSlot indicates an expected call of StateValidatorsForSlot. +func (mr *MockStateValidatorsProviderMockRecorder) StateValidatorsForSlot(arg0, arg1, arg2, arg3, arg4 any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetStateValidatorsForSlot", reflect.TypeOf((*MockStateValidatorsProvider)(nil).GetStateValidatorsForSlot), arg0, arg1, arg2, arg3, arg4) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StateValidatorsForSlot", reflect.TypeOf((*MockStateValidatorsProvider)(nil).StateValidatorsForSlot), arg0, arg1, arg2, arg3, arg4) } diff --git a/validator/client/beacon-api/state_validators.go b/validator/client/beacon-api/state_validators.go index f183b31348df..8ae11b28dff4 100644 --- a/validator/client/beacon-api/state_validators.go +++ b/validator/client/beacon-api/state_validators.go @@ -14,16 +14,16 @@ import ( ) type StateValidatorsProvider interface { - GetStateValidators(context.Context, []string, []primitives.ValidatorIndex, []string) (*structs.GetValidatorsResponse, error) - GetStateValidatorsForSlot(context.Context, primitives.Slot, []string, []primitives.ValidatorIndex, []string) (*structs.GetValidatorsResponse, error) - GetStateValidatorsForHead(context.Context, []string, []primitives.ValidatorIndex, []string) (*structs.GetValidatorsResponse, error) + StateValidators(context.Context, []string, []primitives.ValidatorIndex, []string) (*structs.GetValidatorsResponse, error) + StateValidatorsForSlot(context.Context, primitives.Slot, []string, []primitives.ValidatorIndex, []string) (*structs.GetValidatorsResponse, error) + StateValidatorsForHead(context.Context, []string, []primitives.ValidatorIndex, []string) (*structs.GetValidatorsResponse, error) } type beaconApiStateValidatorsProvider struct { jsonRestHandler JsonRestHandler } -func (c beaconApiStateValidatorsProvider) GetStateValidators( +func (c beaconApiStateValidatorsProvider) StateValidators( ctx context.Context, stringPubkeys []string, indexes []primitives.ValidatorIndex, @@ -33,7 +33,7 @@ func (c beaconApiStateValidatorsProvider) GetStateValidators( return c.getStateValidatorsHelper(ctx, "/eth/v1/beacon/states/head/validators", append(stringIndices, stringPubkeys...), statuses) } -func (c beaconApiStateValidatorsProvider) GetStateValidatorsForSlot( +func (c beaconApiStateValidatorsProvider) StateValidatorsForSlot( ctx context.Context, slot primitives.Slot, stringPubkeys []string, @@ -44,7 +44,7 @@ func (c beaconApiStateValidatorsProvider) GetStateValidatorsForSlot( return c.getStateValidatorsHelper(ctx, fmt.Sprintf("/eth/v1/beacon/states/%d/validators", slot), append(stringIndices, stringPubkeys...), statuses) } -func (c beaconApiStateValidatorsProvider) GetStateValidatorsForHead( +func (c beaconApiStateValidatorsProvider) StateValidatorsForHead( ctx context.Context, stringPubkeys []string, indices []primitives.ValidatorIndex, diff --git a/validator/client/beacon-api/state_validators_test.go b/validator/client/beacon-api/state_validators_test.go index c5d223716c44..78c648a49d33 100644 --- a/validator/client/beacon-api/state_validators_test.go +++ b/validator/client/beacon-api/state_validators_test.go @@ -85,7 +85,7 @@ func TestGetStateValidators_Nominal_POST(t *testing.T) { ).Times(1) stateValidatorsProvider := beaconApiStateValidatorsProvider{jsonRestHandler: jsonRestHandler} - actual, err := stateValidatorsProvider.GetStateValidators(ctx, []string{ + actual, err := stateValidatorsProvider.StateValidators(ctx, []string{ "0x8000091c2ae64ee414a54c1cc1fc67dec663408bc636cb86756e0200e41a75c8f86603f104f02c856983d2783116be13", // active_ongoing "0x80000e851c0f53c3246ff726d7ff7766661ca5e12a07c45c114d208d54f0f8233d4380b2e9aff759d69795d1df905526", // active_exiting "0x424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242", // does not exist @@ -191,7 +191,7 @@ func TestGetStateValidators_Nominal_GET(t *testing.T) { ).Times(1) stateValidatorsProvider := beaconApiStateValidatorsProvider{jsonRestHandler: jsonRestHandler} - actual, err := stateValidatorsProvider.GetStateValidators(ctx, []string{ + actual, err := stateValidatorsProvider.StateValidators(ctx, []string{ "0x8000091c2ae64ee414a54c1cc1fc67dec663408bc636cb86756e0200e41a75c8f86603f104f02c856983d2783116be13", // active_ongoing "0x80000e851c0f53c3246ff726d7ff7766661ca5e12a07c45c114d208d54f0f8233d4380b2e9aff759d69795d1df905526", // active_exiting "0x424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242", // does not exist @@ -255,7 +255,7 @@ func TestGetStateValidators_GetRestJsonResponseOnError(t *testing.T) { ).Times(1) stateValidatorsProvider := beaconApiStateValidatorsProvider{jsonRestHandler: jsonRestHandler} - _, err = stateValidatorsProvider.GetStateValidators(ctx, []string{ + _, err = stateValidatorsProvider.StateValidators(ctx, []string{ "0x8000091c2ae64ee414a54c1cc1fc67dec663408bc636cb86756e0200e41a75c8f86603f104f02c856983d2783116be13", // active_ongoing }, nil, @@ -294,7 +294,7 @@ func TestGetStateValidators_DataIsNil_POST(t *testing.T) { ).Times(1) stateValidatorsProvider := beaconApiStateValidatorsProvider{jsonRestHandler: jsonRestHandler} - _, err = stateValidatorsProvider.GetStateValidators(ctx, []string{ + _, err = stateValidatorsProvider.StateValidators(ctx, []string{ "0x8000091c2ae64ee414a54c1cc1fc67dec663408bc636cb86756e0200e41a75c8f86603f104f02c856983d2783116be13", // active_ongoing }, nil, @@ -354,7 +354,7 @@ func TestGetStateValidators_DataIsNil_GET(t *testing.T) { ).Times(1) stateValidatorsProvider := beaconApiStateValidatorsProvider{jsonRestHandler: jsonRestHandler} - _, err = stateValidatorsProvider.GetStateValidators(ctx, []string{ + _, err = stateValidatorsProvider.StateValidators(ctx, []string{ "0x8000091c2ae64ee414a54c1cc1fc67dec663408bc636cb86756e0200e41a75c8f86603f104f02c856983d2783116be13", // active_ongoing }, nil, diff --git a/validator/client/beacon-api/status.go b/validator/client/beacon-api/status.go index b0f63fc7e9fa..bdec7502fec5 100644 --- a/validator/client/beacon-api/status.go +++ b/validator/client/beacon-api/status.go @@ -14,7 +14,7 @@ import ( ) func (c *beaconApiValidatorClient) validatorStatus(ctx context.Context, in *ethpb.ValidatorStatusRequest) (*ethpb.ValidatorStatusResponse, error) { - _, _, validatorsStatusResponse, err := c.getValidatorsStatusResponse(ctx, [][]byte{in.PublicKey}, nil) + _, _, validatorsStatusResponse, err := c.validatorsStatusResponse(ctx, [][]byte{in.PublicKey}, nil) if err != nil { return nil, errors.Wrap(err, "failed to get validator status response") } @@ -33,7 +33,7 @@ func (c *beaconApiValidatorClient) multipleValidatorStatus(ctx context.Context, for i, ix := range in.Indices { indices[i] = primitives.ValidatorIndex(ix) } - publicKeys, indices, statuses, err := c.getValidatorsStatusResponse(ctx, in.PublicKeys, indices) + publicKeys, indices, statuses, err := c.validatorsStatusResponse(ctx, in.PublicKeys, indices) if err != nil { return nil, errors.Wrap(err, "failed to get validators status response") } @@ -45,7 +45,7 @@ func (c *beaconApiValidatorClient) multipleValidatorStatus(ctx context.Context, }, nil } -func (c *beaconApiValidatorClient) getValidatorsStatusResponse(ctx context.Context, inPubKeys [][]byte, inIndexes []primitives.ValidatorIndex) ( +func (c *beaconApiValidatorClient) validatorsStatusResponse(ctx context.Context, inPubKeys [][]byte, inIndexes []primitives.ValidatorIndex) ( [][]byte, []primitives.ValidatorIndex, []*ethpb.ValidatorStatusResponse, @@ -74,7 +74,7 @@ func (c *beaconApiValidatorClient) getValidatorsStatusResponse(ctx context.Conte } // Get state for the current validator - stateValidatorsResponse, err := c.stateValidatorsProvider.GetStateValidators(ctx, stringTargetPubKeys, inIndexes, nil) + stateValidatorsResponse, err := c.stateValidatorsProvider.StateValidators(ctx, stringTargetPubKeys, inIndexes, nil) if err != nil { return nil, nil, nil, errors.Wrap(err, "failed to get state validators") } diff --git a/validator/client/beacon-api/status_test.go b/validator/client/beacon-api/status_test.go index 15b318f88026..c802bd59ff15 100644 --- a/validator/client/beacon-api/status_test.go +++ b/validator/client/beacon-api/status_test.go @@ -31,7 +31,7 @@ func TestValidatorStatus_Nominal(t *testing.T) { stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, []string{stringValidatorPubKey}, nil, @@ -96,7 +96,7 @@ func TestValidatorStatus_Error(t *testing.T) { stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, gomock.Any(), nil, @@ -138,7 +138,7 @@ func TestMultipleValidatorStatus_Nominal(t *testing.T) { stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, stringValidatorsPubKey, []primitives.ValidatorIndex{}, @@ -223,7 +223,7 @@ func TestMultipleValidatorStatus_Error(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, gomock.Any(), []primitives.ValidatorIndex{}, @@ -275,7 +275,7 @@ func TestGetValidatorsStatusResponse_Nominal_SomeActiveValidators(t *testing.T) stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, stringValidatorsPubKey, validatorsIndex, @@ -436,7 +436,7 @@ func TestGetValidatorsStatusResponse_Nominal_SomeActiveValidators(t *testing.T) jsonRestHandler: jsonRestHandler, }, } - actualValidatorsPubKey, actualValidatorsIndex, actualValidatorsStatusResponse, err := validatorClient.getValidatorsStatusResponse(ctx, validatorsPubKey, validatorsIndex) + actualValidatorsPubKey, actualValidatorsIndex, actualValidatorsStatusResponse, err := validatorClient.validatorsStatusResponse(ctx, validatorsPubKey, validatorsIndex) require.NoError(t, err) assert.DeepEqual(t, wantedValidatorsPubKey, actualValidatorsPubKey) @@ -455,7 +455,7 @@ func TestGetValidatorsStatusResponse_Nominal_NoActiveValidators(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, []string{stringValidatorPubKey}, nil, @@ -506,7 +506,7 @@ func TestGetValidatorsStatusResponse_Nominal_NoActiveValidators(t *testing.T) { jsonRestHandler: jsonRestHandler, }, } - actualValidatorsPubKey, actualValidatorsIndex, actualValidatorsStatusResponse, err := validatorClient.getValidatorsStatusResponse(ctx, wantedValidatorsPubKey, nil) + actualValidatorsPubKey, actualValidatorsIndex, actualValidatorsStatusResponse, err := validatorClient.validatorsStatusResponse(ctx, wantedValidatorsPubKey, nil) require.NoError(t, err) require.NoError(t, err) @@ -705,7 +705,7 @@ func TestValidatorStatusResponse_InvalidData(t *testing.T) { ctx := context.Background() stateValidatorsProvider := mock.NewMockStateValidatorsProvider(ctrl) - stateValidatorsProvider.EXPECT().GetStateValidators( + stateValidatorsProvider.EXPECT().StateValidators( ctx, testCase.inputGetStateValidatorsInterface.inputStringPubKeys, testCase.inputGetStateValidatorsInterface.inputIndexes, @@ -737,7 +737,7 @@ func TestValidatorStatusResponse_InvalidData(t *testing.T) { }, } - _, _, _, err := validatorClient.getValidatorsStatusResponse( + _, _, _, err := validatorClient.validatorsStatusResponse( ctx, testCase.inputPubKeys, testCase.inputIndexes, diff --git a/validator/client/beacon-api/stream_blocks.go b/validator/client/beacon-api/stream_blocks.go index 86e21b791f00..06113065dce8 100644 --- a/validator/client/beacon-api/stream_blocks.go +++ b/validator/client/beacon-api/stream_blocks.go @@ -46,7 +46,7 @@ func (c *beaconApiValidatorClient) streamBlocks(ctx context.Context, in *ethpb.S } func (c *streamBlocksAltairClient) Recv() (*ethpb.StreamBlocksResponse, error) { - result, err := c.beaconApiClient.getHeadSignedBeaconBlock(c.ctx) + result, err := c.beaconApiClient.headSignedBeaconBlock(c.ctx) if err != nil { return nil, errors.Wrap(err, "failed to get latest signed block") } @@ -55,7 +55,7 @@ func (c *streamBlocksAltairClient) Recv() (*ethpb.StreamBlocksResponse, error) { for (c.streamBlocksRequest.VerifiedOnly && result.executionOptimistic) || c.prevBlockSlot == result.slot { select { case <-time.After(c.pingDelay): - result, err = c.beaconApiClient.getHeadSignedBeaconBlock(c.ctx) + result, err = c.beaconApiClient.headSignedBeaconBlock(c.ctx) if err != nil { return nil, errors.Wrap(err, "failed to get latest signed block") } @@ -68,7 +68,7 @@ func (c *streamBlocksAltairClient) Recv() (*ethpb.StreamBlocksResponse, error) { return result.streamBlocksResponse, nil } -func (c *beaconApiValidatorClient) getHeadSignedBeaconBlock(ctx context.Context) (*headSignedBeaconBlockResult, error) { +func (c *beaconApiValidatorClient) headSignedBeaconBlock(ctx context.Context) (*headSignedBeaconBlockResult, error) { // Since we don't know yet what the json looks like, we unmarshal into an abstract structure that has only a version // and a blob of data signedBlockResponseJson := abstractSignedBlockResponseJson{} diff --git a/validator/client/beacon-api/submit_aggregate_selection_proof.go b/validator/client/beacon-api/submit_aggregate_selection_proof.go index 2bc7e4230d5a..3aeda87136d6 100644 --- a/validator/client/beacon-api/submit_aggregate_selection_proof.go +++ b/validator/client/beacon-api/submit_aggregate_selection_proof.go @@ -37,7 +37,7 @@ func (c *beaconApiValidatorClient) submitAggregateSelectionProof( return nil, errors.New("validator is not an aggregator") } - attestationData, err := c.getAttestationData(ctx, in.Slot, in.CommitteeIndex) + attestationData, err := c.attestationData(ctx, in.Slot, in.CommitteeIndex) if err != nil { return nil, errors.Wrapf(err, "failed to get attestation data for slot=%d and committee_index=%d", in.Slot, in.CommitteeIndex) } @@ -47,7 +47,7 @@ func (c *beaconApiValidatorClient) submitAggregateSelectionProof( return nil, errors.Wrap(err, "failed to calculate attestation data root") } - aggregateAttestationResponse, err := c.getAggregateAttestation(ctx, in.Slot, attestationDataRoot[:]) + aggregateAttestationResponse, err := c.aggregateAttestation(ctx, in.Slot, attestationDataRoot[:]) if err != nil { return nil, err } @@ -66,7 +66,7 @@ func (c *beaconApiValidatorClient) submitAggregateSelectionProof( }, nil } -func (c *beaconApiValidatorClient) getAggregateAttestation( +func (c *beaconApiValidatorClient) aggregateAttestation( ctx context.Context, slot primitives.Slot, attestationDataRoot []byte, diff --git a/validator/client/beacon-api/sync_committee.go b/validator/client/beacon-api/sync_committee.go index ff19e92f60ba..0e6719604e33 100644 --- a/validator/client/beacon-api/sync_committee.go +++ b/validator/client/beacon-api/sync_committee.go @@ -33,7 +33,7 @@ func (c *beaconApiValidatorClient) submitSyncMessage(ctx context.Context, syncMe return c.jsonRestHandler.Post(ctx, endpoint, nil, bytes.NewBuffer(marshalledJsonSyncCommitteeMessage), nil) } -func (c *beaconApiValidatorClient) getSyncMessageBlockRoot(ctx context.Context) (*ethpb.SyncMessageBlockRootResponse, error) { +func (c *beaconApiValidatorClient) syncMessageBlockRoot(ctx context.Context) (*ethpb.SyncMessageBlockRootResponse, error) { // Get head beacon block root. var resp structs.BlockRootResponse if err := c.jsonRestHandler.Get(ctx, "/eth/v1/beacon/blocks/head/root", &resp); err != nil { @@ -64,11 +64,11 @@ func (c *beaconApiValidatorClient) getSyncMessageBlockRoot(ctx context.Context) }, nil } -func (c *beaconApiValidatorClient) getSyncCommitteeContribution( +func (c *beaconApiValidatorClient) syncCommitteeContribution( ctx context.Context, req *ethpb.SyncCommitteeContributionRequest, ) (*ethpb.SyncCommitteeContribution, error) { - blockRootResponse, err := c.getSyncMessageBlockRoot(ctx) + blockRootResponse, err := c.syncMessageBlockRoot(ctx) if err != nil { return nil, errors.Wrap(err, "failed to get sync message block root") } @@ -88,13 +88,13 @@ func (c *beaconApiValidatorClient) getSyncCommitteeContribution( return convertSyncContributionJsonToProto(resp.Data) } -func (c *beaconApiValidatorClient) getSyncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) { +func (c *beaconApiValidatorClient) syncSubcommitteeIndex(ctx context.Context, in *ethpb.SyncSubcommitteeIndexRequest) (*ethpb.SyncSubcommitteeIndexResponse, error) { validatorIndexResponse, err := c.validatorIndex(ctx, ðpb.ValidatorIndexRequest{PublicKey: in.PublicKey}) if err != nil { return nil, errors.Wrap(err, "failed to get validator index") } - syncDuties, err := c.dutiesProvider.GetSyncDuties(ctx, slots.ToEpoch(in.Slot), []primitives.ValidatorIndex{validatorIndexResponse.Index}) + syncDuties, err := c.dutiesProvider.SyncDuties(ctx, slots.ToEpoch(in.Slot), []primitives.ValidatorIndex{validatorIndexResponse.Index}) if err != nil { return nil, errors.Wrap(err, "failed to get sync committee duties") } diff --git a/validator/client/beacon-api/sync_committee_selections.go b/validator/client/beacon-api/sync_committee_selections.go index 97163308e950..10e0bc5a0a4c 100644 --- a/validator/client/beacon-api/sync_committee_selections.go +++ b/validator/client/beacon-api/sync_committee_selections.go @@ -13,7 +13,7 @@ type aggregatedSyncSelectionResponse struct { Data []iface.SyncCommitteeSelection `json:"data"` } -func (c *beaconApiValidatorClient) getAggregatedSyncSelections(ctx context.Context, selections []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { +func (c *beaconApiValidatorClient) aggregatedSyncSelections(ctx context.Context, selections []iface.SyncCommitteeSelection) ([]iface.SyncCommitteeSelection, error) { body, err := json.Marshal(selections) if err != nil { return nil, errors.Wrap(err, "failed to marshal selections") diff --git a/validator/client/beacon-api/sync_committee_test.go b/validator/client/beacon-api/sync_committee_test.go index 581dc1bb48bc..bdb99ab10220 100644 --- a/validator/client/beacon-api/sync_committee_test.go +++ b/validator/client/beacon-api/sync_committee_test.go @@ -150,7 +150,7 @@ func TestGetSyncMessageBlockRoot(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - actualResponse, err := validatorClient.getSyncMessageBlockRoot(ctx) + actualResponse, err := validatorClient.syncMessageBlockRoot(ctx) if test.expectedErrorMessage != "" { require.ErrorContains(t, test.expectedErrorMessage, err) return @@ -236,7 +236,7 @@ func TestGetSyncCommitteeContribution(t *testing.T) { ).Times(1) validatorClient := &beaconApiValidatorClient{jsonRestHandler: jsonRestHandler} - actualResponse, err := validatorClient.getSyncCommitteeContribution(ctx, request) + actualResponse, err := validatorClient.syncCommitteeContribution(ctx, request) if test.expectedErrMsg != "" { require.ErrorContains(t, test.expectedErrMsg, err) return @@ -394,7 +394,7 @@ func TestGetSyncSubCommitteeIndex(t *testing.T) { jsonRestHandler: jsonRestHandler, }, } - actualResponse, err := validatorClient.getSyncSubcommitteeIndex(ctx, ðpb.SyncSubcommitteeIndexRequest{ + actualResponse, err := validatorClient.syncSubcommitteeIndex(ctx, ðpb.SyncSubcommitteeIndexRequest{ PublicKey: pubkey, Slot: slot, }) diff --git a/validator/client/service.go b/validator/client/service.go index aafaeff2dab0..31c039cf5219 100644 --- a/validator/client/service.go +++ b/validator/client/service.go @@ -328,7 +328,7 @@ func ConstructDialOptions( return dialOpts } -func (v *ValidatorService) GetGraffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { +func (v *ValidatorService) Graffiti(ctx context.Context, pubKey [fieldparams.BLSPubkeyLength]byte) ([]byte, error) { if v.validator == nil { return nil, errors.New("validator is unavailable") } diff --git a/validator/client/validator.go b/validator/client/validator.go index f35ab6214360..679bde17ba15 100644 --- a/validator/client/validator.go +++ b/validator/client/validator.go @@ -611,7 +611,7 @@ func (v *validator) subscribeToSubnets(ctx context.Context, duties *ethpb.Duties if v.distributed { // Get aggregated selection proofs to calculate isAggregator. - if err := v.getAggregatedSelectionProofs(ctx, duties); err != nil { + if err := v.aggregatedSelectionProofs(ctx, duties); err != nil { return errors.Wrap(err, "could not get aggregated selection proofs") } } @@ -779,7 +779,7 @@ func (v *validator) isAggregator( err error ) if v.distributed { - slotSig, err = v.getAttSelection(attSelectionKey{slot: slot, index: validatorIndex}) + slotSig, err = v.attSelection(attSelectionKey{slot: slot, index: validatorIndex}) if err != nil { return false, err } @@ -1315,7 +1315,7 @@ func (v *validator) validatorIndex(ctx context.Context, pubkey [fieldparams.BLSP return resp.Index, true, nil } -func (v *validator) getAggregatedSelectionProofs(ctx context.Context, duties *ethpb.DutiesResponse) error { +func (v *validator) aggregatedSelectionProofs(ctx context.Context, duties *ethpb.DutiesResponse) error { // Create new instance of attestation selections map. v.newAttSelections() @@ -1386,7 +1386,7 @@ func (v *validator) newAttSelections() { v.attSelections = make(map[attSelectionKey]iface.BeaconCommitteeSelection) } -func (v *validator) getAttSelection(key attSelectionKey) ([]byte, error) { +func (v *validator) attSelection(key attSelectionKey) ([]byte, error) { v.attSelectionLock.Lock() defer v.attSelectionLock.Unlock() diff --git a/validator/client/validator_test.go b/validator/client/validator_test.go index beaf2db83868..f71b9580a9c9 100644 --- a/validator/client/validator_test.go +++ b/validator/client/validator_test.go @@ -2031,7 +2031,7 @@ func TestValidator_PushSettings(t *testing.T) { } } -func getPubkeyFromString(t *testing.T, stringPubkey string) [fieldparams.BLSPubkeyLength]byte { +func pubkeyFromString(t *testing.T, stringPubkey string) [fieldparams.BLSPubkeyLength]byte { pubkeyTemp, err := hexutil.Decode(stringPubkey) require.NoError(t, err) @@ -2041,7 +2041,7 @@ func getPubkeyFromString(t *testing.T, stringPubkey string) [fieldparams.BLSPubk return pubkey } -func getFeeRecipientFromString(t *testing.T, stringFeeRecipient string) common.Address { +func feeRecipientFromString(t *testing.T, stringFeeRecipient string) common.Address { feeRecipientTemp, err := hexutil.Decode(stringFeeRecipient) require.NoError(t, err) @@ -2058,15 +2058,15 @@ func TestValidator_buildPrepProposerReqs_WithoutDefaultConfig(t *testing.T) { // pubkey4 => Nothing (already in `v.validatorIndex`) // Public keys - pubkey1 := getPubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") - pubkey2 := getPubkeyFromString(t, "0x222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222") - pubkey3 := getPubkeyFromString(t, "0x333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333") - pubkey4 := getPubkeyFromString(t, "0x444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444") + pubkey1 := pubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") + pubkey2 := pubkeyFromString(t, "0x222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222") + pubkey3 := pubkeyFromString(t, "0x333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333") + pubkey4 := pubkeyFromString(t, "0x444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444") // Fee recipients - feeRecipient1 := getFeeRecipientFromString(t, "0x1111111111111111111111111111111111111111") - feeRecipient2 := getFeeRecipientFromString(t, "0x0000000000000000000000000000000000000000") - feeRecipient3 := getFeeRecipientFromString(t, "0x3333333333333333333333333333333333333333") + feeRecipient1 := feeRecipientFromString(t, "0x1111111111111111111111111111111111111111") + feeRecipient2 := feeRecipientFromString(t, "0x0000000000000000000000000000000000000000") + feeRecipient3 := feeRecipientFromString(t, "0x3333333333333333333333333333333333333333") feeRecipient4 := common.Address{} ctrl := gomock.NewController(t) @@ -2164,22 +2164,22 @@ func TestValidator_buildPrepProposerReqs_WithDefaultConfig(t *testing.T) { // pubkey8 => feeRecipient8 - Status: exiting (already in `v.validatorIndex`) // Public keys - pubkey1 := getPubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") - pubkey2 := getPubkeyFromString(t, "0x222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222") - pubkey3 := getPubkeyFromString(t, "0x333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333") - pubkey4 := getPubkeyFromString(t, "0x444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444") - pubkey5 := getPubkeyFromString(t, "0x555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555") - pubkey6 := getPubkeyFromString(t, "0x666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666") - pubkey7 := getPubkeyFromString(t, "0x777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777") - pubkey8 := getPubkeyFromString(t, "0x888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888") + pubkey1 := pubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") + pubkey2 := pubkeyFromString(t, "0x222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222") + pubkey3 := pubkeyFromString(t, "0x333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333") + pubkey4 := pubkeyFromString(t, "0x444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444") + pubkey5 := pubkeyFromString(t, "0x555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555") + pubkey6 := pubkeyFromString(t, "0x666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666") + pubkey7 := pubkeyFromString(t, "0x777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777") + pubkey8 := pubkeyFromString(t, "0x888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888") // Fee recipients - feeRecipient1 := getFeeRecipientFromString(t, "0x1111111111111111111111111111111111111111") - feeRecipient2 := getFeeRecipientFromString(t, "0x0000000000000000000000000000000000000000") - feeRecipient3 := getFeeRecipientFromString(t, "0x3333333333333333333333333333333333333333") - feeRecipient8 := getFeeRecipientFromString(t, "0x8888888888888888888888888888888888888888") + feeRecipient1 := feeRecipientFromString(t, "0x1111111111111111111111111111111111111111") + feeRecipient2 := feeRecipientFromString(t, "0x0000000000000000000000000000000000000000") + feeRecipient3 := feeRecipientFromString(t, "0x3333333333333333333333333333333333333333") + feeRecipient8 := feeRecipientFromString(t, "0x8888888888888888888888888888888888888888") - defaultFeeRecipient := getFeeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") + defaultFeeRecipient := feeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") pubkeyToStatus := map[[fieldparams.BLSPubkeyLength]byte]ethpb.ValidatorStatus{ pubkey1: ethpb.ValidatorStatus_ACTIVE, @@ -2327,15 +2327,15 @@ func TestValidator_buildSignedRegReqs_DefaultConfigDisabled(t *testing.T) { // pubkey3 => Nothing, builder enabled // Public keys - pubkey1 := getPubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") - pubkey2 := getPubkeyFromString(t, "0x222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222") - pubkey3 := getPubkeyFromString(t, "0x333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333") + pubkey1 := pubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") + pubkey2 := pubkeyFromString(t, "0x222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222") + pubkey3 := pubkeyFromString(t, "0x333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333") // Fee recipients - feeRecipient1 := getFeeRecipientFromString(t, "0x0000000000000000000000000000000000000000") - feeRecipient2 := getFeeRecipientFromString(t, "0x2222222222222222222222222222222222222222") + feeRecipient1 := feeRecipientFromString(t, "0x0000000000000000000000000000000000000000") + feeRecipient2 := feeRecipientFromString(t, "0x2222222222222222222222222222222222222222") - defaultFeeRecipient := getFeeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") + defaultFeeRecipient := feeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") ctrl := gomock.NewController(t) defer ctrl.Finish() @@ -2412,15 +2412,15 @@ func TestValidator_buildSignedRegReqs_DefaultConfigEnabled(t *testing.T) { // pubkey3 => Nothing, builder enabled // Public keys - pubkey1 := getPubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") - pubkey2 := getPubkeyFromString(t, "0x222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222") - pubkey3 := getPubkeyFromString(t, "0x333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333") + pubkey1 := pubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") + pubkey2 := pubkeyFromString(t, "0x222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222") + pubkey3 := pubkeyFromString(t, "0x333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333") // Fee recipients - feeRecipient1 := getFeeRecipientFromString(t, "0x0000000000000000000000000000000000000000") - feeRecipient2 := getFeeRecipientFromString(t, "0x2222222222222222222222222222222222222222") + feeRecipient1 := feeRecipientFromString(t, "0x0000000000000000000000000000000000000000") + feeRecipient2 := feeRecipientFromString(t, "0x2222222222222222222222222222222222222222") - defaultFeeRecipient := getFeeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") + defaultFeeRecipient := feeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") ctrl := gomock.NewController(t) defer ctrl.Finish() @@ -2498,10 +2498,10 @@ func TestValidator_buildSignedRegReqs_DefaultConfigEnabled(t *testing.T) { func TestValidator_buildSignedRegReqs_SignerOnError(t *testing.T) { // Public keys - pubkey1 := getPubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") + pubkey1 := pubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") // Fee recipients - defaultFeeRecipient := getFeeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") + defaultFeeRecipient := feeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") ctrl := gomock.NewController(t) defer ctrl.Finish() @@ -2537,12 +2537,12 @@ func TestValidator_buildSignedRegReqs_SignerOnError(t *testing.T) { func TestValidator_buildSignedRegReqs_TimestampBeforeGenesis(t *testing.T) { // Public keys - pubkey1 := getPubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") + pubkey1 := pubkeyFromString(t, "0x111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111") // Fee recipients - feeRecipient1 := getFeeRecipientFromString(t, "0x0000000000000000000000000000000000000000") + feeRecipient1 := feeRecipientFromString(t, "0x0000000000000000000000000000000000000000") - defaultFeeRecipient := getFeeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") + defaultFeeRecipient := feeRecipientFromString(t, "0xdddddddddddddddddddddddddddddddddddddddd") ctrl := gomock.NewController(t) defer ctrl.Finish() diff --git a/validator/rpc/handlers_keymanager.go b/validator/rpc/handlers_keymanager.go index c9fae2f58880..f5d1c9aebab8 100644 --- a/validator/rpc/handlers_keymanager.go +++ b/validator/rpc/handlers_keymanager.go @@ -854,7 +854,7 @@ func (s *Server) GetGraffiti(w http.ResponseWriter, r *http.Request) { return } - graffiti, err := s.validatorService.GetGraffiti(ctx, bytesutil.ToBytes48(pubkey)) + graffiti, err := s.validatorService.Graffiti(ctx, bytesutil.ToBytes48(pubkey)) if err != nil { if strings.Contains(err.Error(), "unavailable") { httputil.HandleError(w, err.Error(), http.StatusInternalServerError) From 26bfc61d4ac9cab0b3d301ab3f19d94f01145e0e Mon Sep 17 00:00:00 2001 From: rkapka Date: Thu, 30 May 2024 14:22:03 +0900 Subject: [PATCH 9/9] combine parameters --- validator/client/beacon-api/activation.go | 2 +- validator/client/beacon-api/attestation_data_test.go | 2 +- validator/client/beacon-api/get_beacon_block.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/validator/client/beacon-api/activation.go b/validator/client/beacon-api/activation.go index 9e26ebbf734b..9e1671ec11fa 100644 --- a/validator/client/beacon-api/activation.go +++ b/validator/client/beacon-api/activation.go @@ -29,7 +29,7 @@ type waitForActivationClient struct { lastRecvTime time.Time } -func computeWaitElements(now time.Time, lastRecvTime time.Time) (time.Duration, time.Time) { +func computeWaitElements(now, lastRecvTime time.Time) (time.Duration, time.Time) { nextRecvTime := lastRecvTime.Add(time.Duration(params.BeaconConfig().SecondsPerSlot) * time.Second) if lastRecvTime.IsZero() { diff --git a/validator/client/beacon-api/attestation_data_test.go b/validator/client/beacon-api/attestation_data_test.go index d87ae4d6ecad..2da68cec81e2 100644 --- a/validator/client/beacon-api/attestation_data_test.go +++ b/validator/client/beacon-api/attestation_data_test.go @@ -224,7 +224,7 @@ func TestGetAttestationData_JsonResponseError(t *testing.T) { assert.ErrorContains(t, "some specific json response error", err) } -func generateValidAttestation(slot uint64, committeeIndex uint64) structs.GetAttestationDataResponse { +func generateValidAttestation(slot, committeeIndex uint64) structs.GetAttestationDataResponse { return structs.GetAttestationDataResponse{ Data: &structs.AttestationData{ Slot: strconv.FormatUint(slot, 10), diff --git a/validator/client/beacon-api/get_beacon_block.go b/validator/client/beacon-api/get_beacon_block.go index 5fcced2a5ff5..16de0e5b9598 100644 --- a/validator/client/beacon-api/get_beacon_block.go +++ b/validator/client/beacon-api/get_beacon_block.go @@ -22,7 +22,7 @@ type abstractProduceBlockResponseJson struct { Data json.RawMessage `json:"data"` } -func (c *beaconApiValidatorClient) beaconBlock(ctx context.Context, slot primitives.Slot, randaoReveal []byte, graffiti []byte) (*ethpb.GenericBeaconBlock, error) { +func (c *beaconApiValidatorClient) beaconBlock(ctx context.Context, slot primitives.Slot, randaoReveal, graffiti []byte) (*ethpb.GenericBeaconBlock, error) { queryParams := neturl.Values{} queryParams.Add("randao_reveal", hexutil.Encode(randaoReveal)) if len(graffiti) > 0 {