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

Add reference test for invalid deposit with unparsable public key #2986

Open
ajsutton opened this issue Sep 8, 2022 · 3 comments
Open

Add reference test for invalid deposit with unparsable public key #2986

ajsutton opened this issue Sep 8, 2022 · 3 comments

Comments

@ajsutton
Copy link
Contributor

ajsutton commented Sep 8, 2022

There doesn't appear to be any reference test that uses an unparsable public key in deposits. There's tests for invalid signatures but there are a few cases with public keys worth testing:

  1. An unparsable public key e.g. 0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  2. The infinite public key 0xc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
  3. A public key that's not part of the g1 group
@ajsutton
Copy link
Contributor Author

ajsutton commented Sep 9, 2022

It's probably also worth testing these with a single deposit and with the full 16 deposits. It can be useful to use batch signature verification since deposit signatures are usually valid but if any are invalid you have to go find the right one (which can be complicated by things like unparseable public keys). One vs multiple deposits did wind up making a difference in Teku.

@Nashatyrev
Copy link
Member

Nashatyrev commented Sep 9, 2022

It probably makes sense to add other cases:
4. Point which is not on the curve
E.g.
0x800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
5. (Supranational Blst implementation specific case) Point which is on curve, not in G1 group, but is reported as invalid during point construction (without P1_affine.in_group() call)
0x800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Also the sample for the case (3):
0x800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004

@Nashatyrev
Copy link
Member

Related spec PR: #2987

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@ajsutton @Nashatyrev and others