Skip to content

Commit

Permalink
Rollback to pse halo2 and halo2wrong for first release (#5)
Browse files Browse the repository at this point in the history
* feat: move `Accumulator` to `accumulator.rs`

* feat: update due to halo2

* feat: upgrade to use branch `feature/generic-instructions` of `halo2wrong`

* refactor: rollback to `{halo2,halo2_wrong}` without challenge API and cleanup dependencies

* chore: rename statement to instance and auxliary to witness

* chore: use `finalize` instead of `code`

* feat: add `Code::deployment` and `EvmLoader::deployment_code`; add example `evm-verifier-codegen`

* fix: typo

* feat: reduce generated evm verifier size; rename to `evm-verifier` and add another example `evm-verifier-with-accumulator`

* fix: due to `halo2wrong`

* feat: reorganize mods and traits

* fix: allow empty `values` in `sum_*` and move them under `ScalarLoader`

* ci: use `--all-features` for `cargo test`

* fix: use same strategy for aggregation testing

* fix: simplify trait `PlonkVerifier` again

* fix: move system specified transcript under mod `system`

* feat: add `quotient_poly` info in `Protocol`

* feat: implement linearization for circom integration

* feat: re-export loader's dependency for consumer

* refactor: for circom's integration

* tmp: pin `revm` to rev

* fix: remove parentheses

* fix: upgrade for multi-phase halo2

* feat: improve error reporting

* chore: rename crate to snake case

* feat: add `Domain` as an input of `PolynomialCommitmentScheme::read_proof`

* refactor: for further integration

* feat: generalize to suppoer also ipa and add builder fns to `system::halo2::Config`

* feat: add `KzgDecider` for simple evm verifier

* refactor: split `AccumulationScheme` and `AccumulatorEncoding`

* refactor: split `PolynomialCommitmentScheme` and `MultiOpenScheme`

* fix: not need sealed actually

* fix: `chunk_size` should be `LIMBS` when recovering accumulator

* feat: add `Expression::DistributePowers` to avoid stack overflow

* fix: update and pin foundry

* fix: move testing circuits under `system/halo2`

* fix: allow accumulate single accumulator

* feat: remove all patch and make less depending `halo2wrong`
  • Loading branch information
han0110 authored Oct 24, 2022
1 parent a11b9c1 commit 916b29f
Show file tree
Hide file tree
Showing 73 changed files with 7,063 additions and 6,232 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
cache-on-failure: true

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


lint:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
.DS_Store

/target
fixture
testdata

Cargo.lock
69 changes: 33 additions & 36 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,57 +1,54 @@
[package]
name = "plonk-verifier"
name = "plonk_verifier"
version = "0.1.0"
edition = "2021"

[dependencies]
ff = "0.12.0"
group = "0.12.0"
itertools = "0.10.3"
lazy_static = "1.4.0"
num-bigint = "0.4"
num-traits = "0.2"
num-bigint = "0.4.3"
num-integer = "0.1.45"
num-traits = "0.2.15"
rand = "0.8"
rand_chacha = "0.3.1"
halo2_curves = { git = "https://github.com/privacy-scaling-explorations/halo2curves", tag = "0.2.1", package = "halo2curves" }

# halo2
blake2b_simd = { version = "1.0.0", optional = true }
halo2_proofs = { version = "0.2.0", optional = true }
halo2_wrong = { git = "https://github.com/privacy-scaling-explorations/halo2wrong", package = "halo2wrong", optional = true }
halo2_wrong_ecc = { git = "https://github.com/privacy-scaling-explorations/halo2wrong", package = "ecc", optional = true }
halo2_wrong_maingate = { git = "https://github.com/privacy-scaling-explorations/halo2wrong", package = "maingate", optional = true }
halo2_wrong_transcript = { git = "https://github.com/privacy-scaling-explorations/halo2wrong", package = "transcript", optional = true }
poseidon = { git = "https://github.com/privacy-scaling-explorations/poseidon", branch = "padding", optional = true }

# evm
halo2_curves = { git = "https://github.com/privacy-scaling-explorations/halo2curves", tag = "0.3.0", package = "halo2curves" }

# system_halo2
halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2", tag = "v2022_10_22", optional = true }

# loader_evm
ethereum_types = { package = "ethereum-types", version = "0.13.1", default-features = false, features = ["std"], optional = true }
foundry_evm = { git = "https://github.com/foundry-rs/foundry", package = "foundry-evm", rev = "93ee742d", optional = true }
crossterm = { version = "0.22.1", optional = true }
tui = { version = "0.16.0", default-features = false, features = ["crossterm"], optional = true }
sha3 = { version = "0.10.1", optional = true }

# loader_halo2
halo2_wrong_ecc = { git = "https://github.com/privacy-scaling-explorations/halo2wrong", tag = "v2022_10_22", package = "ecc", optional = true }
poseidon = { git = "https://github.com/privacy-scaling-explorations/poseidon", tag = "v2022_10_22", optional = true }

[dev-dependencies]
paste = "1.0.7"

# system_halo2
halo2_wrong_ecc = { git = "https://github.com/privacy-scaling-explorations/halo2wrong", tag = "v2022_10_22", package = "ecc" }

# loader_evm
foundry_evm = { git = "https://github.com/foundry-rs/foundry", package = "foundry-evm", rev = "6b1ee60e" }
crossterm = { version = "0.22.1" }
tui = { version = "0.16.0", default-features = false, features = ["crossterm"] }

[features]
default = ["halo2", "evm"]
test = ["halo2", "evm"]
default = ["loader_evm", "loader_halo2", "system_halo2"]

halo2 = ["dep:blake2b_simd", "dep:halo2_proofs", "dep:halo2_wrong", "dep:halo2_wrong_ecc", "dep:halo2_wrong_maingate", "dep:halo2_wrong_transcript", "dep:poseidon"]
evm = ["dep:foundry_evm", "dep:crossterm", "dep:tui", "dep:ethereum_types", "dep:sha3"]
sanity-check = []
loader_evm = ["dep:ethereum_types", "dep:sha3"]
loader_halo2 = ["dep:halo2_proofs", "dep:halo2_wrong_ecc", "dep:poseidon"]

[patch.crates-io]
halo2_proofs = { git = "https://github.com/han0110/halo2", branch = "experiment", package = "halo2_proofs" }
system_halo2 = ["dep:halo2_proofs"]

[patch."https://github.com/privacy-scaling-explorations/halo2"]
halo2_proofs = { git = "https://github.com/han0110/halo2", branch = "experiment", package = "halo2_proofs" }
sanity_check = []

[patch."https://github.com/privacy-scaling-explorations/halo2curves"]
halo2_curves = { git = "https://github.com//privacy-scaling-explorations/halo2curves", tag = "0.2.1", package = "halo2curves" }
[[example]]
name = "evm-verifier"
required-features = ["loader_evm", "system_halo2"]

[patch."https://github.com/privacy-scaling-explorations/halo2wrong"]
halo2_wrong = { git = "https://github.com/han0110/halo2wrong", branch = "feature/range-chip-with-tagged-table", package = "halo2wrong" }
halo2_wrong_ecc = { git = "https://github.com/han0110/halo2wrong", branch = "feature/range-chip-with-tagged-table", package = "ecc" }
halo2_wrong_maingate = { git = "https://github.com/han0110/halo2wrong", branch = "feature/range-chip-with-tagged-table", package = "maingate" }
halo2_wrong_transcript = { git = "https://github.com/han0110/halo2wrong", branch = "feature/range-chip-with-tagged-table", package = "transcript" }
[[example]]
name = "evm-verifier-with-accumulator"
required-features = ["loader_halo2", "loader_evm", "system_halo2"]
Loading

0 comments on commit 916b29f

Please sign in to comment.