Skip to content

Getting 404 not found errors for missed blocks instead of a specific missed error code #4904

Open
@wangwzhou

Description

@wangwzhou

Description

When I fetch the slot data of a missed slot with eth/v2/beacon/blocks and eth/v1/beacon/headers, the response is 404 Not Found, instead of a specific error indicating this is a missed block, which makes it difficult to differentiate the following 2 cases:

  1. Cannot fetch slot data because it's a missed slot.
  2. Cannot fetch slot data because nodes are out of sync, or the slot hasn't been proposed yet.

Wondering should client return a specific error for missed slot?

Version

Lighthouse/v4.5.0-441fc16/x86_64-linux

Present Behaviour

When fetching the slot data of a missed slot with eth/v2/beacon/blocks and eth/v1/beacon/headers, the response is 404 Not Found.

For example, when fetch block header for https://holesky.beaconcha.in/slot/1, the response is

{ "code": 404, "message": "NOT_FOUND: beacon block at slot 1", "stacktraces": [] }

Expected Behaviour

Should client return a specific error/error code for missed slots?

Steps to resolve

Please describe the steps required to resolve this issue, if known.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions