Skip to content

Commit

Permalink
Revert beacon node changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rkapka committed May 27, 2024
1 parent fab8fa2 commit 0218c98
Show file tree
Hide file tree
Showing 12 changed files with 67 additions and 67 deletions.
2 changes: 1 addition & 1 deletion beacon-chain/rpc/core/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
16 changes: 8 additions & 8 deletions beacon-chain/rpc/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -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},
},
Expand Down Expand Up @@ -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},
},
Expand Down Expand Up @@ -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},
},
Expand Down Expand Up @@ -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},
},
Expand Down Expand Up @@ -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},
},
Expand Down Expand Up @@ -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},
},
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/rpc/eth/beacon/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions beacon-chain/rpc/eth/node/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/rpc/eth/validator/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/rpc/prysm/beacon/validator_count.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/rpc/prysm/v1alpha1/beacon/blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
8 changes: 4 additions & 4 deletions beacon-chain/rpc/prysm/v1alpha1/beacon/blocks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down Expand Up @@ -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)
}

Expand All @@ -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)
}

Expand Down Expand Up @@ -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")
Expand Down
10 changes: 5 additions & 5 deletions beacon-chain/rpc/prysm/v1alpha1/beacon/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Loading

0 comments on commit 0218c98

Please sign in to comment.