Skip to content

Commit

Permalink
Allow unknown fields in Beacon API responses (#13131)
Browse files Browse the repository at this point in the history
  • Loading branch information
rkapka authored Oct 27, 2023
1 parent 10a89fe commit f925ade
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 3 deletions.
1 change: 0 additions & 1 deletion validator/client/beacon-api/get_beacon_block.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ func (c beaconApiValidatorClient) getBeaconBlock(ctx context.Context, slot primi

// Once we know what the consensus version is, we can go ahead and unmarshal into the specific structs unique to each version
decoder := json.NewDecoder(bytes.NewReader(produceBlockResponseJson.Data))
decoder.DisallowUnknownFields()

response := &ethpb.GenericBeaconBlock{}

Expand Down
1 change: 0 additions & 1 deletion validator/client/beacon-api/json_rest_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func (c beaconApiJsonRestHandler) PostRestJson(ctx context.Context, apiEndpoint

func decodeJsonResp(resp *http.Response, responseJson interface{}) (*apimiddleware.DefaultErrorJson, error) {
decoder := json.NewDecoder(resp.Body)
decoder.DisallowUnknownFields()

if resp.StatusCode != http.StatusOK {
errorJson := &apimiddleware.DefaultErrorJson{}
Expand Down
1 change: 0 additions & 1 deletion validator/client/beacon-api/stream_blocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ func (c beaconApiValidatorClient) getHeadSignedBeaconBlock(ctx context.Context)

// Once we know what the consensus version is, we can go ahead and unmarshal into the specific structs unique to each version
decoder := json.NewDecoder(bytes.NewReader(signedBlockResponseJson.Data))
decoder.DisallowUnknownFields()

response := &ethpb.StreamBlocksResponse{}
var slot primitives.Slot
Expand Down

0 comments on commit f925ade

Please sign in to comment.