Skip to content

Commit ef20c45

Browse files
authored
Removed Beacon API endpoints which have been deprecated at the Deneb fork (#15166)
* Removed Beacon API endpoints which have been deprecated at the Deneb fork * fix linter
1 parent e6e03c8 commit ef20c45

File tree

7 files changed

+10
-1489
lines changed

7 files changed

+10
-1489
lines changed

beacon-chain/rpc/endpoints.go

-18
Original file line numberDiff line numberDiff line change
@@ -372,24 +372,6 @@ func (s *Service) validatorEndpoints(
372372
handler: server.GetLiveness,
373373
methods: []string{http.MethodPost},
374374
},
375-
{
376-
template: "/eth/v2/validator/blocks/{slot}",
377-
name: namespace + ".ProduceBlockV2",
378-
middleware: []middleware.Middleware{
379-
middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}),
380-
},
381-
handler: server.ProduceBlockV2,
382-
methods: []string{http.MethodGet},
383-
},
384-
{
385-
template: "/eth/v1/validator/blinded_blocks/{slot}",
386-
name: namespace + ".ProduceBlindedBlock",
387-
middleware: []middleware.Middleware{
388-
middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}),
389-
},
390-
handler: server.ProduceBlindedBlock,
391-
methods: []string{http.MethodGet},
392-
},
393375
{
394376
template: "/eth/v3/validator/blocks/{slot}",
395377
name: namespace + ".ProduceBlockV3",

beacon-chain/rpc/endpoints_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,7 @@ func Test_endpoints(t *testing.T) {
9999
"/eth/v1/validator/duties/attester/{epoch}": {http.MethodPost},
100100
"/eth/v1/validator/duties/proposer/{epoch}": {http.MethodGet},
101101
"/eth/v1/validator/duties/sync/{epoch}": {http.MethodPost},
102-
"/eth/v2/validator/blocks/{slot}": {http.MethodGet},
103102
"/eth/v3/validator/blocks/{slot}": {http.MethodGet},
104-
"/eth/v1/validator/blinded_blocks/{slot}": {http.MethodGet},
105103
"/eth/v1/validator/attestation_data": {http.MethodGet},
106104
"/eth/v1/validator/aggregate_attestation": {http.MethodGet},
107105
"/eth/v2/validator/aggregate_attestation": {http.MethodGet},

beacon-chain/rpc/eth/validator/handlers_block.go

-104
Original file line numberDiff line numberDiff line change
@@ -33,110 +33,6 @@ const (
3333
blinded
3434
)
3535

36-
// DEPRECATED: Please use ProduceBlockV3 instead.
37-
//
38-
// ProduceBlockV2 requests the beacon node to produce a valid unsigned beacon block,
39-
// which can then be signed by a proposer and submitted.
40-
func (s *Server) ProduceBlockV2(w http.ResponseWriter, r *http.Request) {
41-
ctx, span := trace.StartSpan(r.Context(), "validator.ProduceBlockV2")
42-
defer span.End()
43-
44-
if shared.IsSyncing(ctx, w, s.SyncChecker, s.HeadFetcher, s.TimeFetcher, s.OptimisticModeFetcher) {
45-
return
46-
}
47-
48-
segments := strings.Split(r.URL.Path, "/")
49-
rawSlot := segments[len(segments)-1]
50-
rawRandaoReveal := r.URL.Query().Get("randao_reveal")
51-
rawGraffiti := r.URL.Query().Get("graffiti")
52-
rawSkipRandaoVerification := r.URL.Query().Get("skip_randao_verification")
53-
54-
slot, valid := shared.ValidateUint(w, "slot", rawSlot)
55-
if !valid {
56-
return
57-
}
58-
59-
var randaoReveal []byte
60-
if rawSkipRandaoVerification == "true" {
61-
randaoReveal = common.InfiniteSignature[:]
62-
} else {
63-
rr, err := bytesutil.DecodeHexWithLength(rawRandaoReveal, fieldparams.BLSSignatureLength)
64-
if err != nil {
65-
httputil.HandleError(w, errors.Wrap(err, "Unable to decode randao reveal").Error(), http.StatusBadRequest)
66-
return
67-
}
68-
randaoReveal = rr
69-
}
70-
var graffiti []byte
71-
if rawGraffiti != "" {
72-
g, err := bytesutil.DecodeHexWithLength(rawGraffiti, 32)
73-
if err != nil {
74-
httputil.HandleError(w, errors.Wrap(err, "Unable to decode graffiti").Error(), http.StatusBadRequest)
75-
return
76-
}
77-
graffiti = g
78-
}
79-
80-
s.produceBlockV3(ctx, w, r, &eth.BlockRequest{
81-
Slot: primitives.Slot(slot),
82-
RandaoReveal: randaoReveal,
83-
Graffiti: graffiti,
84-
SkipMevBoost: true,
85-
}, full)
86-
}
87-
88-
// DEPRECATED: Please use ProduceBlockV3 instead.
89-
//
90-
// ProduceBlindedBlock requests the beacon node to produce a valid unsigned blinded beacon block,
91-
// which can then be signed by a proposer and submitted.
92-
func (s *Server) ProduceBlindedBlock(w http.ResponseWriter, r *http.Request) {
93-
ctx, span := trace.StartSpan(r.Context(), "validator.ProduceBlindedBlock")
94-
defer span.End()
95-
96-
if shared.IsSyncing(ctx, w, s.SyncChecker, s.HeadFetcher, s.TimeFetcher, s.OptimisticModeFetcher) {
97-
return
98-
}
99-
100-
segments := strings.Split(r.URL.Path, "/")
101-
rawSlot := segments[len(segments)-1]
102-
rawRandaoReveal := r.URL.Query().Get("randao_reveal")
103-
rawGraffiti := r.URL.Query().Get("graffiti")
104-
rawSkipRandaoVerification := r.URL.Query().Get("skip_randao_verification")
105-
106-
slot, valid := shared.ValidateUint(w, "slot", rawSlot)
107-
if !valid {
108-
return
109-
}
110-
111-
var randaoReveal []byte
112-
if rawSkipRandaoVerification == "true" {
113-
randaoReveal = common.InfiniteSignature[:]
114-
} else {
115-
rr, err := bytesutil.DecodeHexWithLength(rawRandaoReveal, fieldparams.BLSSignatureLength)
116-
if err != nil {
117-
httputil.HandleError(w, errors.Wrap(err, "Unable to decode randao reveal").Error(), http.StatusBadRequest)
118-
return
119-
}
120-
randaoReveal = rr
121-
}
122-
var graffiti []byte
123-
if rawGraffiti != "" {
124-
g, err := bytesutil.DecodeHexWithLength(rawGraffiti, 32)
125-
if err != nil {
126-
httputil.HandleError(w, errors.Wrap(err, "Unable to decode graffiti").Error(), http.StatusBadRequest)
127-
return
128-
}
129-
graffiti = g
130-
}
131-
132-
s.produceBlockV3(ctx, w, r, &eth.BlockRequest{
133-
Slot: primitives.Slot(slot),
134-
RandaoReveal: randaoReveal,
135-
Graffiti: graffiti,
136-
SkipMevBoost: false,
137-
}, blinded)
138-
}
139-
14036
// ProduceBlockV3 requests a beacon node to produce a valid block, which can then be signed by a validator. The
14137
// returned block may be blinded or unblinded, depending on the current state of the network as
14238
// decided by the execution and beacon nodes.

0 commit comments

Comments
 (0)