Skip to content

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

@dknopik

Description

@dknopik

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    HTTP-APIbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions