Commit Graph

757 Commits

Author SHA1 Message Date
str4d 1dff93a8ad
dev: Update documentation for constraint_name
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2021-06-04 23:12:55 +01:00
Jack Grigg 876587c818 Panic in ConstraintSystem::create_gate if it would contain no constraints
We use iterators to allow a gate to contain more than one constraint, but
it is a programming error for a gate to not contain any constraints.
2021-06-04 12:59:57 +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 ff2a500e9a dev: impl fmt::Display for VerifyFailure 2021-06-04 03:46:08 +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 e01fb15018 dev: Fix bug in cell assignment checker
The simple example was broken because it uses an instance column in a
gate. MockProver now assumes all instance cells are assigned to, since
this happens outside the circuit and outside its purview.
2021-06-04 02:56:35 +01:00
str4d 32cdcfa66f
Merge pull request #284 from zcash/doc-batch-invert-zero
Document that batch inversion in arithmetic.rs leaves zero as zero
2021-06-04 01:15:50 +01:00
Daira Hopwood e426fddd5e
Update arithmetic.rs 2021-06-04 00:17:05 +01:00
ebfull 3ff44d31a8
Merge pull request #283 from zcash/pasta-curves-0.1
`pasta_curves 0.1`
2021-06-01 17:18:09 -06:00
Jack Grigg c86b24f496 pasta_curves 0.1 2021-06-02 00:03:50 +01:00
Jack Grigg 8b94e3ad64 Bump MSRV to 1.51.0 2021-06-02 00:03:06 +01:00
str4d 0448584333
Merge pull request #278 from zcash/144-proof-encoding
book: Document encoding of proofs
2021-06-01 17:26:47 +01:00
Jack Grigg 7379e96a70 book: Use M for number-of-circuit-instances in proof encoding 2021-06-01 17:26:00 +01:00
str4d 256055c656
Merge pull request #279 from zcash/derive-eq
plonk::circuit : Derive Eq for Permutation
2021-06-01 17:20:05 +01:00
therealyingtong 684efbd6c1 plonk::circuit : Derive Eq for Permutation 2021-06-01 17:19:06 +01:00
str4d aac310c763
Merge pull request #274 from zcash/dev-check-cells-for-active-gates
MockProver: Check that cells for active gates are assigned to
2021-06-01 17:15:12 +01:00
str4d ea3d59756b
Merge pull request #273 from zcash/multiple-polys-per-gate
Allow multiple polynomial constraints per gate
2021-06-01 17:14:53 +01:00
str4d 845bf724ff
Merge pull request #272 from zcash/configure-api-changes
`Circuit` API changes
2021-06-01 17:14:39 +01:00
Jack Grigg 9a7f331f1b book: Document k constant in proof encodings 2021-06-01 14:05:33 +01:00
Jack Grigg 4b362669e4 book: Document encoding of proofs
Closes zcash/halo2#144.
2021-05-28 02:21:58 +01:00
Jack Grigg 081e353681 book: Move implementation notes about proofs into a subsection 2021-05-28 01:13:20 +01:00
str4d e4072e78ce
Merge pull request #234 from zcash/book-point-addition
[book] Point addition and compression background
2021-05-27 22:37:06 +01:00
str4d 36cd8633e2
book: Adjustments to point addition and compression sections 2021-05-27 18:43:24 +01:00
str4d 15c79bcd89
Merge pull request #260 from zcash/book-chip-refactor
[book] Remove core/chip abstraction
2021-05-27 18:23:25 +01:00
Jack Grigg 6dd3d1831b MockProver: Check that cells for active gates are assigned to 2021-05-27 18:10:23 +01:00
ebfull 78ca7d38ba
Merge pull request #276 from zcash/horners-rule
Use Horner's rule in `eval_polynomial()`
2021-05-27 10:53:35 -06:00
therealyingtong 5fc0e2a449 Cargo fmt 2021-05-28 00:40:39 +08:00
therealyingtong ea1af2c9c8 Use Horner's rule in eval_polynomial() 2021-05-28 00:32:18 +08:00
Jack Grigg 32896917d0 Add a failing test showing an undetected missed assignment 2021-05-27 15:02:01 +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 e19407a749 Expose selector enablement to the Assignment backends 2021-05-27 12:51:25 +01:00
Jack Grigg 52396aaffc Rename "virtual registers" to "virtual cells"
This name makes more sense at present, given the current API.
2021-05-27 12:08:58 +01:00
Jack Grigg f314fe0156 Track which "virtual registers" are queried for custom gates 2021-05-27 01:47:13 +01:00
Jack Grigg 6bf0803fd9 Add a plonk::Gate struct
This will make it easier to track additional gate-related metadata.
2021-05-27 01:25:22 +01:00
Jack Grigg 4a2d0a0287 Move query APIs from `ConstraintSystem` to a new `Registers` struct
This simplifies the API of `ConstraintSystem`, by only exposing query
APIs in the contexts they are required (during the creation of custom
gates or lookup tables).
2021-05-27 01:25:22 +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
therealyingtong ddde5f200c Remove unused Challenge trait. 2021-05-25 00:55:34 +08:00
ebfull 25564c3e94
Merge pull request #269 from zcash/ci-fixes
CI fixes
2021-05-18 13:58:48 -06:00
Jack Grigg d58fed183c Fix warnings due to clippy::unknown_clippy_lints being renamed
We can remove these workarounds once our MSRV is 1.51+.
2021-05-18 20:19:54 +01:00
Jack Grigg 1bc824091f CI: Test against same Rust version as rust-toolchain 2021-05-18 20:19:54 +01:00
Jack Grigg 7cb2e6a954 book: Fix CI failure 2021-05-18 20:19:31 +01:00
str4d 318f2057d8
Merge pull request #268 from zcash/dev-all-failures
MockProver: Return all constraint failures, not just first
2021-05-18 20:11:34 +01:00
Jack Grigg 266badf25c MockProver: Return all constraint failures, not just first 2021-05-18 16:32:15 +01:00
str4d 7f451a0c64
Merge pull request #261 from zcash/fix-mockprover-lookup
[MockProver] Handle query rotations in lookups
2021-05-18 15:26:37 +01:00
str4d de883a4b8b
Formatting fixes 2021-05-18 15:26:23 +01:00
str4d c0e23e6d56
Merge pull request #225 from zcash/cost-model
examples: Add cost model
2021-05-18 15:19:35 +01:00