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

[WIP] Sync halo2 lib 0.4.0 #23

Draft
wants to merge 55 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
916b29f
Rollback to pse halo2 and halo2wrong for first release (#5)
han0110 Oct 24, 2022
2cd8b9d
Generalized `Halo2Loader` (#12)
han0110 Oct 28, 2022
25dbaf5
General refactor for further integration (#13)
han0110 Nov 8, 2022
5c31088
feat: implement ipa pcs and accumulation (#14)
han0110 Nov 9, 2022
ba167b7
ci: add `svm-rs` and install `solc@0.8.17` in job `test` (#16)
han0110 Nov 14, 2022
c5645e7
Update `EvmLoader` to generate Yul code instead of bytecode (#15)
DoHoonKim8 Nov 17, 2022
5e5de91
fix: pin all `revm` dependencies (#18)
han0110 Nov 30, 2022
50d69c1
fix: looser trait bound on impl `CostEstimation` for `Plonk` (#20)
han0110 Dec 17, 2022
dda7423
Restructure for more kind of verifier (#21)
han0110 Dec 23, 2022
6a518c9
docs: add `#![deny(missing_docs)]` and simple documents
han0110 Jan 6, 2023
3f3da27
refactor: remove redudant check `validate_ec_point` (still doesn not …
han0110 Jan 6, 2023
5023293
feat: expand more things and fix typos
han0110 Jan 20, 2023
8cc0b15
fix: rustdoc warnings
han0110 Jan 20, 2023
e4e0a4d
Merge pull request #22 from han0110/feature/docs
CPerezz Jan 20, 2023
2d5ef6b
chore: update dependencies (#24)
alexander-camuto Feb 1, 2023
df03d89
chore: update `halo2` and `halo2wrong` version (#25)
han0110 Feb 3, 2023
f1265f5
fix: enable `util::hash::poseidon` only when `feature = loader_halo2`…
han0110 Feb 14, 2023
4ad803a
feat: working update to halo2-lib v0.3.0
jonathanpwang Feb 19, 2023
c9e2d2c
feat: update zkevm bench
jonathanpwang Feb 19, 2023
2db9f42
feat: update recursion example
jonathanpwang Feb 19, 2023
396aea6
feat: switch poseidon native implementation to Scroll's audited version
jonathanpwang Feb 20, 2023
53a30eb
fix: invert determinant only once in Cramer's rule
jonathanpwang Feb 20, 2023
8b09067
Merge remote-tracking branch 'upstream/main' into sync/halo2-lib-v0.3.0
jonathanpwang Feb 21, 2023
85c68b4
chore: fix doc
jonathanpwang Feb 21, 2023
efec13b
chore
jonathanpwang Feb 21, 2023
c36ff8c
chore: fix Cargo.toml
jonathanpwang Feb 24, 2023
2fd73ab
chore: forgot to update halo2-base dependency in snark-verifier-sdk
jonathanpwang Feb 28, 2023
57aaba5
Minor update (#8)
jonathanpwang Apr 18, 2023
aecfd45
Moved `RangeWithInstanceCircuitBuilder` to halo2-lib (#9)
jonathanpwang May 5, 2023
95e6b4a
chore: fix halo2-base branch in sdk
jonathanpwang May 11, 2023
739c1f7
feat: update to halo2-lib new types (#10)
jonathanpwang May 22, 2023
b38400a
feat: add `assert` for non-empty accumulators in `decide_all` (#11)
jonathanpwang May 22, 2023
e24fa3c
feat: use `zip_eq` for `Polynomial` add/sub (#12)
jonathanpwang May 22, 2023
f510177
fix: git CI turn off all features
jonathanpwang May 22, 2023
9bbe6da
fix: `rotate_scalar` misbehaves on `i32::MIN` (#13)
jonathanpwang May 22, 2023
11e0ebc
fix: cleanup code quality (#14)
jonathanpwang May 22, 2023
1820e9c
fix: `split_by_ascii_whitespace` (#15)
jonathanpwang May 23, 2023
2641da5
fix: `batch_invert_and_mul` do not allow zeros (#16)
jonathanpwang May 23, 2023
1e64c30
feat: verify proof in release mode (#17)
jonathanpwang May 23, 2023
7041c6f
fix: add better error messages/docs for catching empty inputs (#18)
jonathanpwang May 23, 2023
eee5ec2
chore: add Cargo.lock
jonathanpwang May 23, 2023
9dbe913
chore: update Cargo dependencies
jonathanpwang May 23, 2023
5121c5b
chore: change halo2-lib branch to community-edition
jonathanpwang Jun 1, 2023
43e95ce
Release 0.1.1 (#19)
jonathanpwang Jun 20, 2023
ef6785a
Merge branch 'main' into community-edition
jonathanpwang Jul 1, 2023
cb4df8b
chore: pin scroll-poseidon commit
jonathanpwang Jul 20, 2023
6a5d234
chore: pin halo2-lib to v0.3.0-ce
jonathanpwang Sep 17, 2023
f07bb2c
Revert "chore: pin halo2-lib to v0.3.0-ce"
jonathanpwang Sep 17, 2023
7011e8c
[Community Edition] Prealpha release 0.1.6 (#35)
jonathanpwang Sep 21, 2023
cde1814
update dependecies for snark-verifier with halo2-pse
zhenfeizhang Sep 25, 2023
4bac515
fix examples
zhenfeizhang Oct 23, 2023
731b311
fix examples
zhenfeizhang Oct 23, 2023
26186de
fix examples
zhenfeizhang Dec 14, 2023
a166dae
fix tests and examples
zhenfeizhang Dec 15, 2023
73e90a3
ref cell aggrgation builder
zhenfeizhang Jan 1, 2024
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
54 changes: 54 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

on:
pull_request:
push:
branches:
- main

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: false

- uses: Swatinem/rust-cache@v1
with:
cache-on-failure: true

- name: Install solc
run: (hash svm 2>/dev/null || cargo install --version 0.2.23 svm-rs) && svm install 0.8.20 && solc --version

- name: Run test
run: cargo test --all -- --nocapture

- name: Run example
working-directory: "snark-verifier-sdk"
run: cargo run --example standard_plonk

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
override: false
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v1
with:
cache-on-failure: true

- name: Run clippy
run: cargo clippy --all --all-targets -- -D warnings
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@
testdata

Cargo.lock
params
agg.pk
break_points.json
*.srs
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ members = [
"snark-verifier",
"snark-verifier-sdk",
]
resolver = "2"

[profile.dev]
opt-level = 3
Expand Down Expand Up @@ -34,6 +35,5 @@ incremental = false
inherits = "release"
debug = true

# patch until PR https://github.com/privacy-scaling-explorations/halo2/pull/111 is merged
[patch."https://github.com/privacy-scaling-explorations/halo2.git"]
halo2_proofs = { git = "https://github.com/axiom-crypto/halo2.git", branch = "feat/serde-raw" }
halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "sync-halo2-lib-0.4.0" }
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# PLONK Verifier
# SNARK Verifier

Generic PLONK verifier.
Generic (S)NARK verifier.
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-2022-10-28
nightly-2023-08-12
46 changes: 26 additions & 20 deletions snark-verifier-sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "snark-verifier-sdk"
version = "0.0.1"
version = "0.1.6"
edition = "2021"

[dependencies]
itertools = "0.10.3"
itertools = "0.10.5"
lazy_static = "1.4.0"
num-bigint = "0.4.3"
num-integer = "0.1.45"
Expand All @@ -14,24 +14,21 @@ rand_chacha = "0.3.1"
hex = "0.4"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_with = { version = "2.2", optional = true }
bincode = "1.3.3"
ark-std = { version = "0.3.0", features = ["print-trace"], optional = true }

halo2-base = { git = "https://github.com/axiom-crypto/halo2-lib.git", tag = "v0.2.2", default-features = false }
halo2-base = { git = "https://github.com/scroll-tech/halo2-lib.git", branch = "sync-halo2-lib-0.4.0", default-features = false }
snark-verifier = { path = "../snark-verifier", default-features = false }
getset = "0.1.2"

# loader_evm
ethereum-types = { version = "0.14", default-features = false, features = ["std"], optional = true }
# sha3 = { version = "0.10", optional = true }
# revm = { version = "2.3.1", optional = true }
# bytes = { version = "1.2", optional = true }
# rlp = { version = "0.5", default-features = false, features = ["std"], optional = true }
ethereum-types = { version = "0.14.1", default-features = false, features = ["std"], optional = true }

# zkevm benchmarks
zkevm-circuits = { git = "https://github.com/jonathanpwang/zkevm-circuits.git", branch = "bench-12-04", features = ["test"], optional = true }
bus-mapping = { git = "https://github.com/jonathanpwang/zkevm-circuits.git", branch = "bench-12-04", optional = true }
eth-types = { git = "https://github.com/jonathanpwang/zkevm-circuits.git", branch = "bench-12-04", optional = true }
mock = { git = "https://github.com/jonathanpwang/zkevm-circuits.git", branch = "bench-12-04", optional = true }
# # zkevm benchmarks
# zkevm-circuits = { git = "https://github.com/privacy-scaling-explorations/zkevm-circuits.git", rev = "f834e61", features = ["test"], optional = true }
# bus-mapping = { git = "https://github.com/privacy-scaling-explorations/zkevm-circuits.git", rev = "f834e61", optional = true }
# eth-types = { git = "https://github.com/privacy-scaling-explorations/zkevm-circuits.git", rev = "f834e61", optional = true }
# mock = { git = "https://github.com/privacy-scaling-explorations/zkevm-circuits.git", rev = "f834e61", optional = true }

[dev-dependencies]
ark-std = { version = "0.3.0", features = ["print-trace"] }
Expand All @@ -44,16 +41,16 @@ crossterm = { version = "0.25" }
tui = { version = "0.19", default-features = false, features = ["crossterm"] }

[features]
default = ["loader_halo2", "loader_evm", "halo2-axiom", "halo2-base/jemallocator"]
default = ["loader_halo2", "loader_evm", "halo2-pse", "halo2-base/jemallocator", "display"]
display = ["snark-verifier/display", "dep:ark-std"]
loader_evm = ["snark-verifier/loader_evm", "dep:ethereum-types"]
loader_halo2 = ["snark-verifier/loader_halo2"]
parallel = ["snark-verifier/parallel"]
# EXACTLY one of halo2-pse / halo2-axiom should always be turned on; not sure how to enforce this with Cargo
halo2-pse = ["snark-verifier/halo2-pse"]
halo2-pse = ["snark-verifier/halo2-pse", "dep:serde_with"]
halo2-axiom = ["snark-verifier/halo2-axiom"]

zkevm = ["dep:zkevm-circuits", "dep:bus-mapping", "dep:mock", "dep:eth-types"]
# zkevm = ["dep:zkevm-circuits", "dep:bus-mapping", "dep:mock", "dep:eth-types"]

[[bench]]
name = "standard_plonk"
Expand All @@ -62,10 +59,19 @@ harness = false

[[bench]]
name = "zkevm"
required-features = ["loader_halo2", "zkevm", "halo2-pse", "halo2-base/jemallocator"]
required-features = ["loader_halo2", "loader_evm", "zkevm", "halo2-pse"]
harness = false

[[bench]]
name = "zkevm_plus_state"
required-features = ["loader_halo2", "zkevm", "halo2-pse", "halo2-base/jemallocator"]
harness = false
required-features = ["loader_halo2", "loader_evm", "zkevm", "halo2-pse"]
harness = false

[[bench]]
name = "read_pk"
required-features = ["loader_halo2"]
harness = false

[[example]]
name = "standard_plonk"
required-features = ["loader_halo2", "loader_evm"]
Loading
Loading