Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
87 changes: 14 additions & 73 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Every test the repository has, on every push and pull request:
#
# noir nargo fmt, nargo test, the circuits compiled and checked against their frozen pins
# contracts forge fmt, forge test (the precompiles mocked)
# rust cargo fmt, clippy, cargo test (offline and quick)
# e2e cargo test -- --ignored: the holder binding proved, and the devnet test (a node spawned,
# the pool deployed, Alice and Bob registering and transacting, every balance checked)
# commitlint conventional commits (pull requests)
#
# The circuits and the contract are emit-protocol's, checked in its own CI; emit-devnet takes its
# crates from crates.io.
#
# No job measures time or memory: the demo's timings are for the README, not for CI.
name: CI

Expand All @@ -25,8 +26,6 @@ permissions:

env:
CARGO_TERM_COLOR: always
NOIR_VERSION: 1.0.0-rc.3
NOIR_ZK_VERSION: 0.3.3

jobs:
commitlint:
Expand All @@ -42,80 +41,20 @@ jobs:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v6

noir:
name: Noir (fmt, test, freeze --check)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache: false
# The noir-zk CLI links bb's static library against libc++.
- name: Install libc++
run: sudo apt-get update -q && sudo apt-get install -yq libc++-dev libc++abi-dev
- name: Cache the toolchains
id: toolchains
uses: actions/cache@v4
with:
path: ~/.toolchains
key: toolchains-noir-${{ env.NOIR_VERSION }}-noir-zk-${{ env.NOIR_ZK_VERSION }}
- name: Install nargo and the noir-zk CLI (per-version directories)
if: steps.toolchains.outputs.cache-hit != 'true'
run: |
nargo_home="$HOME/.toolchains/noir-$NOIR_VERSION"
mkdir -p "$nargo_home/bin"
curl -fsSL https://raw.githubusercontent.com/noir-lang/noirup/main/noirup -o "$nargo_home/bin/noirup"
chmod +x "$nargo_home/bin/noirup"
NARGO_HOME="$nargo_home" "$nargo_home/bin/noirup" --version "$NOIR_VERSION"
cargo install --locked noir-zk-cli --version "=$NOIR_ZK_VERSION" --root "$HOME/.toolchains/noir-zk-$NOIR_ZK_VERSION"
- name: Toolchain paths
run: |
echo "$HOME/.toolchains/noir-$NOIR_VERSION/bin" >> "$GITHUB_PATH"
echo "$HOME/.toolchains/noir-zk-$NOIR_ZK_VERSION/bin" >> "$GITHUB_PATH"
- name: Cache the bb CRS
uses: actions/cache@v4
with:
path: ~/.bb-crs
key: noir-zk-srs-0f238856e557-72b8cdad9da8
- name: Provision the SRS noir-zk pins
run: scripts/srs.sh
- name: nargo fmt --check
working-directory: crates/circuits/noir
run: nargo fmt --check
- name: nargo test
working-directory: crates/circuits/noir
run: nargo test --workspace
- name: nargo compile
working-directory: crates/circuits/noir
run: nargo compile --workspace
- name: The compiled circuits match their frozen pins
working-directory: crates/circuits
run: noir-zk freeze --target noir/target --out . --assets assets --library emit-devnet@0.2.0 --check

contracts:
name: Contracts (forge fmt, forge test)
rust:
name: Rust (fmt, clippy, test)
runs-on: ubuntu-latest
defaults:
run:
working-directory: contracts
working-directory: emit-devnet
steps:
- uses: actions/checkout@v5
with:
submodules: recursive
- uses: foundry-rs/foundry-toolchain@v1
- name: forge fmt --check
run: forge fmt --check
- name: forge test
run: forge test

rust:
name: Rust (fmt, clippy, test)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
path: emit-devnet
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: rustfmt, clippy
rust-src-dir: emit-devnet
# noir-zk-backend links bb's static library against libc++.
- name: Install libc++
run: sudo apt-get update -q && sudo apt-get install -yq libc++-dev libc++abi-dev
Expand All @@ -129,11 +68,16 @@ jobs:
e2e:
name: Proving and the devnet (cargo test -- --ignored)
runs-on: ubuntu-latest
defaults:
run:
working-directory: emit-devnet
steps:
- uses: actions/checkout@v5
with:
submodules: recursive
path: emit-devnet
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
rust-src-dir: emit-devnet
- uses: foundry-rs/foundry-toolchain@v1
- name: Install libc++
run: sudo apt-get update -q && sudo apt-get install -yq libc++-dev libc++abi-dev
Expand All @@ -144,9 +88,6 @@ jobs:
key: noir-zk-srs-0f238856e557-72b8cdad9da8
- name: Provision the SRS noir-zk pins
run: scripts/srs.sh
- name: Build the contracts
working-directory: contracts
run: forge build
- name: The holder binding, proved
run: cargo test -p zkpool -- --ignored holder
- name: The devnet end to end
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

61 changes: 46 additions & 15 deletions Cargo.lock

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

28 changes: 14 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["crates/circuits", "crates/node", "crates/cli"]
members = ["crates/node", "crates/cli"]
resolver = "2"

[workspace.package]
Expand All @@ -10,27 +10,27 @@ license = "MIT"
publish = false

[workspace.dependencies]
# noir-zk 0.3.3 (crates.io): layered registries, the generic pipeline kernels (the key hash a
# witness bb constrains), Chonk via bb's FFI. Every layer below is bound with the same release.
# noir-zk 0.3.3 (crates.io): layered registries, the generic pipeline kernels, Chonk via bb's FFI.
# Every layer below is bound with the same release.
noir-zk-core = "=0.3.3"
noir-zk-backend = { version = "=0.3.3", features = ["packs", "http"] }
noir-zk-codegen = "=0.3.3"
# The identity layer: eid-circuits v0.8.2 (noir-zk 0.3.3; families eid/dsc, eid/sod, eid/document;
# RSA steps with a 2-bit windowed exponentiation since v0.8.1).
eid-circuits = { git = "https://github.com/zk-experiments/eid-circuits", tag = "v0.8.2", features = ["packs", "http"] }
eid-prover = { git = "https://github.com/zk-experiments/eid-circuits", tag = "v0.8.2" }
# eid-prover renders the eid steps' inputs for a registration (the tag of the eid-circuits release
# emit-circuits wraps; eid-prover itself isn't on crates.io).
eid-prover = { git = "https://github.com/zk-experiments/eid-circuits", tag = "v0.8.3" }
csca-registry = { git = "https://github.com/zk-experiments/csca-registry", tag = "v0.3.1" }
# The channel layer: zk-encryption v0.1.3 (noir-zk 0.3.3; frozen as zk-encryption@0.1.3, the session
# 6% smaller since v0.1.2; bytecode bundled).
zk-encryption-circuits = { git = "https://github.com/zk-experiments/zk-encryption", tag = "v0.1.3", features = ["serde"] }
emit-devnet-circuits = { path = "crates/circuits" }
# The channel layer: zk-encryption-circuits 0.1.5 (crates.io; bytecode bundled), the one
# emit-circuits wraps.
zk-encryption-circuits = { version = "=0.1.5", features = ["serde"] }
# The protocol (github.com/zk-experiments/emit-protocol): its values, the pool's ABI and the
# circuits' registry.
emit-protocol = "=0.1.0"
emit-protocol-abi = "=0.1.0"
emit-circuits = "=0.1.0"
ark-ff = "0.6"
hex = "0.4"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sha2 = "0.10"
toml = "0.9"
ureq = { version = "3", default-features = false, features = ["rustls"] }

# Witness solving and proving are unusably slow unoptimised (noir-zk's note).
[profile.dev]
Expand Down
Loading
Loading