From 42573f620a70206fc4719f6279490ef5c0533936 Mon Sep 17 00:00:00 2001 From: Jonathan Wang <31040440+jonathanpwang@users.noreply.github.com> Date: Wed, 15 Nov 2023 15:14:03 -0800 Subject: [PATCH] chore: rename package to `halo2-axiom` for crates.io publish (#26) * chore: rename package to `halo2-axiom` for crates.io publish Import "halo2curves-axiom" crate. * chore: fix docs * chore: update rust-version * chore: fix rust-version --- halo2_proofs/Cargo.toml | 18 ++++++++++++------ halo2_proofs/benches/arithmetic.rs | 1 + halo2_proofs/benches/commit_zk.rs | 1 + halo2_proofs/benches/dev_lookup.rs | 1 + halo2_proofs/benches/fft.rs | 2 +- halo2_proofs/benches/hashtocurve.rs | 2 +- halo2_proofs/benches/plonk.rs | 1 + halo2_proofs/examples/circuit-layout.rs | 1 + halo2_proofs/examples/serialization.rs | 1 + halo2_proofs/examples/shuffle.rs | 1 + halo2_proofs/examples/shuffle_api.rs | 1 + halo2_proofs/src/circuit/value.rs | 4 ++-- halo2_proofs/src/dev.rs | 2 +- halo2_proofs/src/dev/gates.rs | 2 +- halo2_proofs/src/dev/graph/layout.rs | 2 +- halo2_proofs/src/dev/tfp.rs | 2 +- halo2_proofs/src/lib.rs | 5 ++++- halo2_proofs/src/plonk/circuit.rs | 12 ++++++------ halo2_proofs/tests/plonk_api.rs | 1 + 19 files changed, 39 insertions(+), 21 deletions(-) diff --git a/halo2_proofs/Cargo.toml b/halo2_proofs/Cargo.toml index b39840f5be..adf4c42e48 100644 --- a/halo2_proofs/Cargo.toml +++ b/halo2_proofs/Cargo.toml @@ -1,20 +1,26 @@ [package] -name = "halo2_proofs" +name = "halo2-axiom" version = "0.3.1" authors = [ "Sean Bowe ", "Ying Tong Lai ", "Daira Hopwood ", "Jack Grigg ", + "Privacy Scaling Explorations team", "Taiko Labs", "Intrinsic Technologies" ] edition = "2021" -rust-version = "1.56.1" +rust-version = "1.73.0" description = """ -Fast PLONK-based zero-knowledge proving system with no trusted setup +Fast PLONK-based zero-knowledge proving system with no trusted setup. +This is a fork of , which is itself a fork of ZCash's "halo2_proofs" crate. +This fork uses the KZG polynomial commitment scheme for the proving backend. +Publishing this crate for better versioning in Axiom's production usage. + +This crate requires rust nightly to build. """ license = "MIT OR Apache-2.0" -repository = "https://github.com/zcash/halo2" -documentation = "https://docs.rs/halo2_proofs" +repository = "https://github.com/axiom-crypto/halo2" +# documentation = "https://docs.rs/halo2_proofs" readme = "README.md" categories = ["cryptography"] keywords = ["halo", "proofs", "zkp", "zkSNARKs"] @@ -54,7 +60,7 @@ crossbeam = "0.8" ff = "0.13" group = "0.13" pairing = "0.23" -halo2curves = { git = "https://github.com/axiom-crypto/halo2curves.git", branch = "main", default-features = false, features = ["bits", "bn256-table", "derive_serde"] } +halo2curves = { package = "halo2curves-axiom", version = "0.4.1", default-features = false, features = ["bits", "bn256-table", "derive_serde"] } rand = "0.8" rand_core = { version = "0.6", default-features = false} tracing = "0.1" diff --git a/halo2_proofs/benches/arithmetic.rs b/halo2_proofs/benches/arithmetic.rs index 4ae88af137..26d12b8ca0 100644 --- a/halo2_proofs/benches/arithmetic.rs +++ b/halo2_proofs/benches/arithmetic.rs @@ -4,6 +4,7 @@ extern crate criterion; use crate::arithmetic::small_multiexp; use crate::halo2curves::pasta::{EqAffine, Fp}; use group::ff::Field; +use halo2_axiom as halo2_proofs; use halo2_proofs::*; use halo2_proofs::poly::{commitment::ParamsProver, ipa::commitment::ParamsIPA}; diff --git a/halo2_proofs/benches/commit_zk.rs b/halo2_proofs/benches/commit_zk.rs index a6a33a934b..d241805b26 100644 --- a/halo2_proofs/benches/commit_zk.rs +++ b/halo2_proofs/benches/commit_zk.rs @@ -2,6 +2,7 @@ extern crate criterion; use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion}; use group::ff::Field; +use halo2_axiom as halo2_proofs; use halo2_proofs::arithmetic::parallelize; use halo2curves::pasta::pallas::Scalar; use rand_chacha::rand_core::RngCore; diff --git a/halo2_proofs/benches/dev_lookup.rs b/halo2_proofs/benches/dev_lookup.rs index c100cb74d3..50a08b4d4b 100644 --- a/halo2_proofs/benches/dev_lookup.rs +++ b/halo2_proofs/benches/dev_lookup.rs @@ -2,6 +2,7 @@ extern crate criterion; use ff::{Field, PrimeField}; +use halo2_axiom as halo2_proofs; use halo2_proofs::circuit::{Layouter, SimpleFloorPlanner, Value}; use halo2_proofs::dev::MockProver; use halo2_proofs::plonk::*; diff --git a/halo2_proofs/benches/fft.rs b/halo2_proofs/benches/fft.rs index 0de72a0380..9b60a8dd30 100644 --- a/halo2_proofs/benches/fft.rs +++ b/halo2_proofs/benches/fft.rs @@ -3,7 +3,7 @@ extern crate criterion; use crate::arithmetic::best_fft; use group::ff::Field; -use halo2_proofs::*; +use halo2_axiom::*; use halo2curves::pasta::Fp; use criterion::{BenchmarkId, Criterion}; diff --git a/halo2_proofs/benches/hashtocurve.rs b/halo2_proofs/benches/hashtocurve.rs index a3805f3b9e..933a374123 100644 --- a/halo2_proofs/benches/hashtocurve.rs +++ b/halo2_proofs/benches/hashtocurve.rs @@ -2,7 +2,7 @@ use criterion::{criterion_group, criterion_main, Criterion}; -use halo2_proofs::arithmetic::CurveExt; +use halo2_axiom::arithmetic::CurveExt; use halo2curves::pasta::{pallas, vesta}; fn criterion_benchmark(c: &mut Criterion) { diff --git a/halo2_proofs/benches/plonk.rs b/halo2_proofs/benches/plonk.rs index 69ac368be9..2b6ebe9635 100644 --- a/halo2_proofs/benches/plonk.rs +++ b/halo2_proofs/benches/plonk.rs @@ -2,6 +2,7 @@ extern crate criterion; use group::ff::Field; +use halo2_axiom as halo2_proofs; use halo2_proofs::circuit::{Cell, Layouter, SimpleFloorPlanner, Value}; use halo2_proofs::plonk::*; use halo2_proofs::poly::{commitment::ParamsProver, Rotation}; diff --git a/halo2_proofs/examples/circuit-layout.rs b/halo2_proofs/examples/circuit-layout.rs index 18de27a783..30f10bfd1f 100644 --- a/halo2_proofs/examples/circuit-layout.rs +++ b/halo2_proofs/examples/circuit-layout.rs @@ -1,4 +1,5 @@ use ff::Field; +use halo2_axiom as halo2_proofs; use halo2_proofs::{ circuit::{Cell, Layouter, Region, SimpleFloorPlanner, Value}, plonk::{Advice, Assigned, Circuit, Column, ConstraintSystem, Error, Fixed, TableColumn}, diff --git a/halo2_proofs/examples/serialization.rs b/halo2_proofs/examples/serialization.rs index 43a1ac6a3b..1050ece360 100644 --- a/halo2_proofs/examples/serialization.rs +++ b/halo2_proofs/examples/serialization.rs @@ -4,6 +4,7 @@ use std::{ }; use ff::Field; +use halo2_axiom as halo2_proofs; use halo2_proofs::{ circuit::{Layouter, SimpleFloorPlanner, Value}, plonk::{ diff --git a/halo2_proofs/examples/shuffle.rs b/halo2_proofs/examples/shuffle.rs index 0522526468..5f7d8d7fd5 100644 --- a/halo2_proofs/examples/shuffle.rs +++ b/halo2_proofs/examples/shuffle.rs @@ -1,4 +1,5 @@ use ff::{BatchInvert, FromUniformBytes}; +use halo2_axiom as halo2_proofs; use halo2_proofs::{ arithmetic::Field, circuit::{Layouter, SimpleFloorPlanner, Value}, diff --git a/halo2_proofs/examples/shuffle_api.rs b/halo2_proofs/examples/shuffle_api.rs index d3de4c2cdb..e666ca6196 100644 --- a/halo2_proofs/examples/shuffle_api.rs +++ b/halo2_proofs/examples/shuffle_api.rs @@ -1,6 +1,7 @@ use std::{hash::Hash, marker::PhantomData, vec}; use ff::{FromUniformBytes, WithSmallOrderMulGroup}; +use halo2_axiom as halo2_proofs; use halo2_proofs::{ arithmetic::Field, circuit::{Layouter, SimpleFloorPlanner, Value}, diff --git a/halo2_proofs/src/circuit/value.rs b/halo2_proofs/src/circuit/value.rs index f3ea6a39ea..ca4f7af71c 100644 --- a/halo2_proofs/src/circuit/value.rs +++ b/halo2_proofs/src/circuit/value.rs @@ -34,7 +34,7 @@ impl Value { /// # Examples /// /// ``` - /// use halo2_proofs::circuit::Value; + /// use halo2_axiom::circuit::Value; /// /// let v = Value::known(37); /// ``` @@ -645,7 +645,7 @@ impl Value { /// If you have a `Value`, convert it to `Value>` first: /// ``` /// # use halo2curves::pasta::pallas::Base as F; - /// use halo2_proofs::{circuit::Value, plonk::Assigned}; + /// use halo2_axiom::{circuit::Value, plonk::Assigned}; /// /// let v = Value::known(F::from(2)); /// let v: Value> = v.into(); diff --git a/halo2_proofs/src/dev.rs b/halo2_proofs/src/dev.rs index 05d2974b54..5de0b9dba0 100644 --- a/halo2_proofs/src/dev.rs +++ b/halo2_proofs/src/dev.rs @@ -198,7 +198,7 @@ impl Mul for Value { /// # Examples /// /// ``` -/// use halo2_proofs::{ +/// use halo2_axiom::{ /// circuit::{Layouter, SimpleFloorPlanner, Value}, /// dev::{FailureLocation, MockProver, VerifyFailure}, /// plonk::{Advice, Any, Circuit, Column, ConstraintSystem, Error, Selector}, diff --git a/halo2_proofs/src/dev/gates.rs b/halo2_proofs/src/dev/gates.rs index 352415bcd9..ea68359229 100644 --- a/halo2_proofs/src/dev/gates.rs +++ b/halo2_proofs/src/dev/gates.rs @@ -29,7 +29,7 @@ struct Gate { /// /// ``` /// use ff::Field; -/// use halo2_proofs::{ +/// use halo2_axiom::{ /// circuit::{Layouter, SimpleFloorPlanner}, /// dev::CircuitGates, /// plonk::{Circuit, ConstraintSystem, Error}, diff --git a/halo2_proofs/src/dev/graph/layout.rs b/halo2_proofs/src/dev/graph/layout.rs index 3b243e3bd7..4163a43f05 100644 --- a/halo2_proofs/src/dev/graph/layout.rs +++ b/halo2_proofs/src/dev/graph/layout.rs @@ -21,7 +21,7 @@ use crate::{ /// # Examples /// /// ```ignore -/// use halo2_proofs::dev::CircuitLayout; +/// use halo2_axiom::dev::CircuitLayout; /// use plotters::prelude::*; /// /// let drawing_area = BitMapBackend::new("example-circuit-layout.png", (1024, 768)) diff --git a/halo2_proofs/src/dev/tfp.rs b/halo2_proofs/src/dev/tfp.rs index 094c8d6fb0..0579afe1cb 100644 --- a/halo2_proofs/src/dev/tfp.rs +++ b/halo2_proofs/src/dev/tfp.rs @@ -30,7 +30,7 @@ use crate::{ /// /// ```ignore /// use ff::Field; -/// use halo2_proofs::{ +/// use halo2_axiom::{ /// circuit::{floor_planner, Layouter, Value}, /// dev::TracingFloorPlanner, /// plonk::{Circuit, ConstraintSystem, Error}, diff --git a/halo2_proofs/src/lib.rs b/halo2_proofs/src/lib.rs index bd1d38d636..73420a20a1 100644 --- a/halo2_proofs/src/lib.rs +++ b/halo2_proofs/src/lib.rs @@ -1,4 +1,7 @@ -//! # halo2_proofs +//! # halo2-axiom +//! This is a fork of , which is itself a fork of ZCash's "halo2_proofs" crate. +//! This fork uses the KZG polynomial commitment scheme for the proving backend. +//! Publishing this crate for better versioning in Axiom's production usage. #![cfg_attr(docsrs, feature(doc_cfg))] // The actual lints we want to disable. diff --git a/halo2_proofs/src/plonk/circuit.rs b/halo2_proofs/src/plonk/circuit.rs index 93897e8697..c7019a39e8 100644 --- a/halo2_proofs/src/plonk/circuit.rs +++ b/halo2_proofs/src/plonk/circuit.rs @@ -414,9 +414,9 @@ impl TryFrom> for Column { /// /// Selectors can be used to conditionally enable (portions of) gates: /// ``` -/// use halo2_proofs::poly::Rotation; +/// use halo2_axiom::poly::Rotation; /// # use halo2curves::pasta::Fp; -/// # use halo2_proofs::plonk::ConstraintSystem; +/// # use halo2_axiom::plonk::ConstraintSystem; /// /// # let mut meta = ConstraintSystem::::default(); /// let a = meta.advice_column(); @@ -437,12 +437,12 @@ impl TryFrom> for Column { /// Selectors are disabled on all rows by default, and must be explicitly enabled on each /// row when required: /// ``` -/// use halo2_proofs::{ +/// use halo2_axiom::{ /// circuit::{Chip, Layouter, Value}, /// plonk::{Advice, Column, Error, Selector}, /// }; /// use ff::Field; -/// # use halo2_proofs::plonk::Fixed; +/// # use halo2_axiom::plonk::Fixed; /// /// struct Config { /// a: Column, @@ -1410,9 +1410,9 @@ impl From> for Vec> { /// A set of polynomial constraints with a common selector. /// /// ``` -/// use halo2_proofs::{plonk::{Constraints, Expression}, poly::Rotation}; +/// use halo2_axiom::{plonk::{Constraints, Expression}, poly::Rotation}; /// use halo2curves::pasta::Fp; -/// # use halo2_proofs::plonk::ConstraintSystem; +/// # use halo2_axiom::plonk::ConstraintSystem; /// /// # let mut meta = ConstraintSystem::::default(); /// let a = meta.advice_column(); diff --git a/halo2_proofs/tests/plonk_api.rs b/halo2_proofs/tests/plonk_api.rs index 3317f3c3da..2cdecb3fdf 100644 --- a/halo2_proofs/tests/plonk_api.rs +++ b/halo2_proofs/tests/plonk_api.rs @@ -5,6 +5,7 @@ // use assert_matches::assert_matches; use ff::{FromUniformBytes, WithSmallOrderMulGroup}; +use halo2_axiom as halo2_proofs; use halo2_proofs::arithmetic::Field; use halo2_proofs::circuit::{Cell, Layouter, SimpleFloorPlanner, Value}; use halo2_proofs::dev::MockProver;