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

Endpoints that require the node to be synced respond with "Unsupported endpoint version" while syncing #5131

Closed
dknopik opened this issue Jan 27, 2024 · 4 comments
Labels
bug Something isn't working HTTP-API

Comments

@dknopik
Copy link
Member

dknopik commented Jan 27, 2024

Description

While a node is syncing (SyncState::SyncingFinalized), some endpoints are disabled. When trying to use an endpoint that expects a POST request and requires the node to be synced, the response is incorrect: BAD_REQUEST: Unsupported endpoint version: v1. As soon as the node is synced, the endpoints work properly again. Endoints expecting a GET request are seemingly unaffected.

Version

I was able to trigger this with a recent unstable version and with @eserilev's branch #4575:

Present Behaviour

  1. A node is syncing a finalized chain (e.g. after some downtime)
  2. curl -X POST -H "Content-Type: application/json" --data '["1552654"]' "http://localhost:5052/eth/v1/validator/duties/sync/123" results in {"code":400,"message":"BAD_REQUEST: Unsupported endpoint version: v1","stacktraces":[]}, also if -H "Content-Type: application/json" is removed.
  3. As soon as the node is synced, a proper response is sent again.

Expected Behaviour

Respond with {"code":503,"message":"SERVICE_UNAVAILABLE: beacon node is syncing: head slot is 825919, current slot is 864126","stacktraces":[]} until it is synced.

Steps to resolve

Adjust the warp filters (maybe not_while_syncing_filter)

@chong-he chong-he added bug Something isn't working HTTP-API labels Jan 28, 2024
@dapplion
Copy link
Collaborator

Thanks for reporting!

I was able to trigger this with a recent unstable version and with @eserilev's branch #4575:

So the error happens only with #4575 or is fixed with #4575?

@dknopik
Copy link
Member Author

dknopik commented Jan 29, 2024

So the error happens only with #4575 or is fixed with #4575?

It happens both with and without #4575. I mentioned #4575 because @michaelsproul suggested that the error might be fixed with that branch, which is not the case, so I wanted to emphasize that this is a separate issue.

@eserilev
Copy link
Collaborator

eserilev commented Jan 29, 2024

I believe the issue is that this endpoint doesn't conform to the beacon api spec in the case where the chain is still finalizing. I can pick this one up. Will also spend some time reviewing our other endpoints to ensure they are also conforming to spec for the relevant edge cases.

the not_while_syncing_filter should be rejecting with a not synced error message. For some reason thats not happening, will investigate why

@jimmygchen
Copy link
Member

Fixed in #5136 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working HTTP-API
Projects
None yet
Development

No branches or pull requests

5 participants