* chore: Move Codecov, wasm-build, Bitrot & doc-tests to push
This should cut down significantly the CI times on every push done to a
branch for a PR.
Resolves: #124
* chore: Add back `push` on CI checks
* feat: Add `name_column` to `Layouter` & `RegionLayouter`
This adds the trait-associated function `name_column` in order to enable
the possibility of the Layouter to store annotations aobut the colums.
This function does nothing for all the trait implementors (V1,
SimpleFloor, Assembly....) except for the `MockProver`. Which is
responsible of storing a map that links within a `Region` index, the
`column::Metadata` to the annotation `String`.
* feta: Update metadata/dbg structs to hold Col->Ann mapping
* feat: Update emitter module to print Column annotations
* feat: Add lookup column annotations
This adds the fn `annotate_lookup_column` for `ConstraintSystem` which
allows to carry annotations for the lookup columns declared for a
circuit within a CS.
* feat: Add Lookup TableColumn annotations
This allows to annotate lookup `TableColumn`s and print it's annotation
within the `assert_satisfied` fn.
This has required to change the `ConstraintSystem::lookup_annotations`
to have keys as `metadata::Column` rather than `usize` as otherwise it's
impossible within the `emitter` scope to distinguish between regular
advice columns (local to the Region) and fixed columns which come from
`TableColumn`s.
* fix: Customly derive PartialEq for metadata::Region
This allows to ignore the annotation map of the metadata::Region so that
is easier to match against `VerifyFailure` errors in tests.
* fix: Update ConstraintNotSatisfied testcase
* fix: Update Debug & Display for VerifyFailure
It was necessary to improve the `prover.verify` output also. To do so,
this required auxiliary types which are obfuscated to any other part of the lib
but that are necessary in order to be able to inject the Column names inside of
the `Column` section itself.
This also required to re-implement manually `Debug` and `Display` for this enum.
This closes#705
* fix: Address clippy & warnings
* fix: Add final comments & polish
* fix: Resolve cherry-pick merge conflics & errors
* chore: Change DebugColumn visibility
* chore: Allow to fetch annotations from metadata
* chore: Fix clippy lints
* chore: Remove comments from code for testing
* feat: Add support for Advice and Instance anns in lookups
* feat: Allow `V1` layouter to annotate columns too
* fix: Support `Constant` & `Selector` for lookup exprs
* chore: Address review comments
* chore: Propagete write! result in `VerifyFailure::Display`
* chore: Address clippy lints
* feat: read `VerifyingKey` and `ProvingKey` does not require `params` as
long as we serialize `params.k()`
* feat: add features "serde-raw" and "raw-unchecked" to
serialize/deserialize KZG params, verifying key, and proving key
directly into raw bytes in internal memory format.
So field elements are stored in Montgomery form `a * R (mod p)` and
curve points are stored without compression.
* chore: switch to halo2curves 0.3.1 tag
* feat: add enum `SerdeFormat` for user to select
serialization/deserialization format of curve and field elements
Co-authored-by: Jonathan Wang <jonathanpwang@users.noreply.github.com>
After working on fixing
privacy-scaling-explorations/zkevm-circuits#1024, a bug was found in the
verification fn of the MockProver which implies that while finding a
FailureLocation, if a Region doesn't contain any rows.
This is fixed by introducing a 2-line solution suggested by @lispc.
Resolves: #117
* feat: parallelize (cpu) shplonk prover
* shplonk: improve `construct_intermediate_sets` using `BTreeSet` and
`BTreeMap` more aggressively
* shplonk: add `Send` and `Sync` to `Query` trait for more parallelization
* fix: ensure the order of the collection of rotation sets is independent
of the values of the opening points
Co-authored-by: Jonathan Wang <jonathanpwang@users.noreply.github.com>
* fix: Support dynamic lookups in `MockProver::assert_verify`
Since lookups can only be `Fixed` in Halo2-upstream, we need to add
custom suport for the error rendering of dynamic lookups which doesn't
come by default when we rebase to upstream.
This means that now we have to print not only `AdviceQuery` results to
render the `Expression` that is being looked up. But also support
`Instance`, `Advice`, `Challenge` or any other expression types that are
avaliable.
This addresses the rendering issue, renaming also the `table_columns`
variable for `lookup_columns` as the columns do not have the type
`TableColumn` by default as opposite to what happens upstream.
* fix: Don't error and emit empty String for Empty queries
* feat: Add `assert_sarisfied_par` fn to `MockProver`
* fix: Address clippy errors
* chore: Address review comments
* chore: Fix clippy lints
Resolves: #116
* VerifyingKey Serialization: merge Nalin's PR
https://github.com/zcash/halo2/pull/661 that allows for vkey
serialization/deserialization and fixes the previous selector
optimization issue
* feat: add serialization & deserialization of pkey and vkey using serde
derive
* fix: add `num_fixed_commitments` to vkey serialization so correct number
of fixed columns, post selector compression, are read
* fix: serialize/deserialize pkey directly to/from file
* Update: implement suggestions for PR
* add `plonk::Error::Serde` to pass through serialization errors
* update: remove serialization from evaluation as we now recalculate directly
* fix: clippy warnings
* feat: implement `ProvingKey` serialization without using external crates
`serde` or `bincode`
* examples: add `serialization` example to test `ProvingKey` read and
write on "simple-example"
* feat: added `to/from_bytes` for `ProvingKey` and `VerifyingKey`
* add `pack`/`unpack` helper functions between `&[bool]` and `u8`
* made serialization example use smaller example of standard plonk for
less code bloat
Co-authored-by: Nalin Bhardwaj <nalinbhardwaj@nibnalin.me>