2021-01-22 15:54:31 -08:00
|
|
|
# Changelog
|
|
|
|
All notable changes to this project will be documented in this file.
|
|
|
|
|
|
|
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
|
and this project adheres to Rust's notion of
|
|
|
|
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
|
|
|
|
|
## [Unreleased]
|
2023-03-21 16:45:12 -07:00
|
|
|
|
|
|
|
## [0.3.0] - 2023-03-21
|
2023-02-24 10:54:02 -08:00
|
|
|
### Breaking circuit changes
|
|
|
|
- `halo2_proofs::circuit::floor_planner::V1` was relying internally on the Rust
|
|
|
|
standard library's [`slice::sort_unstable_by_key`]; while it is deterministic,
|
|
|
|
it is not stable across targets or compiler versions. In particular, an edge
|
|
|
|
case within the sorting algorithm differed between 32-bit and 64-bit targets.
|
2023-03-10 16:21:03 -08:00
|
|
|
This meant that some circuits (like the [Orchard circuit]) would be laid out
|
2023-02-24 10:54:02 -08:00
|
|
|
differently, resulting in incompatible verifying keys. This release makes a
|
|
|
|
**breaking change** to the behaviour of `floor_planner::V1` to instead use a
|
|
|
|
stable sort.
|
|
|
|
- To retain compatibility with the Orchard circuit as deployed in [Zcash NU5],
|
|
|
|
a new `floor-planner-v1-legacy-pdqsort` feature flag has been added. When
|
|
|
|
enabled, `floor_planner::V1` instead pins its behaviour to the version of
|
|
|
|
`slice::sort_unstable_by_key` from Rust 1.56.1, always matching how that
|
|
|
|
version behaved on 64-bit targets.
|
|
|
|
|
|
|
|
[`slice::sort_unstable_by_key`]: https://doc.rust-lang.org/stable/std/primitive.slice.html#method.sort_unstable_by_key
|
|
|
|
[Orchard circuit]: https://github.com/zcash/orchard/blob/0.3.0/src/circuit.rs
|
|
|
|
[Zcash NU5]: https://zips.z.cash/zip-0252
|
|
|
|
|
2022-11-29 21:05:37 -08:00
|
|
|
### Added
|
2022-10-18 13:09:10 -07:00
|
|
|
- The following structs now derive the `Eq` trait:
|
|
|
|
- `halo2_proofs::dev`:
|
2023-03-21 16:45:12 -07:00
|
|
|
- `TracingFloorPlanner` extension type which is a floor planner that uses
|
|
|
|
`tracing` spans and events for instrumenting your circuit synthesis
|
|
|
|
during keygen and proving.
|
2022-10-18 13:09:10 -07:00
|
|
|
- `failure::FailureLocation`
|
|
|
|
- `failure::VerifyFailure`
|
|
|
|
- `metadata::Gate`
|
|
|
|
- `metadata::Constraint`
|
|
|
|
- `metadata::Region`
|
|
|
|
- `halo2_proofs::poly::Rotation`
|
2022-11-29 18:42:32 -08:00
|
|
|
- `halo2_proofs::arithmetic::FftGroup`
|
2023-02-28 06:52:36 -08:00
|
|
|
- `halo2_proofs::circuit`:
|
|
|
|
- `Region::instance_value`, to provide access to instance values within a
|
|
|
|
region. This method is only provided for convenience; it does not create any
|
|
|
|
constraints. Callers still need to use `Region::assign_advice_from_instance`
|
|
|
|
to constrain the values in their circuit.
|
2022-06-23 10:40:23 -07:00
|
|
|
|
2022-11-29 16:12:17 -08:00
|
|
|
### Changed
|
2022-12-05 20:55:21 -08:00
|
|
|
- Migrated to `ff 0.13`, `group 0.13`, `pasta_curves 0.5`.
|
2022-11-29 16:12:17 -08:00
|
|
|
- APIs with `F: pasta_curves::arithmetic::FieldExt` bounds have been changed to
|
|
|
|
use `ff` traits directly.
|
2022-11-29 18:42:32 -08:00
|
|
|
- `halo2_proofs::arithmetic`:
|
|
|
|
- `best_fft, recursive_butterfly_arithmetic` now use the `FftGroup` trait
|
|
|
|
instead of the (now-removed) `pasta_curves::arithmetic::Group` trait.
|
2023-02-28 06:52:36 -08:00
|
|
|
- `halo2_proofs::circuit::layouter`:
|
|
|
|
- The `RegionLayouter` trait now requires implementing an `instance_value`
|
|
|
|
method, to back `Region::instance_value`.
|
|
|
|
- `halo2_proofs::plonk`
|
2022-07-14 11:39:23 -07:00
|
|
|
- `VirtualCells`
|
|
|
|
- `query_any` now panics if a non-`cur` `Rotation` is used with the
|
|
|
|
`Column<Fixed>` variant.
|
2022-07-14 12:08:34 -07:00
|
|
|
- `query_fixed` now no longer takes a `Rotation` argument,
|
|
|
|
and can only be used to query the current rotation.
|
2023-03-21 14:06:43 -07:00
|
|
|
- `Error` is now a [`non_exhaustive`](https://doc.rust-lang.org/reference/attributes/type_system.html) type.
|
2022-11-29 16:12:17 -08:00
|
|
|
|
2022-06-23 10:40:23 -07:00
|
|
|
## [0.2.0] - 2022-06-23
|
2022-06-07 16:13:42 -07:00
|
|
|
### Added
|
|
|
|
- `halo2_proofs::circuit::Value`, a more usable and type-safe replacement for
|
|
|
|
`Option<V>` in circuit synthesis.
|
2022-06-07 16:15:35 -07:00
|
|
|
- `impl Mul<F: Field> for &Assigned<F>`
|
|
|
|
|
|
|
|
### Changed
|
|
|
|
All APIs that represented witnessed values as `Option<V>` now represent them as
|
|
|
|
`halo2_proofs::circuit::Value<V>`. The core API changes are listed below.
|
|
|
|
|
|
|
|
- The following APIs now take `Value<_>` instead of `Option<_>`:
|
|
|
|
- `halo2_proofs::plonk`:
|
|
|
|
- `Assignment::fill_from_row`
|
|
|
|
- The following APIs now take value closures that return `Value<V>` instead of
|
|
|
|
`Result<V, Error>`:
|
|
|
|
- `halo2_proofs::circuit`:
|
|
|
|
- `Region::{assign_advice, assign_fixed}`
|
|
|
|
- `Table::assign_cell`
|
|
|
|
- `halo2_proofs::circuit::layouter`:
|
|
|
|
- `RegionLayouter::{assign_advice, assign_fixed}`
|
|
|
|
- `TableLayouter::assign_cell`
|
|
|
|
- `halo2_proofs::plonk`:
|
|
|
|
- `Assignment::{assign_advice, assign_fixed}`
|
|
|
|
- The following APIs now return `Value<_>` instead of `Option<_>`:
|
|
|
|
- `halo2_proofs::circuit`:
|
|
|
|
- `AssignedCell::{value, value_field}`
|
|
|
|
- The following APIs now return `Result<Value<F>, Error>` instead of
|
|
|
|
`Result<Option<F>, Error>`:
|
|
|
|
- `halo2_proofs::plonk`:
|
|
|
|
- `Assignment::query_instance`
|
|
|
|
- The following APIs now return `Result<(Cell, Value<F>), Error>` instead of
|
|
|
|
`Result<(Cell, Option<F>), Error>`:
|
|
|
|
- `halo2_proofs::circuit::layouter`:
|
|
|
|
- `RegionLayouter::assign_advice_from_instance`
|
2022-06-23 09:06:37 -07:00
|
|
|
- `halo2_proofs::plonk::BatchVerifier` has been rewritten. It is no longer a
|
|
|
|
verification strategy to be used with `verify_proof`, but instead manages the
|
2022-06-23 11:51:47 -07:00
|
|
|
entire batch verification process. The `batch` crate feature (enabled by
|
|
|
|
default) must be enabled to use the batch verifier.
|
2022-05-10 14:58:34 -07:00
|
|
|
|
|
|
|
## [0.1.0] - 2022-05-10
|
2022-02-01 04:43:02 -08:00
|
|
|
### Added
|
|
|
|
- `halo2_proofs::dev`:
|
|
|
|
- `MockProver::assert_satisfied`, for requiring that a circuit is satisfied.
|
|
|
|
It panics like `assert_eq!(mock_prover.verify(), Ok(()))`, but pretty-prints
|
|
|
|
any verification failures before panicking.
|
Add a `Constraints` helper
There are two existing patterns for constructing a gate from a set of
constraints with a common selector:
- Create an iterator of constraints, where each constraint includes the
selector:
```
vec![
("foo", selector.clone() * foo),
("bar", selector.clone() * bar),
("baz", selector * bar),
]
```
This requires the user to write O(n) `selector.clone()` calls.
- Create an iterator of constraints, and then map the selector in:
```
vec![
("foo", foo),
("bar", bar),
("baz", bar),
].into_iter().map(move |(name, poly)| (name, selector.clone() * poly))
```
This looks cleaner overall, but the API is not as intuitive, and it
is messier when the constraints are named.
The `Constraints` struct provides a third, clearer API:
```
Constraints::with_selector(
selector,
vec![
("foo", foo),
("bar", bar),
("baz", bar),
],
)
```
This focuses on the structure of the constraints, and handles the
selector application for the user.
2021-12-02 20:29:11 -08:00
|
|
|
- `halo2_proofs::plonk::Constraints` helper, for constructing a gate from a set
|
|
|
|
of constraints with a common selector.
|
2022-02-14 13:47:53 -08:00
|
|
|
|
2022-02-02 04:57:27 -08:00
|
|
|
### Changed
|
|
|
|
- `halo2_proofs::dev`:
|
|
|
|
- `VerifyFailure::CellNotAssigned` now has a `gate_offset` field, storing the
|
|
|
|
offset in the region at which the gate queries the cell that needs to be
|
|
|
|
assigned.
|
2022-03-29 18:39:50 -07:00
|
|
|
- The `row` field of `VerifyFailure::Permutation` has been replaced by a
|
|
|
|
`location` field, which can now indicate whether the location falls within
|
|
|
|
an assigned region.
|
2022-03-22 12:59:10 -07:00
|
|
|
|
2022-04-05 21:24:28 -07:00
|
|
|
## [0.1.0-beta.4] - 2022-04-06
|
2022-04-02 11:28:46 -07:00
|
|
|
### Changed
|
|
|
|
- PLONK prover was improved to avoid stack overflows when large numbers of gates
|
|
|
|
are involved in a proof.
|
|
|
|
|
2022-03-22 12:59:10 -07:00
|
|
|
## [0.1.0-beta.3] - 2022-03-22
|
2022-03-22 12:55:53 -07:00
|
|
|
### Added
|
|
|
|
- `halo2_proofs::circuit`:
|
|
|
|
- `AssignedCell::<Assigned<F>, F>::evaluate -> AssignedCell<F, F>`
|
|
|
|
- `Assigned::{is_zero_vartime, double, square, cube}`
|
|
|
|
- Various trait impls for `Assigned<F>`:
|
|
|
|
- `From<&Assigned<F>>`
|
|
|
|
- `PartialEq, Eq`
|
|
|
|
- `Add<&Assigned<F>>, AddAssign, AddAssign<&Assigned<F>>`
|
|
|
|
- `Sub<&Assigned<F>>, SubAssign, SubAssign<&Assigned<F>>`
|
|
|
|
- `Mul<&Assigned<F>>, MulAssign, MulAssign<&Assigned<F>>`
|
|
|
|
|
|
|
|
### Removed
|
|
|
|
- `halo2_proofs::plonk::VerifyingKey::{read, write}` (for details see
|
|
|
|
[issue 449](https://github.com/zcash/halo2/issues/449))
|
2022-02-14 13:47:53 -08:00
|
|
|
|
|
|
|
## [0.1.0-beta.2] - 2022-02-14
|
2022-01-20 10:28:44 -08:00
|
|
|
(relative to `halo2 0.1.0-beta.1`)
|
|
|
|
|
2021-12-20 04:08:33 -08:00
|
|
|
### Added
|
2022-02-14 13:29:42 -08:00
|
|
|
- `halo2_proofs::circuit::AssignedCell`, an abstraction for typed `Cell`s that
|
|
|
|
track the type (and witnessed value if known) of the assignment.
|
2022-01-26 15:13:19 -08:00
|
|
|
- `halo2_proofs::plonk`:
|
|
|
|
- `VerificationStrategy`
|
|
|
|
- `SingleVerifier`, an implementation of `VerificationStrategy` for verifying
|
|
|
|
proofs individually.
|
|
|
|
- `BatchVerifier`, an implementation of `VerificationStrategy` for verifying
|
|
|
|
multiple proofs in a batch.
|
2022-02-14 13:29:42 -08:00
|
|
|
- `Column::column_type`
|
|
|
|
- `impl {PartialOrd, Ord} for Any`
|
|
|
|
- `Error::ColumnNotInPermutation`
|
|
|
|
- `halo2_proofs::poly::Basis: Copy` bound, and corresponding implementations for
|
|
|
|
the provided bases.
|
|
|
|
- `halo2_proofs::dev`:
|
|
|
|
- `FailureLocation` (used in `VerifyFailure::Lookup`)
|
|
|
|
- `metadata::VirtualCell` (used in `VerifyFailure::ConstraintNotSatisfied`)
|
|
|
|
- `impl From<(usize, &str)> for metadata::Region`
|
|
|
|
|
|
|
|
### Fixed
|
|
|
|
- `halo2_proofs::plonk::Assigned` addition was producing incorrect results in
|
|
|
|
some cases due to how the deferred representation of `inv0` was handled. This
|
|
|
|
could not cause a soundness error, because `Assigned` is only used during
|
|
|
|
witness generation, not when defining constraints. However, it did mean that
|
|
|
|
the prover would fail to create a valid proof for some subset of valid
|
|
|
|
witnesses. [Fixed in #423](https://github.com/zcash/halo2/issues/423).
|
2021-12-20 04:08:33 -08:00
|
|
|
|
2021-05-18 11:29:10 -07:00
|
|
|
### Changed
|
2022-02-14 13:29:42 -08:00
|
|
|
- Migrated to `rand_core` (instead of `rand`), `pasta_curves 0.3`.
|
|
|
|
- `halo2_proofs::circuit`:
|
|
|
|
- `Region` now returns `AssignedCell` instead of `Cell` or `(Cell, Option<F>)`
|
|
|
|
from its assignment APIs, and the result types `VR` of their value closures
|
|
|
|
now have the bound `for<'vr> Assigned<F>: From<&'vr VR>` instead of
|
|
|
|
`VR: Into<Assigned<F>>`:
|
|
|
|
- `assign_advice`
|
|
|
|
- `assign_advice_from_constant`
|
|
|
|
- `assign_advice_from_instance`
|
|
|
|
- `assign_fixed`
|
|
|
|
- `halo2_proofs::plonk`:
|
|
|
|
- `create_proof` now take an argument `R: rand_core::RngCore`.
|
|
|
|
- `verify_proof` now takes a `VerificationStrategy` instead of an `MSM`
|
|
|
|
directly, and returns `VerificationStrategy::Output` instead of `Guard`.
|
|
|
|
- `ConstraintSystem::enable_equality` and `ConstraintSystem::query_any` now
|
|
|
|
take `Into<Column<Any>>` instead of `Column<Any>` as a parameter to avoid
|
|
|
|
excesive `.into()` usage.
|
|
|
|
- `Error` has been overhauled:
|
|
|
|
- `Error` now implements `std::fmt::Display` and `std::error::Error`.
|
|
|
|
- `Error` no longer implements `PartialEq`. Tests can check for specific
|
|
|
|
error cases with `assert!(matches!(..))`, or the `assert_matches` crate.
|
|
|
|
- `Error::IncompatibleParams` is now `Error::InvalidInstances`.
|
|
|
|
- `Error::NotEnoughRowsAvailable` now stores the current value of `k`.
|
|
|
|
- `Error::OpeningError` is now `Error::Opening`.
|
|
|
|
- `Error::SynthesisError` is now `Error::Synthesis`.
|
|
|
|
- `Error::TranscriptError` is now `Error::Transcript`, and stores the
|
|
|
|
underlying `io::Error`.
|
|
|
|
- `halo2_proofs::poly`:
|
|
|
|
- `commitment::Accumulator` had its `challenges_packed` field renamed to
|
|
|
|
`u_packed`.
|
|
|
|
- `commitment::Guard`, returned by the closure passed into
|
|
|
|
`VerificationStrategy::process` (and previously returned from `verify_proof`
|
|
|
|
directly), has changed so that values returned from its method `compute_g`
|
|
|
|
and expected by its method `use_g` are **NOT backwards compatible** with
|
|
|
|
values in previous version (namely `halo2 0.1.0-beta.1`).
|
|
|
|
- `commitment::MSM::add_to_h_scalar` was renamed to `MSM::add_to_w_scalar`.
|
|
|
|
- `commitment::create_proof` now take an argument `R: rand_core::RngCore`.
|
|
|
|
- `multiopen::create_proof` now take an argument `R: rand_core::RngCore`.
|
|
|
|
- `halo2_proofs::dev`:
|
|
|
|
- `CircuitLayout::render` now takes `k` as a `u32`, matching the regular
|
|
|
|
parameter APIs.
|
|
|
|
- `VerifyFailure` has been overhauled:
|
|
|
|
- `VerifyFailure::Cell` has been renamed to `VerifyFailure::CellNotAssigned`.
|
|
|
|
- `VerifyFailure::ConstraintNotSatisfied` now has a `cell_values` field,
|
|
|
|
storing the values of the cells used in the unsatisfied constraint.
|
|
|
|
- The `row` fields of `VerifyFailure::{ConstraintNotSatisfied, Lookup}` have
|
|
|
|
been replaced by `location` fields, which can now indicate whether the
|
|
|
|
location falls within an assigned region.
|
2021-05-18 11:29:10 -07:00
|
|
|
|
2021-09-30 14:35:33 -07:00
|
|
|
### Removed
|
2022-02-14 13:29:42 -08:00
|
|
|
- `halo2_proofs::arithmetic`:
|
|
|
|
- `BatchInvert` (use `ff::BatchInvert` instead).
|
|
|
|
- Several parts of the `pasta_curves::arithmetic` API that were re-exported
|
|
|
|
here (see the changelog for `pasta_curves 0.3.0` for details).
|
2022-01-20 10:28:44 -08:00
|
|
|
- `halo2_proofs::poly`:
|
2022-01-19 13:53:17 -08:00
|
|
|
- `EvaluationDomain::{add_extended, sub_extended, mul_extended}`
|
|
|
|
- `Polynomial::one_minus`
|
|
|
|
- `impl Neg, Sub for Polynomial`
|
|
|
|
- `impl Mul for Polynomial<_, ExtendedLagrangeCoeff>`
|
2022-02-14 13:29:42 -08:00
|
|
|
- `impl Default for Rotation` (use `Rotation::cur()` instead).
|