Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion beacon-chain/rpc/endpoints.go
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ func (s *Service) beaconEndpoints(
methods: []string{http.MethodGet},
},
{
template: "/eth/v1/beacon/execution_payload_envelope/{block_root}",
template: "/eth/v1/beacon/execution_payload_envelope/{block_id}",
name: namespace + ".GetExecutionPayloadEnvelope",
middleware: []middleware.Middleware{
middleware.AcceptHeaderHandler([]string{api.JsonMediaType, api.OctetStreamMediaType}),
Expand Down
2 changes: 1 addition & 1 deletion beacon-chain/rpc/endpoints_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func Test_endpoints(t *testing.T) {
"/eth/v1/beacon/states/{state_id}/pending_partial_withdrawals": {http.MethodGet},
"/eth/v1/beacon/states/{state_id}/pending_consolidations": {http.MethodGet},
"/eth/v1/beacon/states/{state_id}/proposer_lookahead": {http.MethodGet},
"/eth/v1/beacon/execution_payload_envelope/{block_root}": {http.MethodGet},
"/eth/v1/beacon/execution_payload_envelope/{block_id}": {http.MethodGet},
"/eth/v1/beacon/headers": {http.MethodGet},
"/eth/v1/beacon/headers/{block_id}": {http.MethodGet},
"/eth/v2/beacon/blinded_blocks": {http.MethodPost},
Expand Down
4 changes: 2 additions & 2 deletions beacon-chain/rpc/eth/beacon/handlers_gloas.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ func (s *Server) GetExecutionPayloadEnvelope(w http.ResponseWriter, r *http.Requ
ctx, span := trace.StartSpan(r.Context(), "beacon.GetExecutionPayloadEnvelope")
defer span.End()

blockID := r.PathValue("block_root")
blockID := r.PathValue("block_id")
if blockID == "" {
httputil.HandleError(w, "block_root is required in URL params", http.StatusBadRequest)
httputil.HandleError(w, "block_id is required in URL params", http.StatusBadRequest)
return
}

Expand Down
8 changes: 4 additions & 4 deletions beacon-chain/rpc/eth/beacon/handlers_gloas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ func TestGetExecutionPayloadEnvelope_AcceptsSlotID(t *testing.T) {
FinalizationFetcher: chain,
}

req := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/execution_payload_envelope/{block_root}", nil)
req.SetPathValue("block_root", "177")
req := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/execution_payload_envelope/{block_id}", nil)
req.SetPathValue("block_id", "177")
w := httptest.NewRecorder()
w.Body = &bytes.Buffer{}

Expand All @@ -96,8 +96,8 @@ func TestGetExecutionPayloadEnvelope_BlockNotFound(t *testing.T) {
},
}

req := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/execution_payload_envelope/{block_root}", nil)
req.SetPathValue("block_root", "not-a-root")
req := httptest.NewRequest(http.MethodGet, "http://example.com/eth/v1/beacon/execution_payload_envelope/{block_id}", nil)
req.SetPathValue("block_id", "not-a-root")
w := httptest.NewRecorder()
w.Body = &bytes.Buffer{}

Expand Down
3 changes: 3 additions & 0 deletions changelog/james-prysm_get-payload-envelope-block-id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Fixed

- changed /eth/v1/beacon/execution_payload_envelope/{block_root} to /eth/v1/beacon/execution_payload_envelope/{block_id} defined in beacon apis.
Loading