Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance optimizations #6

Merged
merged 227 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
227 commits
Select commit Hold shift + click to select a range
a96589a
port base
kilic Jun 21, 2021
1e78923
fq2 compiles, wip
kilic Jun 21, 2021
3fcd958
fq6
kilic Jun 22, 2021
ac249d5
fq12
kilic Jun 22, 2021
66b7fa9
fq12 and tests
kilic Jun 22, 2021
245afb6
fr
kilic Jun 23, 2021
9ca05ff
field ext
kilic Jun 23, 2021
dff9f7f
wip
kilic Jun 24, 2021
37625f6
groups
kilic Jun 24, 2021
b15506d
pairing
kilic Jun 25, 2021
e6274aa
tidy 1
kilic Jun 27, 2021
efc1e28
tidy 2
kilic Jun 27, 2021
2daa4bd
tidy 3
kilic Jun 27, 2021
32362a4
clear cofactor
kilic Jun 28, 2021
2a11fb1
pairing engine
kilic Jun 28, 2021
89e7293
tidy 4
kilic Jun 28, 2021
d7830e0
remove unused
kilic Jun 28, 2021
85307d2
remove unused deps
kilic Jun 28, 2021
917ca2d
tidy
kilic Jul 2, 2021
601efca
use local pairing engine
kilic Jul 2, 2021
1738e38
iteration with consumer lib
kilic Jul 12, 2021
6781987
iteration with consumer 2
kilic Jul 15, 2021
73c10b6
allow infinity coordinates
kilic Jul 16, 2021
b1901ea
enable G1 for fft
kilic Jul 27, 2021
341da28
dependency version bump
kilic Oct 12, 2021
f1d13bf
sync with pasta traits
kilic Oct 12, 2021
4b123ab
move from_bytes_wide to BaseExt
kilic Nov 23, 2021
18f6e63
Add get_lower_128 function to FieldExt
kilic Nov 23, 2021
44308e0
sync with pasta traits
kilic Jan 7, 2022
27eb032
Public base field fq
kilic Jan 12, 2022
3f668ba
implement part of the FieldExt for Fq
kilic Jan 12, 2022
b4650f7
github actions test and bench
ashWhiteHat Jan 26, 2022
a1f8f2e
introduce assembly arithmetic
ashWhiteHat Jan 27, 2022
907c3ec
add x86_64 target
ashWhiteHat Jan 27, 2022
b22f569
commonize field method
ashWhiteHat Jan 27, 2022
56c18fd
Merge pull request #6 from appliedzkp/introduce-assembly
kilic Feb 10, 2022
230e2c6
Remove to-from_bytes
kilic Feb 12, 2022
530f4c0
Add constructor to Coordinates struct
kilic Mar 6, 2022
6bed067
MSM optimization
Brechtpd Mar 8, 2022
44aa97f
Fix prefetch feature
Brechtpd Mar 10, 2022
af85374
Add From<bool> traitbound to FieldExt. Should close #3
kilic Mar 14, 2022
49e5991
Revert unnecessary change
Brechtpd Mar 19, 2022
5898601
add cargo description
kilic Mar 30, 2022
3721879
Merge pull request #8 from appliedzkp/from_bool
kilic Apr 9, 2022
c616fb2
Feedback
Brechtpd May 3, 2022
1da2920
Merge pull request #7 from Brechtpd/msm
kilic May 3, 2022
55afb89
use pasta_curves traits everywhere
kilic May 4, 2022
578a657
cargo fmt
kilic May 4, 2022
f34e3da
prefetch only with x86
kilic May 4, 2022
1a64a92
add endomorphism test
kilic May 4, 2022
bea19f9
version
kilic May 4, 2022
dcb3fb8
new package name
kilic May 5, 2022
c5762ee
export pasta
kilic May 5, 2022
31f337c
sync g1 endo with pasta
kilic May 6, 2022
44a5755
batch add
kilic May 6, 2022
f516912
extend CurveAffine
kilic May 7, 2022
a760b9e
bump pasta_curves version
kilic May 17, 2022
8c48fb2
Add `secp256k1` curve
davidnevadoc May 13, 2022
6d23ee3
Move `common` back to `bn256`
davidnevadoc May 14, 2022
99da337
Remove `kzg` feature code
davidnevadoc May 15, 2022
8252607
Add `common_field` macro for `secp256k1` fields
davidnevadoc May 15, 2022
3376ad7
Add single macro for `secp256k1` fields impl
davidnevadoc May 16, 2022
fed2b27
Move `num-biguint` `num-traits` to dependencies
davidnevadoc May 19, 2022
f7c4ea5
Use common implementations and tests
kilic Jun 7, 2022
1199a47
Expose `Secp256k1`
kilic Jun 8, 2022
bb6e391
Bump version to `0.2` account `pse/pairing` as `0.1`
kilic Jun 8, 2022
bbd4cee
Fix affine multiplication: remove skipping a last bit to generelize
kilic Jun 9, 2022
a047fb5
fix: implement `ff::PrimeField::to_repr` for `Fq2`
han0110 Jun 20, 2022
f75ed26
Merge pull request #2 from han0110/fix/impl-fq2-to-repr
han0110 Aug 15, 2022
83c72d4
Use stable channel rust and enable `feature(asm_const)` by condition …
han0110 Sep 19, 2022
fac6fb5
VerifyingKey Serialization: merge Nalin's PR
nalinbhardwaj Oct 7, 2022
9a7f52b
feat: add serialization & deserialization of pkey and vkey using serde
jonathanpwang Oct 8, 2022
a2bcaa1
fix: add `num_fixed_commitments` to vkey serialization so correct number
jonathanpwang Oct 8, 2022
523e194
fix: serialize/deserialize pkey directly to/from file
jonathanpwang Oct 12, 2022
99886cc
Merge remote-tracking branch 'upstream/main' into axiom/add-serializa…
jonathanpwang Oct 25, 2022
3603fbf
bn256: make `Fq2`, `Fq6`, `Fq12` public
jonathanpwang Oct 25, 2022
1dc522c
fq12: fix comments to clarify computation of FQ12 coefficients and use
jonathanpwang Oct 25, 2022
1762b09
Update: implement suggestions for PR
jonathanpwang Nov 1, 2022
efbbde4
update: remove serialization from evaluation as we now recalculate di…
jonathanpwang Nov 1, 2022
5835ad1
Add 'halo2curves/' from commit '1dc522cd798677707e05ed42c8cc6b7ce3d12…
jonathanpwang Nov 9, 2022
7665a3d
Merge commit '0852b2e469bca98ddeb954198d7e49b36457d7d7' as 'ff'
jonathanpwang Nov 9, 2022
0852b2e
Squashed 'ff/' content from commit 1eddf54c
jonathanpwang Nov 9, 2022
2d62d25
feat: add git subtree with halo2curves and ff to start making optimiz…
jonathanpwang Nov 9, 2022
d81168b
chore: rename halocurves to halo2_curves
jonathanpwang Nov 9, 2022
2d7eb8e
Squashed 'ff/' changes from 1eddf54c..9b9a8d9c
jonathanpwang Nov 9, 2022
f92f13e
Merge commit '2d7eb8ec4fe09059620530f398df491582f4caef' into axiom/fa…
jonathanpwang Nov 9, 2022
7e364f8
ff: remove Copy trait to discourage unnecessary copies in code
jonathanpwang Nov 9, 2022
17b9d4b
WIP: remove copy from bn254
jonathanpwang Nov 9, 2022
7e8423a
Squashed 'group/' content from commit e9fc531e
jonathanpwang Nov 9, 2022
d19f146
Merge commit '7e8423a826b52922a7258d6a6938757708bcf86c' as 'group'
jonathanpwang Nov 9, 2022
bb2a02f
add zkcrypto/group to workspace
jonathanpwang Nov 9, 2022
b1b61ee
Squashed 'pasta_curves/' content from commit db830572
jonathanpwang Nov 9, 2022
12ed89e
Merge commit 'b1b61eebe2b4afb0060bfda144555f7ed5a0f81a' as 'pasta_cur…
jonathanpwang Nov 9, 2022
38d9a3b
revert back to including Copy trait because ConditionalSelect require…
jonathanpwang Nov 9, 2022
cb34663
Revert "WIP: remove copy from bn254"
jonathanpwang Nov 9, 2022
e0cf6cd
Revert "ff: remove Copy trait to discourage unnecessary copies in code"
jonathanpwang Nov 9, 2022
e422275
feat: change `region.assign_advice` to return just the `Cell` and
jonathanpwang Nov 9, 2022
9c15ed4
feat: add trait `Hash` to `ff::Field`
jonathanpwang Nov 9, 2022
8ba7270
feat: `region.assign_advice` now returns reference `&Assigned<F>` via
jonathanpwang Nov 9, 2022
c5ed84a
big change: in `prover::WitnessCollection` now use `Rc` to manage smart
jonathanpwang Nov 9, 2022
553c651
chore: restructure workspace to match halo2-ce monorepo
jonathanpwang Nov 10, 2022
c53bb7c
chore: restructure workspace to match halo2-ce monorepo
jonathanpwang Nov 10, 2022
5139953
fix: change dependencies so no patching required to use monorepo
jonathanpwang Nov 10, 2022
9e22b57
Squashed 'primitives/poseidon/' content from commit 5d29df01
jonathanpwang Nov 10, 2022
f58809d
Merge commit '9e22b57a15c4a3d8c2a420f6e482a9340fc4e698' as 'primitive…
jonathanpwang Nov 10, 2022
b1b2fcf
primitives/poseidon: initial add from PSE repo
jonathanpwang Nov 10, 2022
7f8a16a
fix: clippy warnings
jonathanpwang Nov 14, 2022
dbfc24c
feat: add conversion functions to `ff:PrimeField` to go between `u64`
jonathanpwang Nov 14, 2022
64f013c
feat: add conversion functions to `ff:PrimeField` to go between `u64`
jonathanpwang Nov 14, 2022
c647fa7
fix: remove use of `Rc` in `WitnessCollection::assign_advice`
jonathanpwang Nov 15, 2022
c70ef09
fix: remove use of `Rc` in `WitnessCollection::assign_advice`
jonathanpwang Nov 15, 2022
201b0b3
feat: add `is_zero_vartime` derived implementation for `Fr`
jonathanpwang Nov 15, 2022
fea5c28
feat: add `is_zero_vartime` derived implementation for `Fr`
jonathanpwang Nov 15, 2022
b8627f9
Fix `secp256k1` compressed serialization
davidnevadoc Nov 15, 2022
f6c822d
update: remove `region` from `Cell` since we only use one region
jonathanpwang Nov 17, 2022
bb60a3a
update: remove `region` from `Cell` since we only use one region
jonathanpwang Nov 17, 2022
1f84218
feat: add trait `BigPrimeField` to `curves::arithmetic`
jonathanpwang Nov 17, 2022
8ad5d28
feat: add trait `BigPrimeField` to `curves::arithmetic`
jonathanpwang Nov 17, 2022
8828b48
chore: rename package "curves" to "halo2curves" for easier patching
jonathanpwang Nov 19, 2022
1fc648d
chore: rename package "curves" to "halo2curves" for easier patching
jonathanpwang Nov 19, 2022
b18e3b1
update: remove `?` from `WitnessCollection::assign_advice` due to
jonathanpwang Nov 20, 2022
e2af0f1
feat: add back `copy_advice` function for `AssignedCell<&Assigned<F>,
jonathanpwang Nov 21, 2022
a4538d9
feat: implement functions `row_offset` and `column` directly for
jonathanpwang Nov 23, 2022
280141c
Add serde test for curves
davidnevadoc Nov 23, 2022
c9168d5
feat: add `CurveAffineExt::into_coordinates` for raw unchecked affine…
jonathanpwang Nov 23, 2022
8dde438
feat: add `CurveAffineExt::into_coordinates` for raw unchecked affine…
jonathanpwang Nov 23, 2022
d522547
update: modify `assign_fixed` slightly for performance
jonathanpwang Nov 24, 2022
d7e4d95
update: modify `assign_fixed` slightly for performance
jonathanpwang Nov 24, 2022
3ea7b9a
feat: implement `ProvingKey` serialization without using external crates
jonathanpwang Nov 25, 2022
fdf539f
examples: add `serialization` example to test `ProvingKey` read and
jonathanpwang Nov 25, 2022
a1b3169
curves: switch to using rust nightly "bigint_helper_methods" for finite
jonathanpwang Nov 25, 2022
80a3061
curves: switch to using rust nightly "bigint_helper_methods" for finite
jonathanpwang Nov 25, 2022
cd81bfb
feat: implement `From<$field>` for `[u64; 4]` so field elements can be
jonathanpwang Nov 26, 2022
bd1494d
feat: implement `From<$field>` for `[u64; 4]` so field elements can be
jonathanpwang Nov 26, 2022
cd1999d
feat: add `From<[u64;4]>` and `To<[u64;4]>` to field implementations
jonathanpwang Nov 28, 2022
baaf27c
feat: add `From<[u64;4]>` and `To<[u64;4]>` to field implementations
jonathanpwang Nov 28, 2022
b8647fc
feat: add default implementation of `CurveAffineExt` for `CurveAffine`
jonathanpwang Nov 28, 2022
cef669f
feat: add default implementation of `CurveAffineExt` for `CurveAffine`
jonathanpwang Nov 28, 2022
40ba60b
Squashed 'primitives/poseidon/' content from commit 5d29df01
jonathanpwang Nov 28, 2022
8f553e7
Merge commit '40ba60b86d16325268612a09007417005cdcadca' as 'primitive…
jonathanpwang Nov 28, 2022
f670a96
chore: add "poseidon" crate back as git subtree to handle "halo2curves"
jonathanpwang Nov 28, 2022
278e3ee
Merge pull request #8 from privacy-scaling-explorations/dav/fix/secp_…
kilic Dec 1, 2022
2c7f288
feat: added `to/from_bytes` for `ProvingKey` and `VerifyingKey`
jonathanpwang Dec 2, 2022
c8137e1
Merge branch 'axiom/add-serialization' into axiom/faster-witness-gene…
jonathanpwang Dec 4, 2022
945d92a
Merge branch 'axiom/add-serialization' into axiom/faster-witness-gene…
jonathanpwang Dec 4, 2022
07fb486
fix: get multi-phase constraint system to work with our version of
jonathanpwang Dec 7, 2022
701c27e
Make `Fq2`, `Fq6`, `Fq12` public (#7)
jonathanpwang Dec 9, 2022
c2d1af5
feat: change `region.assign_advice` to allow any `Into<Assigned<F>>` but
jonathanpwang Dec 10, 2022
db04cf3
feat: change `layouter.assign_region` to take `FnOnce` closure instead
jonathanpwang Dec 16, 2022
4a9d602
feat: derive `Serialize`, `Deserialize` for common fields and curves
jonathanpwang Dec 17, 2022
a1b43a1
feat: derive `Serialize`, `Deserialize` for common fields and curves
jonathanpwang Dec 17, 2022
14e67ca
chore: derive `PartialEq, Hash` for `bn256::{Fq,Fr}` and
jonathanpwang Dec 21, 2022
a5cb3b8
fix/curves: `cmp` was not first performing Montgomery reduction
jonathanpwang Dec 21, 2022
67023a0
fix/curves: `cmp` was not first performing Montgomery reduction
jonathanpwang Dec 21, 2022
5bcc891
feat: add trait `SerdeObject` for serialization of objects into raw
jonathanpwang Dec 21, 2022
dd6f8e4
chore: udpate crate version to 0.3.1
jonathanpwang Dec 21, 2022
01e9de0
chore: remote direct `PartialEq` implementation in bn254/assembly
jonathanpwang Dec 21, 2022
aa09e10
feat: read `VerifyingKey` and `ProvingKey` does not require `params` as
jonathanpwang Dec 21, 2022
79ecad4
fix: add impl `SerdeObject` to assembly macro
jonathanpwang Dec 21, 2022
db67f11
feat: add features "serde-raw" and "raw-unchecked" to
jonathanpwang Dec 21, 2022
2783c57
Merge commit '79ecad4e3b4a9f221c7cfeb6ec01bee43d7c01ff' into axiom/fe…
jonathanpwang Dec 21, 2022
9c7b343
Merge commit '79ecad4e3b4a9f221c7cfeb6ec01bee43d7c01ff' into axiom/fe…
jonathanpwang Dec 21, 2022
c89ba2d
Merge branch 'feat/serde-raw' into axiom/feat/serde-raw
jonathanpwang Dec 21, 2022
1c61d24
feat: derive `Hash` for `Fq2, G1Affine, G2Affine` for future use
jonathanpwang Dec 21, 2022
417aead
chore: switch to feature "raw-unchecked"
jonathanpwang Dec 21, 2022
63127f6
fix: change `assert` to `debug_assert` in `read_raw_unchecked` functions
jonathanpwang Dec 22, 2022
bd2d87f
feat: add `next_phase` and `get_challenge` functions to `Region` so that
jonathanpwang Dec 22, 2022
afee8f6
Merge commit '63127f69b0f43a828b5f35d466085debe1e11e8c' into axiom/fa…
jonathanpwang Dec 22, 2022
7079eeb
Merge commit '63127f69b0f43a828b5f35d466085debe1e11e8c' into axiom/fa…
jonathanpwang Dec 22, 2022
12a0386
Merge branch 'feat/multiphase-in-one-synthesize' into axiom/faster-wi…
jonathanpwang Dec 22, 2022
8480325
update: change `is_less_than` to use `borrowing_sub` because it is
jonathanpwang Dec 23, 2022
0d6af65
update: change `is_less_than` to use `borrowing_sub` because it is
jonathanpwang Dec 23, 2022
75e3591
optimize: revert to old way of subtracting field elements without
jonathanpwang Dec 24, 2022
cc3f016
optimize: revert to old way of subtracting field elements without
jonathanpwang Dec 24, 2022
b070fc1
feat: parallelize (cpu) shplonk prover
jonathanpwang Dec 26, 2022
60ee8e2
shplonk: improve `construct_intermediate_sets` using `BTreeSet` and
jonathanpwang Dec 27, 2022
95ff83a
shplonk: change `construct_intermediate_sets` to use `FxHashSet` instead
jonathanpwang Dec 27, 2022
c228e00
shplonk: add `Send` and `Sync` to `Query` trait for more parallelization
jonathanpwang Dec 27, 2022
dfcc2a4
chore: in derive `field`, default `mul` is `const` again
jonathanpwang Dec 27, 2022
a3b2c14
chore: in derive `field`, default `mul` is `const` again
jonathanpwang Dec 27, 2022
551c782
- Implements `PartialOrd` for `Value<F>`
Dec 7, 2022
7a444d3
chore: switch to halo2curves 0.3.1 tag
jonathanpwang Jan 5, 2023
be10b68
Fix MockProver `assert_verify` panic errors (#118)
CPerezz Jan 9, 2023
e56a4a4
Remove partial ordering for value
Jan 9, 2023
8c26a83
Remove transpose
Jan 9, 2023
0af4611
Merge pull request #115 from privacy-scaling-explorations/feat/challe…
adria0 Jan 9, 2023
b8e458e
Parallelize SHPLONK multi-open prover (#114)
jonathanpwang Jan 10, 2023
7aa1009
fix: FailureLocation::find empty-region handling (#121)
CPerezz Jan 11, 2023
fe81922
Merge remote-tracking branch 'upstream/main' into feat/serde-raw
jonathanpwang Jan 16, 2023
607c3a4
feat: add enum `SerdeFormat` for user to select
jonathanpwang Jan 16, 2023
8697a66
Merge branch 'feat/serde-raw' into axiom/faster-witness-generation
jonathanpwang Jan 16, 2023
789790f
Feature: Expose Fixed columns & Assembly permutation structs in MockP…
CPerezz Jan 16, 2023
4ad07d4
Feature to serialize/deserialize KZG params, verifying key, and provi…
jonathanpwang Jan 16, 2023
54e4c57
Add support for Column annotations for MockProver debugging (#109)
CPerezz Jan 16, 2023
5c3ea1a
chore: Move Codecov, wasm-build, Bitrot & doc-tests to push (#125)
CPerezz Jan 17, 2023
4b34aa2
fix: Allow to compare `Assembly` structs (#126)
CPerezz Jan 17, 2023
342d07a
Add keccak256 hasher for transcript (#2)
kilic Jan 17, 2023
475e45f
fix: revert use of raw pointer in `MockProver` and switch to using `Arc`
jonathanpwang Jan 17, 2023
99795dd
fix: transcript instantiation in poseidon benchmark loop (#128)
alexander-camuto Jan 18, 2023
e929fb3
Improve performance of vk & pk keygen and of default `parallelize` c…
pinkiebell Jan 20, 2023
c7e42e4
fix: Force `VerifyFailure` to own the annotations map (#131)
CPerezz Jan 20, 2023
9769487
feat: call synthesize in `MockProver` multiple times to behave same a…
han0110 Jan 19, 2023
a5b42f7
feat: check advice assignment consistency between different phases
han0110 Jan 31, 2023
0c99e89
fix: Support annotations for CellNotAssigned in verify_par (#138)
CPerezz Feb 2, 2023
0a8646b
feat: Add `assert_satisfied_at_rows_par` variant (#139)
CPerezz Feb 2, 2023
77376d2
feat: add docs
jonathanpwang Feb 3, 2023
c85ab01
Merge pull request #129 from han0110/feature/multi-phase-mock-prover
han0110 Feb 9, 2023
4fa0406
feat: remove `Result` from `assign_advice` return value
jonathanpwang Feb 10, 2023
05a8032
feat: remove `Result` from `assign_advice` return value
jonathanpwang Feb 10, 2023
882379a
Merge remote-tracking branch 'upstream/main' into axiom/dev
jonathanpwang Feb 10, 2023
1d83217
feat: add timers to "profile" feature
jonathanpwang Feb 10, 2023
0435c55
FFT opt
Brechtpd Jan 28, 2023
ef7e6fe
chore: fix measurement display when "profile" is on only
jonathanpwang Feb 11, 2023
f2c5241
feat: parallelize vanishing random poly generation; remove `Result`s and
jonathanpwang Feb 12, 2023
81978a7
feat: add new parallel implementation for `permute_expression_pair` to
jonathanpwang Feb 14, 2023
517734e
revert: go back to `Rng` without `Clone`
jonathanpwang Feb 18, 2023
dec0633
chore: remove rng: Sync requirement for compatibility reasons
jonathanpwang Feb 19, 2023
9e6d1b7
Expose mod `permutation` and re-export `permutation::keygen::Assembly…
han0110 Feb 22, 2023
58a64b8
feat(MockProver): replace errors by asserts
ed255 Feb 22, 2023
954b3d5
Merge pull request #150 from privacy-scaling-explorations/feature/deb…
ed255 Feb 23, 2023
88aca38
feat: parallelize vanishing rand poly using `thread_rng()` for now
jonathanpwang Feb 24, 2023
afe4ef4
MockProver test utililities (#153)
naure Feb 28, 2023
4d93d01
feat: Parallel random blinder poly impl (#152)
CPerezz Feb 28, 2023
c1b3b5b
chore: remove debug_assert on phase to allow non-specialized circuits…
jonathanpwang Mar 1, 2023
2e9c872
Merge remote-tracking branch 'upstream/main' into axiom/dev
jonathanpwang Mar 6, 2023
4902170
Split 'arithmetic/curves/' into commit '05a8032e35a000e09d9a447eed457…
jonathanpwang Apr 18, 2023
7db51d3
Merge branch 'main' into axiom/dev
jonathanpwang Jun 20, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 1 addition & 84 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: CI checks

on: [push, pull_request]
on: [pull_request, push]

jobs:
test:
Expand All @@ -21,89 +21,6 @@ jobs:
command: test
args: --verbose --release --all --all-features

build:
name: Build target ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
matrix:
target:
- wasm32-unknown-unknown
- wasm32-wasi

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
override: false
- name: Add target
run: rustup target add ${{ matrix.target }}
- name: cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --features dev-graph,gadget-traces,unstable --target ${{ matrix.target }}

bitrot:
name: Bitrot check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
override: false
# Build benchmarks to prevent bitrot
- name: Build benchmarks
uses: actions-rs/cargo@v1
with:
command: build
args: --benches --examples --all-features

codecov:
name: Code coverage
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
# Use stable for this to ensure that cargo-tarpaulin can be built.
- uses: actions-rs/toolchain@v1
with:
override: false
- name: Install cargo-tarpaulin
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-tarpaulin
- name: Generate coverage report
uses: actions-rs/cargo@v1
with:
command: tarpaulin
args: --all-features --timeout 600 --out Xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.1.0

doc-links:
name: Intra-doc links
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
override: false
- name: cargo fetch
uses: actions-rs/cargo@v1
with:
command: fetch

# Ensure intra-documentation links all resolve correctly
# Requires #![deny(intra_doc_link_resolution_failure)] in crates.
- name: Check intra-doc links
uses: actions-rs/cargo@v1
with:
command: doc
args: --all --document-private-items

fmt:
name: Rustfmt
timeout-minutes: 30
Expand Down
106 changes: 106 additions & 0 deletions .github/workflows/ci_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: CI checks main

on:
push:
branches:
- main
jobs:
test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
override: false
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --verbose --release --all --all-features
bitrot:
name: Bitrot check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
override: false
# Build benchmarks to prevent bitrot
- name: Build benchmarks
uses: actions-rs/cargo@v1
with:
command: build
args: --benches --examples --all-features

codecov:
name: Code coverage
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
# Use stable for this to ensure that cargo-tarpaulin can be built.
- uses: actions-rs/toolchain@v1
with:
override: false
- name: Install cargo-tarpaulin
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-tarpaulin
- name: Generate coverage report
uses: actions-rs/cargo@v1
with:
command: tarpaulin
args: --all-features --timeout 600 --out Xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3.1.0

doc-links:
name: Intra-doc links
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
override: false
- name: cargo fetch
uses: actions-rs/cargo@v1
with:
command: fetch

# Ensure intra-documentation links all resolve correctly
# Requires #![deny(intra_doc_link_resolution_failure)] in crates.
- name: Check intra-doc links
uses: actions-rs/cargo@v1
with:
command: doc
args: --all --document-private-items

build:
name: Build target ${{ matrix.target }}
runs-on: ubuntu-latest
strategy:
matrix:
target:
- wasm32-unknown-unknown
- wasm32-wasi

steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
override: false
- name: Add target
run: rustup target add ${{ matrix.target }}
- name: cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --features dev-graph,gadget-traces,unstable --target ${{ matrix.target }}
18 changes: 9 additions & 9 deletions arithmetic/curves/src/tests/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub fn random_field_tests<F: Field>(type_name: String) {
}

fn random_multiplication_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
let message = format!("multiplication {}", type_name);
let message = format!("multiplication {type_name}");
let start = start_timer!(|| message);
for _ in 0..1000000 {
let a = F::random(&mut rng);
Expand All @@ -72,7 +72,7 @@ fn random_multiplication_tests<F: Field, R: RngCore>(mut rng: R, type_name: Stri
}

fn random_addition_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
let message = format!("addition {}", type_name);
let message = format!("addition {type_name}");
let start = start_timer!(|| message);
for _ in 0..1000000 {
let a = F::random(&mut rng);
Expand All @@ -98,7 +98,7 @@ fn random_addition_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
}

fn random_subtraction_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
let message = format!("subtraction {}", type_name);
let message = format!("subtraction {type_name}");
let start = start_timer!(|| message);
for _ in 0..1000000 {
let a = F::random(&mut rng);
Expand All @@ -119,7 +119,7 @@ fn random_subtraction_tests<F: Field, R: RngCore>(mut rng: R, type_name: String)
}

fn random_negation_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
let message = format!("negation {}", type_name);
let message = format!("negation {type_name}");
let start = start_timer!(|| message);
for _ in 0..1000000 {
let a = F::random(&mut rng);
Expand All @@ -133,7 +133,7 @@ fn random_negation_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
}

fn random_doubling_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
let message = format!("doubling {}", type_name);
let message = format!("doubling {type_name}");
let start = start_timer!(|| message);
for _ in 0..1000000 {
let mut a = F::random(&mut rng);
Expand All @@ -147,7 +147,7 @@ fn random_doubling_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
}

fn random_squaring_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
let message = format!("squaring {}", type_name);
let message = format!("squaring {type_name}");
let start = start_timer!(|| message);
for _ in 0..1000000 {
let mut a = F::random(&mut rng);
Expand All @@ -163,7 +163,7 @@ fn random_squaring_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
fn random_inversion_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
assert!(bool::from(F::zero().invert().is_none()));

let message = format!("inversion {}", type_name);
let message = format!("inversion {type_name}");
let start = start_timer!(|| message);
for _ in 0..1000000 {
let mut a = F::random(&mut rng);
Expand All @@ -176,7 +176,7 @@ fn random_inversion_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
}

fn random_expansion_tests<F: Field, R: RngCore>(mut rng: R, type_name: String) {
let message = format!("expansion {}", type_name);
let message = format!("expansion {type_name}");
let start = start_timer!(|| message);
for _ in 0..1000000 {
// Compare (a + b)(c + d) and (a*c + b*c + a*d + b*d)
Expand Down Expand Up @@ -215,7 +215,7 @@ pub fn random_serialization_test<F: Field + SerdeObject>(type_name: String) {
0x59, 0x62, 0xbe, 0x5d, 0x76, 0x3d, 0x31, 0x8d, 0x17, 0xdb, 0x37, 0x32, 0x54, 0x06, 0xbc,
0xe5,
]);
let message = format!("serialization {}", type_name);
let message = format!("serialization {type_name}");
let start = start_timer!(|| message);
for _ in 0..1000000 {
let a = F::random(&mut rng);
Expand Down
54 changes: 31 additions & 23 deletions halo2_proofs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,44 @@ keywords = ["halo", "proofs", "zkp", "zkSNARKs"]
all-features = true
rustdoc-args = ["--cfg", "docsrs", "--html-in-header", "katex-header.html"]

# [[bench]]
# name = "arithmetic"
# harness = false
#
# [[bench]]
# name = "hashtocurve"
# harness = false
#
# [[bench]]
# name = "plonk"
# harness = false
#
# [[bench]]
# name = "dev_lookup"
# harness = false
#
# [[bench]]
# name = "fft"
# harness = false
[[bench]]
name = "arithmetic"
harness = false

[[bench]]
name = "commit_zk"
harness = false

[[bench]]
name = "hashtocurve"
harness = false

[[bench]]
name = "plonk"
harness = false

[[bench]]
name = "dev_lookup"
harness = false

[[bench]]
name = "fft"
harness = false

[dependencies]
backtrace = { version = "0.3", optional = true }
rayon = "1.5.1"
crossbeam = "0.8"
ff = "0.12"
group = "0.12"
halo2curves = { path = "../arithmetic/curves" }
rand_core = { version = "0.6", default-features = false }
rand = "0.8"
rand_core = { version = "0.6", default-features = false}
tracing = "0.1"
blake2b_simd = "1"
rustc-hash = "1.1.0"
sha3 = "0.9.1"
ark-std = { version = "0.3.0", features = ["print-trace"], optional = true }

# Developer tooling dependencies
plotters = { version = "0.3.0", optional = true }
Expand All @@ -63,7 +71,7 @@ assert_matches = "1.5"
criterion = "0.3"
gumdrop = "0.8"
proptest = "1"
rand_core = { version = "0.6", default-features = false, features = ["getrandom"] }
rand_core = { version = "0.6", features = ["getrandom"] }

[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dev-dependencies]
getrandom = { version = "0.2", features = ["js"] }
Expand All @@ -73,8 +81,8 @@ default = ["batch"]
dev-graph = ["plotters", "tabbycat"]
gadget-traces = ["backtrace"]
sanity-checks = []
batch = ["rand_core/getrandom"]
profile = []
batch = ["rand/getrandom"]
profile = ["dep:ark-std"]

[lib]
bench = false
Expand Down
Loading