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

Explicitly validate public key when processing Deposit #2987

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from

Conversation

Nashatyrev
Copy link
Member

Deposits are the only source of non-validated public keys, so suggesting to add explicit public key validation statement to process_deposit function.

bls.Verify function (and its batch variants) is a bit ambiguous in the case if BLSPubkey is not valid (either invalid serialization or outside of the curve or outside of the group): whether it should return false or throw an error.

In all other cases (besides process_deposit) bls.Verify can't receive an invalid BLSPubkey since all of them come from the state and are inherently valid. Reasoning that way it could make sense to throw error if invalid pubkey is passed to bls.Verify since it would mean kind of fatal implementation error. In that case suggested implicit public key validation makes sense.

@Nashatyrev Nashatyrev marked this pull request as draft September 9, 2022 05:04
Copy link
Collaborator

@dapplion dapplion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Being explicit about this detail makes sense to me 👍

@hwwhww
Copy link
Contributor

hwwhww commented Sep 14, 2022

It looks fine to me, but I hope to get more reviews 👀 before we modify the phase0 spec.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
general:RFC Request for Comments phase0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants