-
Notifications
You must be signed in to change notification settings - Fork 300
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
Change skip_randao_verification
param to string
#8338
Conversation
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
skip_randao_verification
param to string
...ain/java/tech/pegasys/teku/infrastructure/json/types/StringBasedPrimitiveTypeDefinition.java
Show resolved
Hide resolved
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.
Since we are not using it, and we never added this param to the previous API versions, I'd be tempted to solve this by removing the definition completely.
We added in V3 by just following the new API spec without really thinking about previous version.
The only side-effect is us printing a swagger which is not 100% compliant but I don't think it's a big deal in this case.
WDYT?
cc @rolfyone
maybe we could add a note in the descriptions saying that Teku doesn't verify the field
@@ -473,10 +489,24 @@ public EndpointMetaDataBuilder queryParam(final ParameterMetadata<?> parameterMe | |||
return this; | |||
} | |||
|
|||
public EndpointMetaDataBuilder queryParamAllowsEmpty( | |||
final ParameterMetadata<?> parameterMetadata) { |
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.
intelliJ suggesting to move to a dedicated method this snippet:
final String param = parameterMetadata.getName();
if (queryParams.containsKey(param)
|| queryParamsAllowEmpty.containsKey(param)
|| requiredQueryParams.containsKey(param)
|| queryListParams.containsKey(param)) {
throw new IllegalStateException("Query parameters already contains " + param);
}
makes sense to me
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.
oh i thought this was used somewhere - technically a list could be expressed as
validator_id=[1,2,3,4]
or validator_id=1&validator_id=2&validator_id=3&validator_id=4
if you really want to make your life difficult...
eg. https://medium.com/@AADota/spring-passing-list-and-array-of-values-as-url-parameters-1ed9bbdf0cb2
anyway - TL/DR, lets not do this.
tbh, I'm about not adding unnecessary code but since this is pretty much done and the changes required weren't too big I think there might be some value in keeping it in case any other param go through the same change. |
Signed-off-by: Gabriel Fukushima <[email protected]>
Signed-off-by: Gabriel Fukushima <[email protected]>
…rrently ignored by impl Signed-off-by: Gabriel Fukushima <[email protected]>
really depends on the beacon-api spec. |
"in" : "query", | ||
"schema" : { | ||
"type" : "string", | ||
"description" : "Skip verification of the `randao_reveal` value (currently ignored by Teku implementation). If this flag is set then the\n `randao_reveal` must be set to the point at infinity (`0xc0..00`). This query parameter\n is a flag and does not take a value", |
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.
there's a must here - do we care?
i'm wondering if we check that at all, im guessing not. i'd just truncate before 'if this flag is set'
Skip verification of the randao_reveal value. Ignored in the Teku implementation.
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.
I think we don't care based on this comment: ethereum/beacon-APIs#222 (comment). Cehcked the other impl blockV2 and blinded_block didn't care about this param.
Changed the description as you suggested.
…sn't use it Signed-off-by: Gabriel Fukushima <[email protected]>
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.
LGTM i think... im not sure where discussions landed but i think we could live with this in its current form.
I don't oppose to merge it. Just for the records: the reason why I'm not convinced is because in my opinion our swagger should reflect our functionalities. I think there is no point being compliant with swagger-doc and ignoring the underlying behaviour. But this is just an opinion and it isn't super strong, so go for it! |
Thanks everyone for the input! |
PR Description
This PR changes the
skip_randao_verification
to comply with the changes in ethereum/beacon-APIs#444 to a string flag like. The impact for us here is pretty much minimal since we ignore that param.Fixed Issue(s)
Fixes #8223
Documentation
doc-change-required
label to this PR if updates are required.Changelog