-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduces an `ExecutionTrace` class responsible for translating raw circuit data into the "execution trace polynomials", which I define as the wire, selector and permutation argument polynomials (sigma/id). This work was previously split across several different methods in the Composers/ProverInstance and much of the logic was duplicated between Plonk and Honk. That core logic is now shared across Plonk/Honk for all flavors. It is encapsulated into a single call of the form `Trace::generate(circuit, proving_key);` which takes the raw circuit data contained in `circuit` and populates the provided `proving_key` with wire, selector and sigma/id polynomials. The main work of the `ExecutionTrace` is to "sort" the relatively un-ordered raw circuit data. For example, for GUH, the ordering of the execution trace is (1) zero row, (2) goblin ecc op gates, (3) public inputs, and (4) conventional gates. Each one of these can be described as an `ExecutionTraceBlock` which is a {`wires`, `selectors`} pair. E.g. the conventional gates block is just the existing {`builder.wires`, `builder.selectors`}. The public inputs block has all of its selectors equal to zero, the first two wires equal to `builder.public_inputs`, and the remaining wires identically zero. And so on. Eventually, each gate type will have its own `ExecutionTraceBlock`. (I've rephrased the goblin ecc op gates as an ExecutionTraceBlock as an example). These blocks are constructed by the builder and "sorting" is achieved in `ExecutionTrace` by simply arranging the blocks as desired then constructing polynomials. From here, achieving a sorted execution trace should amount to introducing one `ExecutionTraceBlock` for each gate type in the builders, populating the appropriate block in each gate construction function (instead of piling everything into a single `wires`, `selectors`), then arranging those blocks to define the execution trace polynomials in `ExecutionTrace`. Closes AztecProtocol/barretenberg#808 Closes AztecProtocol/barretenberg#859 --------- Co-authored-by: ludamad <[email protected]>
- Loading branch information
1 parent
e84759f
commit 07ac589
Showing
27 changed files
with
771 additions
and
1,186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.