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(honk): Shared relation arithmetic #514

Merged
merged 4 commits into from
Jun 12, 2023

Conversation

ledwards2225
Copy link
Collaborator

@ledwards2225 ledwards2225 commented Jun 7, 2023

Description

Introduces a framework that allows the relation arithmetic to be shared between the prover and verifier.

The sumcheck prover and verifier accumulate the contributions from each relation (really, each sub-relation) into, respectively, Univariates and individual field elements. When performing relation arithmetic on Univariates, we introduce UnivariateViews to reduce full length Univariates to the minimum required length and to avoid unnecessary copies.

To share the relation arithmetic. we introduce simple structs that specify two types: Accumulators and AccumulatorViews. For the prover, who accumulates Univariates, these are respectively std::tuple<Univariate> and std::tuple<UnivariateView>. For the verifier, who accumulates FFs, both types are simply aliases for std::array<FF> (since no "view" type is necessary). The containers std::tuple and std::array are needed to accommodate multiple sub-relations within each relation, where, for efficiency, each sub-relation has its own specified degree.

Checklist:

  • I have reviewed my diff in github, line by line.
  • Every change is related to the PR description.
  • I have linked this pull request to the issue(s) that it resolves.
  • There are no unexpected formatting changes, superfluous debug logs, or commented-out code.
  • There are no circuit changes, OR specifications in /markdown/specs have been updated.
  • There are no circuit changes, OR a cryptographer has been assigned for review.
  • I've updated any terraform that needs updating (e.g. environment variables) for deployment.
  • The branch has been rebased against the head of its merge target.
  • I'm happy for the PR to be merged at the reviewer's next convenience.
  • New functions, classes, etc. have been documented according to the doxygen comment format. Classes and structs must have @brief describing the intended functionality.
  • If existing code has been modified, such documentation has been added or updated.

@@ -275,23 +275,6 @@ template <class FF, size_t ExtendedLength, std::size_t Length = 2> static conste
}
}

/**
Copy link
Collaborator Author

@ledwards2225 ledwards2225 Jun 7, 2023

Choose a reason for hiding this comment

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

Note: this was an earlier iteration of the method instantiate_barycentric_utils, defined just above, which is the one actually being used. This was never meant to go in and this is the first I'm noticing it so I'm deleting it in this unrelated PR.

@ledwards2225 ledwards2225 self-assigned this Jun 7, 2023
@ledwards2225 ledwards2225 marked this pull request as ready for review June 7, 2023 19:50
@ledwards2225 ledwards2225 linked an issue Jun 7, 2023 that may be closed by this pull request
@ledwards2225 ledwards2225 changed the title a working version of shared relation arithmetic Shared relation arithmetic Jun 7, 2023
@ledwards2225 ledwards2225 force-pushed the lde/share_relation_arithmetic branch from 8791ff1 to 552b185 Compare June 8, 2023 20:48
@kevaundray kevaundray changed the title Shared relation arithmetic feat(honk): Shared relation arithmetic Jun 12, 2023
@kevaundray
Copy link
Contributor

Since this only modifies honk related code -- marking this feature as non-breaking while the honk codepath not known to be used externally

@ledwards2225 ledwards2225 force-pushed the lde/share_relation_arithmetic branch from 552b185 to 267f67d Compare June 12, 2023 20:34
@ledwards2225 ledwards2225 merged commit 0838474 into master Jun 12, 2023
@ledwards2225 ledwards2225 deleted the lde/share_relation_arithmetic branch June 12, 2023 22:11
ludamad pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Jul 22, 2023
* a working version of shared relation arithmetic

* add RelationWrapper
ludamad pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Jul 24, 2023
* a working version of shared relation arithmetic

* add RelationWrapper
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.

Share Relation arithmetic between Prover/Verifier
3 participants