Commit Graph

72 Commits

Author SHA1 Message Date
Jack Grigg 4c5a830e5c Use constants API in simple-example 2021-07-21 09:31:27 +08:00
Sean Bowe ef01b9310a
Fix examples broken by verifier API changes. 2021-07-14 09:47:53 -06:00
Sean Bowe 3942d4e2e8
(examples) Specify row when calling expose_public in simple-example. 2021-07-10 08:13:24 -06:00
Sean Bowe 0766983686
Fix examples to account for public input API changes. 2021-07-08 15:32:56 -06:00
Sean Bowe fe215d153d
Update tests with API changes for public inputs and permutation argument. 2021-07-08 15:32:51 -06:00
str4d 93aabf26c6
Merge pull request #310 from zcash/clippy-capitalized-acronyms
clippy: Fix capitalized acronyms in tests and examples
2021-06-23 16:28:38 +01:00
Jack Grigg e262941b70 clippy: Fix capitalized acronyms in tests and examples 2021-06-23 13:33:04 +01:00
Jack Grigg 32edf65efa dev: Refactor VerifyFailure to extract metadata structs 2021-06-23 13:16:20 +01:00
Jack Grigg 6d0017f47c Introduce a FloorPlanner trait and integrate it into the Circuit trait
This is the beginning of the process to enable full floor planning
capabilities in `halo2`. For now, all that a floor planner can do is
synthesize a circuit, which makes it no more powerful than a layouter,
but easier to use (as moving to a multi-pass layouter no longer requires
changes to `Circuit::synthesize`).
2021-06-22 23:47:17 +01:00
Jack Grigg 1b04877b3d Migrate PLONK-gate-using circuits to use SingleChipLayouter
These were all early examples that used the Circuit trait without any
layouter, which is incompatible with upcoming changes.

The minimal change to the PinnedVerificationKey is because the lookup
table is being allocated at the top of its columns instead of in-place.
2021-06-22 00:22:12 +01:00
Jack Grigg 3e82c7b232 dev: Move halo2::dev::circuit_layout to halo2::dev::CircuitLayout::render
This makes it easier to add configuration to the renderer.
2021-06-08 12:13:18 +01:00
str4d d8e4f24df4
Merge pull request #287 from zcash/remove-selector-rotations
Remove rotations from Selectors
2021-06-05 23:36:37 +01:00
Jack Grigg 0d8b3bab38 Remove rotations from Selectors
Enabling selectors to be used in gates at non-zero rotations leads to
confusing gates, and inhibits our ability to create visualizations of
circuits. In most cases, a gate can be rearranged so that the selectors
have no rotation; in cases where cross-gate selector optimisations are
required, these can still be implemented using fixed columns.
2021-06-04 16:18:51 +01:00
Jack Grigg 6cf73391e8 Enable annotating individual constraints within gates
The closure passed to `ConstraintSystem::create_gate` can now return:

- Tuples of `(&'static str, Expression<F>)`
- Anything implementing `IntoIterator` (e.g. `Some(Expression<F>)`)
2021-06-04 03:49:21 +01:00
Jack Grigg 47061ade3d dev: Report indices of unsatisfied constraints
Now that gates may contain multiple constraints, we need to inform
developers about which specific constraints are failing within gates.
2021-06-04 03:46:08 +01:00
Jack Grigg 0f0dd8a26c Allow multiple polynomial constraints per gate
This enables a gate such as ECC complete addition to define its
constraints in terms of a common set of queried columns.
2021-05-27 15:01:46 +01:00
Jack Grigg 353a07cef1 `ConstraintSystem::lookup`: Move lookup queries into a closure
This matches `ConstraintSystem::create_gate`.

At the same time, we bind the input and table expressions together as a
"table map" by requiring the closure to return a vector of tuples. This
ensures they are always the same length.
2021-05-27 00:53:31 +01:00
str4d d62afb19ac
Merge pull request #256 from zcash/fix-sha256-chip-config
Fix `sha256` example for new config abstraction
2021-05-26 23:01:19 +01:00
Jack Grigg 80993da1e6 cargo fmt 2021-05-26 22:52:03 +01:00
str4d da465bb718
examples: Remove some unnecessary clones 2021-05-26 22:49:18 +01:00
ebfull 870a2f1e8a
Merge pull request #242 from zcash/challenge-space
Add support for full-field challenge space
2021-05-24 11:11:30 -06:00
Jack Grigg 266badf25c MockProver: Return all constraint failures, not just first 2021-05-18 16:32:15 +01:00
Jack Grigg f3120ea2d5 examples: Add verification time estimator 2021-05-18 13:54:05 +01:00
Jack Grigg f53ab478f6 examples: Add cost model for estimating proof sizes 2021-05-18 13:54:05 +01:00
therealyingtong fe2ab0bc7b Fix SHA256 example 2021-05-14 21:20:53 +08:00
therealyingtong 502f0c85dc Input as associated type on EncodedChallenge
Use Input as an associated type instead of a type parameter, to
reduce infection

Co-authored-by: Sean Bowe <ewillbefull@gmail.com>
2021-05-07 22:21:54 +08:00
therealyingtong 6f199d3b2f [tmp] Block quote SHA256 example 2021-05-04 11:14:32 +08:00
therealyingtong 32f011d52d Replace ChallengeSpace with EncodedChallenge API
Co-authored-by: Sean Bowe <ewillbefull@gmail.com>
2021-05-01 09:30:08 +08:00
therealyingtong f3021beda6 Clean up anchors in simple-example.rs
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-04-28 12:36:37 +08:00
therealyingtong 21aaab20f6 Remove empty() methods from Config and Loaded traits
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-04-28 10:47:26 +08:00
therealyingtong 7524c95547 Clippy fixes 2021-04-26 08:53:43 +08:00
therealyingtong cd3cc543cf Update examples and tests 2021-04-23 19:18:41 +08:00
therealyingtong 03da010d6a [tmp] Comment out sha256 example 2021-04-23 17:40:43 +08:00
therealyingtong 3ad1c43fb8 Only keep config() and loaded() generic on Chip trait
Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-04-23 17:40:43 +08:00
therealyingtong 40e7bec352 Move config responsiblities from Layouter to Chip trait 2021-04-23 17:40:43 +08:00
Jack Grigg a130edaade Remove metrics crate and inline modelling
It is causing problems in (some) downstream crates, and we won't want
these annotations in the codebase anyway if a downstream crate is
collecting metrics. We'll be replacing this with the cost model binary
in https://github.com/zcash/halo2/pull/225 shortly.
2021-03-03 23:13:34 +00:00
Jack Grigg a688c8b03d sha256: Fix / silence lints 2021-02-25 20:34:07 +00:00
Jack Grigg e41fd7ca12 Move SHA-256 gadget and chip into examples 2021-02-25 20:01:44 +00:00
Jack Grigg ed26c8924c Use Selector in simple-example 2021-02-25 15:40:49 +00:00
str4d 9467a03ae2
Merge pull request #209 from zcash/ecc-gadget-fixedpoints
Store `Loaded` chip state in chip
2021-02-26 04:24:28 +13:00
therealyingtong 4f17322c2d Allow Chip::load to return state that the Layouter will hold
This enables chips that e.g. want to load multiple lookup tables into
the same columns to store state about where each table was layed out.

Co-authored-by: Jack Grigg <jack@electriccoin.co>
2021-02-24 23:28:18 +08:00
therealyingtong 4ae21a905d Update tests 2021-02-24 00:21:12 +08:00
therealyingtong 5a341b0f8f Modify Assignment::copy() to take Column<Any> instead of usize 2021-02-24 00:18:22 +08:00
therealyingtong d82a0c85b1 Modify Assignment::copy() to take Permutation instead of usize 2021-02-24 00:17:29 +08:00
therealyingtong 340fb2b6df Move Permutation struct from crate::circuit -> plonk::circuit 2021-02-24 00:17:29 +08:00
Jack Grigg b4ed5295fe Migrate to group traits
The `Curve` trait is now `CurveExt: group::prime::PrimeCurve`, and
`CurveAffine` is now `CurveAffine: group::prime::PrimeCurveAffine`.

There is no `CurveAffine` trait in `group`, and it's a widely-used
trait in this crate, so we don't rename it to `CurveAffineExt`.
2021-02-22 20:20:23 +00:00
therealyingtong d8534e1c50
Pass Expressions to meta.lookup() 2021-02-18 15:41:35 -07:00
therealyingtong a19dc68dee Use Column<Any> in Permutation::Argument 2021-02-17 21:32:17 +08:00
Daira Hopwood 760d69bd2c Rename "auxiliary column" to "instance column" in the book and in code. fixes #181
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2021-02-14 21:09:49 +00:00
ebfull 9fc45ad11e
Merge pull request #163 from zcash/region-helpers
Helpers for implementing regions
2021-02-12 10:03:39 -07:00