-
Notifications
You must be signed in to change notification settings - Fork 169
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
Clarify requirement for validator balances body #453
Clarify requirement for validator balances body #453
Conversation
Agreed, this behavior is likely for the best. And just yesterday I noticed few interop issues between clients when using E.g. Prysm VC sends an empty Empty array should equal omitting the property and not apply any filtering as otherwise it will always return no data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit weird but feels like the best solution given current behaviour
I'm not sure I 100% agree that 'no body' equates to error. It's logically the same as an empty array... We can throw an error, but it's a bit weird IMO. In real terms you haven't requested anything specifically in both cases, and the default is 'return all data'. |
We might wanna keep the body as This is also much more user friendly if you wanna do a quick curl as you can just do
no extra headers and |
It's handy. technically adding required probably could be argued as breaking but given that most clients already error i'm not going to make that argument :) I'm fairly sure that accepting it as equivalent to an empty array is about 1-2 lines of code if people would just do that... |
Have updated Lodestar to behave the same as there is no downside if the server accepts an empty body for routes that only apply it to filter the response, but the client will still send an empty array if no filtering is applied. |
this sounds like basically what we do - we always do send empty array if required, as technically that is correct, but no real down side to allowing no body - ta for update. |
Latest update tweaks the wording to consider both |
Looking at the
validator_balances
endpoint there is some ambiguity around what to do in some cases. Specifically, for POST to/eth/v1/beacon/states/head/validator_balances
:With no body:
With an empty array in the body:
I think that the best balance of attempting to retain existing functionality whilst firming up the spec is to state that no body will return an error, and an empty array will return all balances. This also ensures that users have a way to obtain all balances easily..