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

EIP4844: Handle barycentric evaluation at roots of unity #3214

Merged
merged 4 commits into from
Jan 17, 2023

Conversation

asn-d6
Copy link
Contributor

@asn-d6 asn-d6 commented Jan 16, 2023

evaluate_polynomial_in_evaluation_form() used to panic if the input is a root of unity because it was only used with random inputs and it was extremely extremely unlikely that the input would be a root of unity.

However, now we are exposing compute_kzg_proof() as a public function (which uses evaluate_polynomial_in_evaluation_form()) and we don't want it to have such restrictions.

This patch allows evaluate_polynomial_in_evaluation_form() to return the right answer without panicking. I also added unittests both for this edge case but also for the normal use of the barycentric formula.

c-kzg-4844 already implements this behavior, but other libraries should do the same.

Copy link
Contributor

@hwwhww hwwhww left a comment

Choose a reason for hiding this comment

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

LGTM! Good tests and comments!

@hwwhww hwwhww added the Deneb was called: eip-4844 label Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deneb was called: eip-4844
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants