Skip to content

Commit

Permalink
chore: deny & cleanup (#45)
Browse files Browse the repository at this point in the history
update readme

fix ci

fix ci
  • Loading branch information
Ethan-000 committed Jun 27, 2023
1 parent 634fff4 commit 3aee1c0
Show file tree
Hide file tree
Showing 11 changed files with 402 additions and 55 deletions.
23 changes: 0 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2022-10-28
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
Expand All @@ -69,7 +68,6 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2022-10-28
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true
Expand All @@ -79,24 +77,3 @@ jobs:

- name: run pse test
run: cargo nextest run --package noir_halo2_backend_pse --test-threads=1

wasm_build:
name: build pse wasm
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2022-10-28
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Install latest wasm-pack release
uses: taiki-e/install-action@wasm-pack

- name: build wasm
run: wasm-pack build "crates/noir_halo2_backend_pse"
24 changes: 24 additions & 0 deletions .github/workflows/deny.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: deny

on:
push:
paths: [Cargo.lock]
pull_request:
paths: [Cargo.lock]
merge_group:

env:
RUSTFLAGS: -D warnings
CARGO_TERM_COLOR: always

concurrency: deny-${{ github.head_ref || github.ref || github.run_id }}

jobs:
deny:
name: deny
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check all
32 changes: 32 additions & 0 deletions .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: wasm

on: [push, pull_request]

env:
RUSTFLAGS: -D warnings
CARGO_TERM_COLOR: always

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true

jobs:
wasm_build:
name: build pse wasm
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2022-10-28
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

- name: Install latest wasm-pack release
uses: taiki-e/install-action@wasm-pack

- name: build wasm
run: wasm-pack build "crates/noir_halo2_backend_pse"
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@ reqwest = { version = "0.11.16", default-features = false, features = [
serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1.0.68"
noir_halo2_backend_common = { path = "crates/noir_halo2_backend_common" }

# wasm
console_error_panic_hook = "0.1.7"
getrandom = { version = "0.2", features = ["js"] }
serde-wasm-bindgen = "0.5.0"
tokio = { version = "1.28.1", features = ["rt"] }
wasm-bindgen = { version = "0.2.81", features = ["serde-serialize"] }
24 changes: 11 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,41 +17,33 @@ This crate will not be possible without
## Installtion

```text
git clone https://github.com/Ethan-000/noir
git clone https://github.com/Ethan-000/noir --branch demo-0.1.2
```

```text
cd noir
```

```text
git checkout demo
```

```text
cd crates/nargo_cli
```

To install pse's halo2 as backend:

```text
cargo install --path . --locked --features pse_halo2_backend --no-default-features
cargo install --path crates/nargo_cli --locked --features pse_halo2_backend --no-default-features
```

To install axioms's halo2 as backend:

```text
cargo install --path . --locked --features axiom_halo2_backend --no-default-features
cargo install --path crates/nargo_cli --locked --features axiom_halo2_backend --no-default-features
```

Notice that axiom's fork is built on pse's fork and should be similar.

## Examples

cd to the `examples` folder of this crate
cd to the `crates/noir_halo2_backend_common/test_programs` folder of this crate and choose one of the tests/examples eg. 3_add

```text
cd add
cd 3_add
```

to generate proof run
Expand All @@ -66,6 +58,12 @@ to verify proof run
nargo verify add
```

to generates a solidity verifier smart contract for the program run

```text
nargo codegen-verifier
```

## Features

- [ ] [halo2-zcash](https://github.com/zcash/halo2)
Expand Down
15 changes: 10 additions & 5 deletions crates/noir_halo2_backend_axiom/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "noir_halo2_backend_axiom"
version.workspace = true
edition.workspace = true
license.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -23,6 +24,10 @@ snark-verifier = { git = "https://github.com/axiom-crypto/snark-verifier.git", t
[dev-dependencies]
criterion = "0.5.1"

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

[[bench]]
name = "bench_noir_halo2_axiom_prove"
harness = false
Expand All @@ -33,8 +38,8 @@ harness = false

# wasm not supported because halo2-base uses jemallocator
[target.'cfg(target_family = "wasm")'.dependencies]
console_error_panic_hook = "0.1.7"
getrandom = { version = "0.2", features = ["js"] }
serde-wasm-bindgen = "0.5.0"
tokio = { version = "1.28.1", features = ["rt"] }
wasm-bindgen = { version = "0.2.81", features = ["serde-serialize"] }
console_error_panic_hook.workspace = true
getrandom.workspace = true
serde-wasm-bindgen.workspace = true
tokio.workspace = true
wasm-bindgen.workspace = true
13 changes: 6 additions & 7 deletions crates/noir_halo2_backend_common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "noir_halo2_backend_common"
version.workspace = true
edition.workspace = true
license.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -16,11 +17,9 @@ reqwest = { version = "0.11.16", default-features = false, features = [
serde_json.workspace = true
thiserror = "1.0.21"

# can only build on linux because the use of a c lib
[target.'cfg(target_family = "wasm")'.dependencies]
console_error_panic_hook = "0.1.7"
getrandom = { version = "0.2", features = ["js"] }
serde-wasm-bindgen = "0.5.0"
tokio = { version = "1.28.1", features = ["rt"] }
wasm-bindgen = { version = "0.2.81", features = ["serde-serialize"] }

console_error_panic_hook.workspace = true
getrandom.workspace = true
serde-wasm-bindgen.workspace = true
tokio.workspace = true
wasm-bindgen.workspace = true
16 changes: 11 additions & 5 deletions crates/noir_halo2_backend_pse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "noir_halo2_backend_pse"
version.workspace = true
edition.workspace = true
license.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down Expand Up @@ -39,6 +40,10 @@ pse_snark_verifier = { git = "https://github.com/privacy-scaling-explorations/sn
[dev-dependencies]
criterion = "0.5.1"

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

[[bench]]
name = "bench_noir_halo2_pse_prove"
harness = false
Expand All @@ -47,9 +52,10 @@ harness = false
name = "bench_noir_halo2_pse_verify"
harness = false

# can only build on linux because the use of a c lib
[target.'cfg(target_family = "wasm")'.dependencies]
console_error_panic_hook = "0.1.7"
getrandom = { version = "0.2", features = ["js"] }
serde-wasm-bindgen = "0.5.0"
tokio = { version = "1.28.1", features = ["rt"] }
wasm-bindgen = { version = "0.2.81", features = ["serde-serialize"] }
console_error_panic_hook.workspace = true
getrandom.workspace = true
serde-wasm-bindgen.workspace = true
tokio.workspace = true
wasm-bindgen.workspace = true
1 change: 1 addition & 0 deletions crates/noir_halo2_backend_zcash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "noir_halo2_backend_zcash"
version.workspace = true
edition.workspace = true
license.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
Loading

0 comments on commit 3aee1c0

Please sign in to comment.