Skip to content

Inconsistent Response of Endpoint /eth/v1/beacon/states/{state_id}/committees #7882

@Alleysira

Description

@Alleysira

Describe the bug

Hello developers,

I am conducting API differential testing on an Electra PoS devnet chain and noticed inconsistencies in the Beacon-API responses across Prysm, Lighthouse, Nimbus, Teku, Lodestar and Grandine.

Specifically, when calling the endpoint /eth/v1/beacon/states/{state_id}/committees with invalid epoch and slot, Lodestar will return 500 instead of 400 defined as Invalid state ID, index, epoch, slot, or combination thereof in the schema.

Thanks for your time!

Expected behavior

Return 400

Steps to reproduce

Call /eth/v1/beacon/states/{state_id}/committees with slot not in given epoch, e.g.,{'epoch': 2, 'index': 16, 'slot': 118}.

{"data": [], "execution_optimistic": false, "finalized": false, "server": "http://127.0.0.1:8147"} # Prysm
{"code":400,"message":"BAD_REQUEST: 118 is not in epoch 2","stacktraces":[]} # lighthouse
{"code":400,"message":"Slot 118 is not in epoch 2"} # teku
{"code":400,"message":"Invalid slot value","stacktraces":["Slot does not match requested epoch"]} # nimbus
{"code":500,"message":"EPOCH_CONTEXT_ERROR_DECISION_ROOT_EPOCH_OUT_OF_RANGE"} # lodestar
{"code":400,"message":"slot does not belong in epoch"} # grandine

Additional context

Similar to #7843, it seems that Lodestar defines many domain-specific error types that differ from the standardized error formats used by other clients.

Operating system

Linux

Lodestar version or commit hash

Lodestar/v1.30.0/1a34f98

Metadata

Metadata

Assignees

No one assigned

    Labels

    meta-bugIssues that identify a bug and require a fix.scope-apiIssues related to APIs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions