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

Multiple API errors are not spec compliant #6293

Open
nflaig opened this issue Jan 14, 2024 · 2 comments · May be fixed by #6479
Open

Multiple API errors are not spec compliant #6293

nflaig opened this issue Jan 14, 2024 · 2 comments · May be fixed by #6479
Assignees
Labels
good first issue Issues that are suitable for first-time contributors. meta-bug Issues that identify a bug and require a fix.

Comments

@nflaig
Copy link
Member

nflaig commented Jan 14, 2024

Describe the bug

The beacon API spec notes that multiple API errors (e.g submitPoolAttestations) should return a 400 error with details of each failure.

If one or more attestations fail validation the node MUST return a 400 error with details of which attestations have failed, and why.

There was initial work on this to handle multiple errors (#2595), we just need to update the response format and status code.

Expected behavior

The response should be formatted like this

{
  "code": 400,
  "message": "some failures",
  "failures": [
    {
      "index": 3,
      "message": "invalid signature"
    }
  ]
}

and return 400 http status code instead of 500

Steps to reproduce

Call any API that accepts an array of objects with invalid data.

Additional context

Operating system

Linux

Lodestar version or commit hash

098d35a

@nflaig nflaig added meta-bug Issues that identify a bug and require a fix. good first issue Issues that are suitable for first-time contributors. labels Jan 14, 2024
@har777
Copy link
Contributor

har777 commented Feb 25, 2024

@nflaig Can I take this on?

@har777 har777 linked a pull request Feb 25, 2024 that will close this issue
7 tasks
@nflaig
Copy link
Member Author

nflaig commented Feb 25, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Issues that are suitable for first-time contributors. meta-bug Issues that identify a bug and require a fix.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants