Commit Graph

1091 Commits

Author SHA1 Message Date
Las Safin 1613445cdb
Fix compilation with rustc 1.57.0
The type inference algorithm seems to have been simplified,
meaning that the combination of T::from(x.into()) doesn't work anymore.

In any case, the code was also incomprehensible to a human, as it's not clear
by which "route" it does the transformation. It took me a few minutes to
figure out it's a `u64`.
2022-01-20 16:24:33 +00:00
str4d eb74bf6ccb
Merge pull request #447 from zcash/poly-ast-evaluator
Add `poly::Evaluator` for building polynomial operation ASTs
2022-01-20 01:42:57 +00:00
Jack Grigg 2102824599 Remove unused `Polynomial` operations with internal parallelism
These have been replaced by operations on either `poly::Ast` nodes, or
operations directly on chunks of polynomials within a higher-level
parallelism context.

Addition and scalar multiplication are (currently) still used in various
areas of the prover, so those are left in place.
2022-01-20 01:35:24 +00:00
Jack Grigg b3b783e0f4 Switch `poly::Ast` from `Box` to `Arc`
This saves a bunch of `Clone`s and `Drop`s, which were consuming
significant amounts of time in large circuits (Orchard), which meant we
didn't save as much time as we could :)
2022-01-19 21:00:18 +00:00
Jack Grigg 556bb66a47 Parallelize `poly::Evaluator`
We now traverse `poly::Ast` `num_chunks + 1` times: once to collect the
polynomial rotations we need, and then once per chunk.
2022-01-17 14:01:44 +00:00
Jack Grigg 3c757dc593 Migrate `vanishing::Argument` to `poly::Evaluator` 2022-01-17 14:01:44 +00:00
Jack Grigg b7ea224389 Migrate `lookup::Argument::commit_permuted` to `poly::Evaluator` 2022-01-17 13:51:34 +00:00
Jack Grigg 77af83697c Add `poly::Evaluator` for building polynomial operation ASTs
Co-authored-by: Sean Bowe <sean@electriccoin.co>
2022-01-17 13:51:27 +00:00
str4d 6630a143c1
Merge pull request #450 from zcash/update-deps
Migrate to pasta_curves 0.3 and blake2b_simd 1
2022-01-05 08:03:53 +00:00
Jack Grigg deabd62eee Migrate to pasta_curves 0.3 and blake2b_simd 1 2022-01-05 02:45:51 +00:00
str4d f9b3ff2aef
Merge pull request #433 from zcash/mockprover-failure-locations
dev: Enable `VerifyFailure::ConstraintNotSatisfied` to point to region offsets
2022-01-04 14:06:28 +00:00
str4d f565883db0
Merge pull request #448 from zcash/dev-fill-from-row
[dev] Implement `Assignment::fill_from_row()` for `MockProver`.
2022-01-04 13:12:55 +00:00
therealyingtong fe75ceee28 dev::bad_lookup test: Fix lookup expression. 2022-01-04 14:23:08 +08:00
therealyingtong 7f526f01e6 dev: Implement fill_from_row() for MockProver. 2022-01-04 14:23:08 +08:00
therealyingtong 3d22943ebe dev::bad_lookup test: Do not assign zero in lookup table.
We now expect the lookup to fail when q = 0, but it still passes,
revealing a bug in the MockProver.
2022-01-04 14:23:08 +08:00
str4d d062072366
Merge pull request #424 from zcash/fix-assigned
Fix `Assigned<F>` implementation
2022-01-03 22:09:51 +00:00
str4d 6ffe61fd81
Add some extra `Assigned<F>` test cases
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-01-03 17:00:47 +00:00
str4d b5adc3843d
Fix comments in `Assigned<F>` tests
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-01-03 16:50:29 +00:00
str4d d57c530d99
Merge pull request #444 from zcash/more-pasta-prep
More preparations for `pasta_curves 0.3`
2022-01-03 13:26:51 +00:00
str4d 408b617376
Merge pull request #397 from rex4539/typos
Fix typos
2021-12-31 14:14:34 +00:00
Daira Hopwood 5614b076b9
Merge pull request #446 from HAOYUatHZ/patch-1
fix typos
2021-12-29 19:54:38 +00:00
HAOYUatHZ 5a65c7b77b
fix typos 2021-12-29 15:00:32 +08:00
ying tong 3cd7a141cc
Merge pull request #442 from zcash/therealyingtong-patch-1
[book] Fix SHA256 interpolation polynomial
2021-12-29 09:22:37 +08:00
Jack Grigg 1556489a9f Remove usage of `FieldExt::rand`
All APIs now take `R: RngCore` arguments instead of internally depending
on `rand::rngs::OsRng`.
2021-12-25 13:41:39 +00:00
Jack Grigg 9297a938ab Remove `FieldExt::from_u64` usage from SHA-256 example 2021-12-25 13:34:36 +00:00
ying tong 2ab6e1b0d6
[book] Fix SHA256 interpolation polynomial
Closes #434
2021-12-23 22:07:09 +08:00
str4d af8e0d619a
Merge pull request #432 from zcash/381-rename-verifyfailure-cell
Rename `VerifyFailure::Cell` to `VerifyFailure::CellNotAssigned`
2021-12-21 15:33:08 +00:00
Jack Grigg 558e03aa93 dev: Enable `VerifyFailure::ConstraintNotSatisfied` to point to region offsets 2021-12-21 03:00:16 +00:00
Jack Grigg 5520d13480 dev: Move reusable logic onto `FailureLocation` 2021-12-21 02:56:39 +00:00
Jack Grigg 54125fbc8c dev: Rename `LookupFailure` to `FailureLocation` 2021-12-21 02:56:39 +00:00
str4d 3f53d9f6bd
Merge pull request #431 from zcash/mockprover-improve-lookup-error
Improve `dev::VerifyFailure::Lookup` information
2021-12-20 22:39:33 +00:00
Jack Grigg 28489d03ad Rename `VerifyFailure::Cell` to `VerifyFailure::CellNotAssigned`
Closes zcash/halo2#381.
2021-12-20 14:45:56 +00:00
Jack Grigg cbe4d05002 dev: Match lookup failures to regions
This currently matches the first region on the row that matches any
input column, which will result in some mismatches. To fix this, we will
need to track the columns of complex selectors.
2021-12-20 13:16:55 +00:00
Jack Grigg 3843c11e82 dev: Enable `VerifyFailure::Lookup` to point to region offsets 2021-12-20 13:16:55 +00:00
Carlos Pérez 8cedfe89de
Change to `Into<Column<Any>>` for pub API methods (#416)
Resolves: zcash/halo2#345
2021-12-15 17:05:31 +00:00
str4d c19423766b
Merge pull request #415 from ChihChengLiang/hint-on-meta-enable-equality
improve error message on ColumnNotInPermutation
2021-12-15 16:52:22 +00:00
Jack Grigg bb7b132530 Fix addition of `Assigned::Rational`
If the rational would evaluate to zero, we need to ignore it instead of
using its denominator in normal rational addition equations. This fixes
the tests we added in the last two commits.
2021-12-10 23:41:17 +00:00
Jack Grigg 8be0c6fa08 Add commutativity proptest for `Assigned<F>`
This tests that deferring inversions gives the same result as eagerly
evaluating them. Currently, it does not :)
2021-12-10 18:31:31 +00:00
str4d 18e13b1d09
Merge pull request #422 from zcash/ci-benchmark-tweaks
CI: Benchmark tweaks
2021-12-09 20:35:40 +00:00
Jack Grigg c4cc5dd516 Add operator tests on `Assigned` for cases including `1/0`
The tests for addition and subtraction expose a bug in the addition
implementation, which does not correctly handle the `1/0 -> 0` map that
`inv0` is defined to perform.
2021-12-09 15:16:52 +00:00
Jack Grigg 0353e4c402 Move `Assigned<F>` into a separate module
This doesn't alter the public crate API; it's just to make it easier to
manage the struct implementation.
2021-12-09 14:52:23 +00:00
Jack Grigg 55364f0d99 CI: Fix benchmark collection
The benchmark action's "cargo" tooling assumes the standard bencher
output format, and can't parse criterion's output. Fortunately,
criterion can also provide bencher output for compatibility.

In order to pass criterion flags via `cargo bench`, we need to ensure
that all benchmarks use it (otherwise the flags are rejected by the
built-in benchmark harness as unknown). Since we don't actually have any
benchmarks inside the library itself, we simply disable its benchmark
harness.
2021-12-08 22:25:40 +00:00
Jack Grigg 858838bcf8 bench: Tidy up PLONK benchmark
- Added keygen benchmark.
- Refactored to extract common prover and verifier logic.
- Benchmarks are now grouped.
- Prover (and keygen) benchmarks now only take 10 samples instead of 100
  (to make them feasible to collect in CI).
2021-12-08 22:25:40 +00:00
str4d e1b3c79c2c
Merge pull request #421 from zcash/ci-benchmarks
CI: Add benchmarks workflow
2021-12-08 20:29:39 +00:00
Jack Grigg 001494b4fe CI: Add benchmarks workflow
The workflow will comment on commits that cause a performance regression
of at least 200% (e.g. proving taking twice as long); we'll tune this as
we figure out how well benchmarking works on standard GitHub builders.
2021-12-08 20:24:30 +00:00
ChihChengLiang 08288845fe improve error messgae on ColumnNotInPermutation 2021-12-03 23:38:57 +08:00
str4d 0295dc724b
Merge pull request #413 from zcash/sha256-assignedcell-fix
sha256: Fix `AssignedCell` `From` impls for `AssignedBits` and `Bits`
2021-12-03 04:24:50 +00:00
Jack Grigg a62f9451d1 sha256: Fix `AssignedCell` `From` impls for `AssignedBits` and `Bits`
zcash/halo2#337 had been updated to account for `AssignedCell`, before
the change to simplify its bounds was made. `AssignedCell` now requires
the `From` impls to take `&VR`.
2021-12-03 02:53:14 +00:00
str4d 2a7985014b
Merge pull request #337 from zcash/fix-sha256
Update sha256 example to work with new API
2021-12-03 02:41:53 +00:00
ebfull f89135fd1d
Merge pull request #409 from zcash/beta-lints
Fix various clippy lints from beta toolchain
2021-12-02 10:48:49 -07:00