Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Support SSZ request body for POST /beacon/blinded_blocks endpoints (v1 & v2) #4504

Closed
wants to merge 6 commits into from

Conversation

eserilev
Copy link
Collaborator

Issue Addressed

#4262

Proposed Changes

add SSZ support in request body for POST /beacon/blinded_blocks endpoints (v1 & v2)

Additional Info

@eserilev eserilev marked this pull request as ready for review July 13, 2023 22:17
@jimmygchen jimmygchen added ready-for-review The code is ready for review HTTP-API labels Jul 13, 2023
@paulhauner
Copy link
Member

paulhauner commented Jul 20, 2023

Hey @eserilev this one is failing clippy. You can check locally with make lint :)

Edit: Merging in unstable might help with some new clippy lints added in a recent Rust version.

Copy link
Member

@paulhauner paulhauner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started a review, but then realised that this will conflict with #4479 so I'll wait for that to be merged before finishing the review here :)

Comment on lines 1409 to 1410
StatusCode::INTERNAL_SERVER_ERROR,
eth2::StatusCode::INTERNAL_SERVER_ERROR,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above regarding BAD_REQUEST.

Comment on lines 1330 to 1333
return Err(warp_utils::reject::custom_server_error(format!(
"{:?}",
e
)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in https://github.com/sigp/lighthouse/pull/4479/files#r1268939832, I think this would be best as a BAD_REQUEST.

@paulhauner
Copy link
Member

Blocked on #4479

@eserilev
Copy link
Collaborator Author

eserilev commented Aug 1, 2023

this should now be unblocked

Copy link
Member

@paulhauner paulhauner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for another great contribution! ❤️

@paulhauner paulhauner added ready-for-merge This PR is ready to merge. and removed ready-for-review The code is ready for review blocked labels Aug 2, 2023
@paulhauner
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Aug 2, 2023
…1 & v2) (#4504)

## Issue Addressed

#4262 

## Proposed Changes

add SSZ support in request body for POST /beacon/blinded_blocks endpoints (v1 & v2)

## Additional Info
@bors
Copy link

bors bot commented Aug 2, 2023

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Aug 2, 2023
…1 & v2) (#4504)

## Issue Addressed

#4262 

## Proposed Changes

add SSZ support in request body for POST /beacon/blinded_blocks endpoints (v1 & v2)

## Additional Info
@bors
Copy link

bors bot commented Aug 2, 2023

Build failed (retrying...):

@divagant-martian
Copy link
Collaborator

divagant-martian commented Aug 3, 2023

There seems to be a real failure here https://github.com/sigp/lighthouse/actions/runs/5723449067/job/15545145105

PRs batched with this one seem to be failing because of that and link directly to this

@paulhauner
Copy link
Member

bors r-

@bors
Copy link

bors bot commented Aug 3, 2023

Canceled.

@eserilev
Copy link
Collaborator Author

eserilev commented Aug 4, 2023

There seems to be a real failure here https://github.com/sigp/lighthouse/actions/runs/5723449067/job/15545145105

PRs batched with this one seem to be failing because of that and link directly to this

Is this PR causing the issue? I tried running the test suite locally and i'm not getting any errors, but maybe I'm missing something here

@paulhauner
Copy link
Member

I'll try CI again and see how it goes 🤞 We seem to be running into the same problem we're trying to fix in #4554.

@paulhauner
Copy link
Member

Hmm, CI seems OK. I'll try bors again. Perhaps the issue only presents itself when unstable is merged with this branch.

bors r+

bors bot pushed a commit that referenced this pull request Aug 7, 2023
…1 & v2) (#4504)

## Issue Addressed

#4262 

## Proposed Changes

add SSZ support in request body for POST /beacon/blinded_blocks endpoints (v1 & v2)

## Additional Info
@bors
Copy link

bors bot commented Aug 7, 2023

Build failed (retrying...):

bors bot pushed a commit that referenced this pull request Aug 7, 2023
…1 & v2) (#4504)

## Issue Addressed

#4262 

## Proposed Changes

add SSZ support in request body for POST /beacon/blinded_blocks endpoints (v1 & v2)

## Additional Info
@bors
Copy link

bors bot commented Aug 7, 2023

Build failed:

@paulhauner
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Aug 7, 2023
…1 & v2) (#4504)

## Issue Addressed

#4262 

## Proposed Changes

add SSZ support in request body for POST /beacon/blinded_blocks endpoints (v1 & v2)

## Additional Info
@bors
Copy link

bors bot commented Aug 7, 2023

Build failed:

@paulhauner
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Aug 7, 2023
…1 & v2) (#4504)

## Issue Addressed

#4262 

## Proposed Changes

add SSZ support in request body for POST /beacon/blinded_blocks endpoints (v1 & v2)

## Additional Info
@bors
Copy link

bors bot commented Aug 7, 2023

Build failed:

@paulhauner
Copy link
Member

bors r+

bors bot pushed a commit that referenced this pull request Aug 7, 2023
…1 & v2) (#4504)

## Issue Addressed

#4262 

## Proposed Changes

add SSZ support in request body for POST /beacon/blinded_blocks endpoints (v1 & v2)

## Additional Info
@bors
Copy link

bors bot commented Aug 7, 2023

@bors bors bot changed the title Support SSZ request body for POST /beacon/blinded_blocks endpoints (v1 & v2) [Merged by Bors] - Support SSZ request body for POST /beacon/blinded_blocks endpoints (v1 & v2) Aug 7, 2023
@bors bors bot closed this Aug 7, 2023
bors bot pushed a commit that referenced this pull request Aug 14, 2023
## Issue Addressed

Closes #3404 (mostly)

## Proposed Changes

- Remove all uses of Warp's `and_then` (which backtracks) in favour of `then` (which doesn't).
- Bump the priority of the `POST` method for `v2/blocks` to `P0`. Publishing a block needs to happen quickly.
- Run the new SSZ POST endpoints on the beacon processor. I think this was missed in between merging #4462 and #4504/#4479.
- Fix a minor issue in the validator registrations endpoint whereby an error from spawning the task on the beacon processor would be dropped.

## Additional Info

I've tested this manually and can confirm that we no longer get the dreaded `Unsupported endpoint version` errors for queries like:

```
$ curl -X POST -H "Content-Type: application/json" --data @block.json "http://localhost:5052/eth/v2/beacon/blocks" | jq
{
  "code": 400,
  "message": "BAD_REQUEST: WeakSubjectivityConflict",
  "stacktraces": []
}
```

```
$ curl -X POST -H "Content-Type: application/octet-stream" --data @block.json "http://localhost:5052/eth/v2/beacon/blocks" | jq
{
  "code": 400,
  "message": "BAD_REQUEST: invalid SSZ: OffsetOutOfBounds(572530811)",
  "stacktraces": []
}
```

```
$ curl "http://localhost:5052/eth/v2/validator/blocks/7067595"
{"code":400,"message":"BAD_REQUEST: invalid query: Invalid query string","stacktraces":[]}
```

However, I can still trigger it by leaving off the `Content-Type`. We can re-test this aspect with #4575.
bors bot pushed a commit that referenced this pull request Aug 14, 2023
## Issue Addressed

Closes #3404 (mostly)

## Proposed Changes

- Remove all uses of Warp's `and_then` (which backtracks) in favour of `then` (which doesn't).
- Bump the priority of the `POST` method for `v2/blocks` to `P0`. Publishing a block needs to happen quickly.
- Run the new SSZ POST endpoints on the beacon processor. I think this was missed in between merging #4462 and #4504/#4479.
- Fix a minor issue in the validator registrations endpoint whereby an error from spawning the task on the beacon processor would be dropped.

## Additional Info

I've tested this manually and can confirm that we no longer get the dreaded `Unsupported endpoint version` errors for queries like:

```
$ curl -X POST -H "Content-Type: application/json" --data @block.json "http://localhost:5052/eth/v2/beacon/blocks" | jq
{
  "code": 400,
  "message": "BAD_REQUEST: WeakSubjectivityConflict",
  "stacktraces": []
}
```

```
$ curl -X POST -H "Content-Type: application/octet-stream" --data @block.json "http://localhost:5052/eth/v2/beacon/blocks" | jq
{
  "code": 400,
  "message": "BAD_REQUEST: invalid SSZ: OffsetOutOfBounds(572530811)",
  "stacktraces": []
}
```

```
$ curl "http://localhost:5052/eth/v2/validator/blocks/7067595"
{"code":400,"message":"BAD_REQUEST: invalid query: Invalid query string","stacktraces":[]}
```

However, I can still trigger it by leaving off the `Content-Type`. We can re-test this aspect with #4575.
@chong-he chong-he added the v4.4.1 ETA August 2023 label Sep 14, 2023
Woodpile37 pushed a commit to Woodpile37/lighthouse that referenced this pull request Jan 6, 2024
…1 & v2) (sigp#4504)

add SSZ support in request body for POST /beacon/blinded_blocks endpoints (v1 & v2)
Woodpile37 pushed a commit to Woodpile37/lighthouse that referenced this pull request Jan 6, 2024
Closes sigp#3404 (mostly)

- Remove all uses of Warp's `and_then` (which backtracks) in favour of `then` (which doesn't).
- Bump the priority of the `POST` method for `v2/blocks` to `P0`. Publishing a block needs to happen quickly.
- Run the new SSZ POST endpoints on the beacon processor. I think this was missed in between merging sigp#4462 and sigp#4504/sigp#4479.
- Fix a minor issue in the validator registrations endpoint whereby an error from spawning the task on the beacon processor would be dropped.

I've tested this manually and can confirm that we no longer get the dreaded `Unsupported endpoint version` errors for queries like:

```
$ curl -X POST -H "Content-Type: application/json" --data @block.json "http://localhost:5052/eth/v2/beacon/blocks" | jq
{
  "code": 400,
  "message": "BAD_REQUEST: WeakSubjectivityConflict",
  "stacktraces": []
}
```

```
$ curl -X POST -H "Content-Type: application/octet-stream" --data @block.json "http://localhost:5052/eth/v2/beacon/blocks" | jq
{
  "code": 400,
  "message": "BAD_REQUEST: invalid SSZ: OffsetOutOfBounds(572530811)",
  "stacktraces": []
}
```

```
$ curl "http://localhost:5052/eth/v2/validator/blocks/7067595"
{"code":400,"message":"BAD_REQUEST: invalid query: Invalid query string","stacktraces":[]}
```

However, I can still trigger it by leaving off the `Content-Type`. We can re-test this aspect with sigp#4575.
Woodpile37 pushed a commit to Woodpile37/lighthouse that referenced this pull request Jan 6, 2024
…1 & v2) (sigp#4504)

add SSZ support in request body for POST /beacon/blinded_blocks endpoints (v1 & v2)
Woodpile37 pushed a commit to Woodpile37/lighthouse that referenced this pull request Jan 6, 2024
Closes sigp#3404 (mostly)

- Remove all uses of Warp's `and_then` (which backtracks) in favour of `then` (which doesn't).
- Bump the priority of the `POST` method for `v2/blocks` to `P0`. Publishing a block needs to happen quickly.
- Run the new SSZ POST endpoints on the beacon processor. I think this was missed in between merging sigp#4462 and sigp#4504/sigp#4479.
- Fix a minor issue in the validator registrations endpoint whereby an error from spawning the task on the beacon processor would be dropped.

I've tested this manually and can confirm that we no longer get the dreaded `Unsupported endpoint version` errors for queries like:

```
$ curl -X POST -H "Content-Type: application/json" --data @block.json "http://localhost:5052/eth/v2/beacon/blocks" | jq
{
  "code": 400,
  "message": "BAD_REQUEST: WeakSubjectivityConflict",
  "stacktraces": []
}
```

```
$ curl -X POST -H "Content-Type: application/octet-stream" --data @block.json "http://localhost:5052/eth/v2/beacon/blocks" | jq
{
  "code": 400,
  "message": "BAD_REQUEST: invalid SSZ: OffsetOutOfBounds(572530811)",
  "stacktraces": []
}
```

```
$ curl "http://localhost:5052/eth/v2/validator/blocks/7067595"
{"code":400,"message":"BAD_REQUEST: invalid query: Invalid query string","stacktraces":[]}
```

However, I can still trigger it by leaving off the `Content-Type`. We can re-test this aspect with sigp#4575.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HTTP-API ready-for-merge This PR is ready to merge. v4.4.1 ETA August 2023
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants