-
Notifications
You must be signed in to change notification settings - Fork 129
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
Remove the dependency on VirtualCells
to query cells from columns
#144
Comments
I like this TBH. Indeed I just feel that we should have some sepparated entity that makes is easier to simply obtain expressions. Have you considered any solution design specifically? |
(reposting this comment). TL;DR:
|
About the functionality of
|
We have some WIP code here: taikoxyz#1. This currently exposes some extra functions on the I'm not sure if this will be sufficient to be as flexible as possible with Expressions, but it's a start and should be easy to add additional API calls if necessary. |
Yes that makes a lot of sense, better than What do you think about the ability to submit gates without a closure? |
Would maybe be cleaner, but because some other abstraction (like the ConstraintBuilder) should already be used to collect all constraints I'm not sure if it's worth changing. That helper object will simply submits all constraints in a single |
Agree, moving the queries out is the important bit. Do you intend to return a Query, or Expression(Query)? The difference is that the query is what the synthesis needs in order to assign a cell (with a rotation abstraction instead of hard-coded offsets). So we would want it available. Then Expression can be obtained by an expr method. So:
|
Just the |
If ConstraintBuilder returns Query, this is easily wrapped into Expression::Advice(query), depending which one the app wants at this place. But the reverse is not true, an Expression cannot always be unwrapped into query. |
Resolved by #154 |
…-hk/dev-feature/gl-96-gen-point-witness Generalize the point-witnessing part of the Ecc Chip This is part of the SOW task of generalizing the Ecc Chip to Pluto. Generalize the point check in `halo2_gadgets::ecc::chip::witness_point` to arbitrary curves $y^2=x^3+ax+b$, where $a = 0.$
…-hk/dev-feature/98-gen-fbsm Generalize fbsm part of Ecc Chip # Project Context Part of the SOW task of generalizing the Ecc Chip to Pluto. This builds on top of privacy-scaling-explorations#144. The corresponding Galois internal issue is [Galois#98](https://gitlab-ext.galois.com/iog-midnight/halo2/-/issues/98). # Issue Description This issue is concerned with generalizing the fixed-base scalar-mul (fbsm) part of the Ecc Chip to arbitrary curves. Besides generalizing all of the types, and adding tests for all supported curves, the major technical task is to generalize the canonicity check on the windowed scalar decomposition: this canonicity check ensures that the decomposition of the scalar into 3-bit windows is correct. This is a "range check" type task, similar to existing range checks in variable-base scalar mul. See the Halo 2 Book [chapter on fbsm](http://localhost:3000/design/gadgets/ecc/fixed-base-scalar-mul.html) for details. # Notes to Reviewers * The canonicity check is generalized in ["Generalize canonicity check using 3-high-low decomp"](input-output-hk/galois_recursion@f8d2927) (with corresponding book updates in ["[book] fbsm: generalize, and document simplified canonicity check"](560a7d3b9af6df3031584acce4d80c119388df60)). This is the second example application of the [$K$-high-low decomp](privacy-scaling-explorations#114), and again we see a bunch of complex, bespoke range checking being replaced by a conceptually simple use of the decomp gadget :) * The fbsm works by precomputing a table of multiples of a fixed base, and then using the values to improve the efficiency (constraint complexity / proof burden) of multiplying the fixed base by scalars. This precomputation is very expensive, already taking 1+ hours for Pallas. For Pluto/Eris the precomputation time jumps to 17+ hours, which makes running the tests impractical. However, in a later PR (privacy-scaling-explorations#147), we cache the precomputation for the test bases to disk, which reduces the test time to a few minutes. * This PR includes a simple custom gate, that replaces the more complex custom gate for the old canonicity check. The new custom gate should be replaced by calls to the [gen arith gate](input-output-hk/galois_recursion#58) once that's available.
…-hk/dev-feature/53-gen-eccc Implement Ecc Chip for Pluto ... and Vesta and Eris # Project Context This issue corresponds to the Milestone 3 updated SOW task "New: Extend EccChip to support Pluto". There is no corresponding GitHub issue, since this is the Pluto/Eris analog of supporting Pallas, which was the starting state. However, the work for this issue overlaps significantly with SOW task "zcash#578: Extend EccChip to support ~~Vesta~~ Eris" ([zcash#578](zcash#578)), since it seems easiest to just generalize to all curves at the same time. So, while we only need to ensure Pluto support for Milestone 3, the strategy we're using also gives Eris and Vesta support "for free". This builds on top of privacy-scaling-explorations#145 directly, depends directly on privacy-scaling-explorations#143 and privacy-scaling-explorations#144 as well, and is the culmination of generalization work that started at a lower level with privacy-scaling-explorations#101, privacy-scaling-explorations#107, and privacy-scaling-explorations#114. The corresponding Galois internal issue is [Galois#53](https://gitlab-ext.galois.com/iog-midnight/halo2/-/issues/53). # Issue Description Generalize the Ecc Chip to arbitrary curves, allowing any assumptions that apply to all of Pallas, Vesta, Pluto, and Eris. This work is broken up into several subtasks, concerned with updating the major components of the Ecc Chip ([vbsm](privacy-scaling-explorations#143), [fbsm](privacy-scaling-explorations#145), and [point witnessing](privacy-scaling-explorations#144)), along with the final work here of updating the full Ecc Chip to use all of the updated components, have tests for all curves, and provide instantiations for all curves. Behind the scenes there are various traits associated with the vbsm and fbsm generalizations, but the final Ecc Chip interface exposes `EccCurve` and `EccField` as the traits required for curves and fields used with Ecc Chip (and of course these traits are implemented for Pallas, Vesta, Pluto, Eris, and their fields).
Some discussion here: privacy-scaling-explorations/zkevm-circuits#1115 (comment)
It's pretty inconvenient to have to go through a mutable
VirtualCells
object to be able to queryExpression
s from columns. When building a circuits we only care about the column, the relative offset and the phase. This is just simple data that does not depend on any internal circuit data inVirtualCells
. The requirement to query fromVirtualCells
is only there because it's used to set the query index, but that is something that can be done just as well when these expressions are submitted to halo2.The text was updated successfully, but these errors were encountered: