diff --git a/beacon-chain/rpc/endpoints.go b/beacon-chain/rpc/endpoints.go index 4fca3349df2c..fcb2f9a452e8 100644 --- a/beacon-chain/rpc/endpoints.go +++ b/beacon-chain/rpc/endpoints.go @@ -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}), diff --git a/beacon-chain/rpc/endpoints_test.go b/beacon-chain/rpc/endpoints_test.go index 7bb0a8ec99c2..e115ce150b8b 100644 --- a/beacon-chain/rpc/endpoints_test.go +++ b/beacon-chain/rpc/endpoints_test.go @@ -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}, diff --git a/beacon-chain/rpc/eth/beacon/handlers_gloas.go b/beacon-chain/rpc/eth/beacon/handlers_gloas.go index bc4b657a91f5..8f39a79ef38e 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_gloas.go +++ b/beacon-chain/rpc/eth/beacon/handlers_gloas.go @@ -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 } diff --git a/beacon-chain/rpc/eth/beacon/handlers_gloas_test.go b/beacon-chain/rpc/eth/beacon/handlers_gloas_test.go index d73574ff15de..09b29e5606bd 100644 --- a/beacon-chain/rpc/eth/beacon/handlers_gloas_test.go +++ b/beacon-chain/rpc/eth/beacon/handlers_gloas_test.go @@ -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{} @@ -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{} diff --git a/changelog/james-prysm_get-payload-envelope-block-id.md b/changelog/james-prysm_get-payload-envelope-block-id.md new file mode 100644 index 000000000000..6e75c9958c36 --- /dev/null +++ b/changelog/james-prysm_get-payload-envelope-block-id.md @@ -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. \ No newline at end of file