Skip to content

Body of POST to validators endpoint not filtering correctly #5758

Closed
@mcdee

Description

@mcdee

Describe the bug
Against a goerli node:

curl -X POST -H 'content-type: application/json' --data '{"ids":["1"],"statuses":["active_ongoing"]}' http://localhost:5052/eth/v1/beacon/states/head/validators
{"execution_optimistic":false,"finalized":false,"data":[{"index":"1","balance":"35198517881","status":"active_ongoing","validator":{"pubkey":"0xaffc434cf8138634a4cd0ef6cb815febd3db25760b1b6c522f9b4aa78e599b60336d7dd2e953192e45d4ac91f66f0723","withdrawal_credentials":"0x00fc40352b0a186d83267fc1342ec5da49dbb78e1099a4bd8db16d2c0d223594","effective_balance":"32000000000","slashed":false,"activation_eligibility_epoch":"0","activation_epoch":"0","exit_epoch":"18446744073709551615","withdrawable_epoch":"18446744073709551615"}}]}

This looks good, however removing the status results in nothing returned:

curl -X POST -H 'content-type: application/json' --data '{"ids":["1"]}' http://localhost:5052/eth/v1/beacon/states/head/validators
{"execution_optimistic":false,"finalized":false,"data":[]}

In addition, an empty request also returns nothing:

curl -X POST -H 'content-type: application/json' --data '{}' http://localhost:5052/eth/v1/beacon/states/head/validators
{"execution_optimistic":false,"finalized":false,"data":[]}

According to the API docs "The lists of validator IDs and statuses to filter on. Either or both may be null to signal that no filtering on that attribute is desired." so I would expect to see 1 validator returned in the second request, and all of them in the third request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions