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