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

feat: Use FFT to encode polynomials in eval form #385

Merged
merged 8 commits into from
Oct 19, 2023
Merged

feat: Use FFT to encode polynomials in eval form #385

merged 8 commits into from
Oct 19, 2023

Conversation

ggutoski
Copy link
Contributor

@ggutoski ggutoski commented Oct 13, 2023

Description

closes: #384
closes: #313

Tests are currently trivial due to lack of proper namespace API.


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (main)
  • Linked to GitHub issue with discussion and accepted design OR have an explanation in the PR that describes this work.
  • Wrote unit tests
  • Updated relevant documentation in the code
  • Added a relevant changelog entry to the Pending section in CHANGELOG.md
  • Re-reviewed Files changed in the GitHub PR explorer

@ggutoski ggutoski changed the title Use FFT to encode polynomials in eval form feat: Use FFT to encode polynomials in eval form Oct 13, 2023
// TODO TEMPORARY: enforce power-of-2 chunk size
// Remove this restriction after we get KZG in eval form
// https://github.com/EspressoSystems/jellyfish/issues/339
if payload_chunk_size != eval_domain.size() {
Copy link
Contributor

Choose a reason for hiding this comment

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

If payload_chunk_size is smaller. Could we simply padding zero here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. The FFT pads with zero up to the next power of 2. This wouldn't be a problem except it screws up recovery. For a degree d polynomial I need next_power_of_2(d) points to interpolate, so we're essentially forced to use a power of 2 degree anyway. This PR is intended to be a temporary stop-gap, so I decided that it's best for now to simply enforce a power-of-2 degree at construction. This sanity check is merely a redundant backup check on the constructor.

@ggutoski ggutoski merged commit 5c74b9a into main Oct 19, 2023
3 checks passed
@ggutoski ggutoski deleted the gg/384 branch October 19, 2023 17:32
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

Successfully merging this pull request may close these issues.

T1: Use FFT to encode polynomials in evaluation form Take FFT advice arg to avoid recomputing FFT domains
3 participants