-
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
spec should be clear about validation of public keys #183
Comments
If the public key is invalid then yes I think that the API should return a To be clear, by invalid I mean "not a valid encoding of a public key" rather than "a public key not linked to a known validator". The latter should simply return no result for the given public key, which I believe is consistent behavior across all clients. |
The other question here is what invalid means. Is a key valid or invalid if it isn't on the g2 curve? |
True, a valid byte array not on the g2 curve we're treating as invalid, and I mean it technically is invalid, but is that what we want... |
There is no legitimate reason to pass a key that is not in the correct subgroup. We can refer to KeyValidate for the definition: https://datatracker.ietf.org/doc/html/draft-irtf-cfrg-bls-signature-04#section-2.5
Regarding the subgroup, we don't want to end up vulnerable to small subgroup attacks like Monero, see appendix (https://www.getmonero.org/2017/05/17/disclosure-of-a-major-bug-in-cryptonote-based-currencies.html ) |
I would stay clear of a mandatory on-point verification - making this verification is expensive CPU-wise, if the key is compressed which opens the server to trivial DoS attacks - in the current architecture, the key is just an array of bytes that you compare against known byte arrays and that's it. |
Validator ID in a query parameter should not be required to be on the g2 curve to be valid, any bytes48 should be allowed to be queried on. Reading in any bytes48 without validating against the g2 curve will reduce overheads of parsing large lists, and given that valid missing keys are just not returned, there are no real negatives to querying a key that will definitely be missing. fixes ethereum#183
ref. Consensys/teku#4787
Basically providing an invalid public key to teku as a filter will result in a 400 error, but it would appear not all clients are consistent on the handling of invalid query parameters.
This is probably the best spot to track any discussion on how these query parameters should be dealt with.
If you supply an invalid key, should a 400 error be returned? 400 in this api is described as 'invalid state or validator ID, or status'
The public key validation in my mind is akin to validating index '-1', which teku returns a 400 for, where as over the end of the array is at least a valid index value so it's just 'not found' in the list of validators...
The text was updated successfully, but these errors were encountered: