All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Rust's notion of Semantic Versioning.
halo2_proofs::circuit::Value
, a more usable and type-safe replacement forOption<V>
in circuit synthesis.impl Mul<F: Field> for &Assigned<F>
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 ofOption<_>
:halo2_proofs::plonk
:Assignment::fill_from_row
- The following APIs now take value closures that return
Value<V>
instead ofResult<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 ofOption<_>
:halo2_proofs::circuit
:AssignedCell::{value, value_field}
- The following APIs now return
Result<Value<F>, Error>
instead ofResult<Option<F>, Error>
:halo2_proofs::plonk
:Assignment::query_instance
- The following APIs now return
Result<(Cell, Value<F>), Error>
instead ofResult<(Cell, Option<F>), Error>
:halo2_proofs::circuit::layouter
:RegionLayouter::assign_advice_from_instance
halo2_proofs::plonk::BatchVerifier
has been rewritten. It is no longer a verification strategy to be used withverify_proof
, but instead manages the entire batch verification process. Thebatch
crate feature (enabled by default) must be enabled to use the batch verifier.
halo2_proofs::dev
:MockProver::assert_satisfied
, for requiring that a circuit is satisfied. It panics likeassert_eq!(mock_prover.verify(), Ok(()))
, but pretty-prints any verification failures before panicking.
halo2_proofs::plonk::Constraints
helper, for constructing a gate from a set of constraints with a common selector.
halo2_proofs::dev
:VerifyFailure::CellNotAssigned
now has agate_offset
field, storing the offset in the region at which the gate queries the cell that needs to be assigned.- The
row
field ofVerifyFailure::Permutation
has been replaced by alocation
field, which can now indicate whether the location falls within an assigned region.
- PLONK prover was improved to avoid stack overflows when large numbers of gates are involved in a proof.
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>>
halo2_proofs::plonk::VerifyingKey::{read, write}
(for details see issue 449)
(relative to halo2 0.1.0-beta.1
)
halo2_proofs::circuit::AssignedCell
, an abstraction for typedCell
s that track the type (and witnessed value if known) of the assignment.halo2_proofs::plonk
:VerificationStrategy
SingleVerifier
, an implementation ofVerificationStrategy
for verifying proofs individually.BatchVerifier
, an implementation ofVerificationStrategy
for verifying multiple proofs in a batch.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 inVerifyFailure::Lookup
)metadata::VirtualCell
(used inVerifyFailure::ConstraintNotSatisfied
)impl From<(usize, &str)> for metadata::Region
halo2_proofs::plonk::Assigned
addition was producing incorrect results in some cases due to how the deferred representation ofinv0
was handled. This could not cause a soundness error, becauseAssigned
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.
- Migrated to
rand_core
(instead ofrand
),pasta_curves 0.3
. halo2_proofs::circuit
:Region
now returnsAssignedCell
instead ofCell
or(Cell, Option<F>)
from its assignment APIs, and the result typesVR
of their value closures now have the boundfor<'vr> Assigned<F>: From<&'vr VR>
instead ofVR: Into<Assigned<F>>
:assign_advice
assign_advice_from_constant
assign_advice_from_instance
assign_fixed
halo2_proofs::plonk
:create_proof
now take an argumentR: rand_core::RngCore
.verify_proof
now takes aVerificationStrategy
instead of anMSM
directly, and returnsVerificationStrategy::Output
instead ofGuard
.ConstraintSystem::enable_equality
andConstraintSystem::query_any
now takeInto<Column<Any>>
instead ofColumn<Any>
as a parameter to avoid excesive.into()
usage.Error
has been overhauled:Error
now implementsstd::fmt::Display
andstd::error::Error
.Error
no longer implementsPartialEq
. Tests can check for specific error cases withassert!(matches!(..))
, or theassert_matches
crate.Error::IncompatibleParams
is nowError::InvalidInstances
.Error::NotEnoughRowsAvailable
now stores the current value ofk
.Error::OpeningError
is nowError::Opening
.Error::SynthesisError
is nowError::Synthesis
.Error::TranscriptError
is nowError::Transcript
, and stores the underlyingio::Error
.
halo2_proofs::poly
:commitment::Accumulator
had itschallenges_packed
field renamed tou_packed
.commitment::Guard
, returned by the closure passed intoVerificationStrategy::process
(and previously returned fromverify_proof
directly), has changed so that values returned from its methodcompute_g
and expected by its methoduse_g
are NOT backwards compatible with values in previous version (namelyhalo2 0.1.0-beta.1
).commitment::MSM::add_to_h_scalar
was renamed toMSM::add_to_w_scalar
.commitment::create_proof
now take an argumentR: rand_core::RngCore
.multiopen::create_proof
now take an argumentR: rand_core::RngCore
.
halo2_proofs::dev
:CircuitLayout::render
now takesk
as au32
, matching the regular parameter APIs.VerifyFailure
has been overhauled:VerifyFailure::Cell
has been renamed toVerifyFailure::CellNotAssigned
.VerifyFailure::ConstraintNotSatisfied
now has acell_values
field, storing the values of the cells used in the unsatisfied constraint.- The
row
fields ofVerifyFailure::{ConstraintNotSatisfied, Lookup}
have been replaced bylocation
fields, which can now indicate whether the location falls within an assigned region.
halo2_proofs::arithmetic
:BatchInvert
(useff::BatchInvert
instead).- Several parts of the
pasta_curves::arithmetic
API that were re-exported here (see the changelog forpasta_curves 0.3.0
for details).
halo2_proofs::poly
:EvaluationDomain::{add_extended, sub_extended, mul_extended}
Polynomial::one_minus
impl Neg, Sub for Polynomial
impl Mul for Polynomial<_, ExtendedLagrangeCoeff>
impl Default for Rotation
(useRotation::cur()
instead).