Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fcb69b5
feat: on-chain proof verification test for c0
hmzakhalid Feb 13, 2026
31a6dce
chore: remove conflict
hmzakhalid Feb 13, 2026
6571109
chore: remove conflict
hmzakhalid Feb 13, 2026
664987f
Merge branch 'main' into feat/onchain-zk-verification
hmzakhalid Feb 15, 2026
61d2b2f
Merge branch 'main' into feat/onchain-zk-verification
hmzakhalid Feb 15, 2026
f4fce0f
Merge branch 'main' into feat/onchain-zk-verification
hmzakhalid Feb 15, 2026
d53ad55
Merge branch 'main' into feat/onchain-zk-verification
hmzakhalid Feb 16, 2026
a93bc5e
fix: fixtures for zk circuits
hmzakhalid Feb 17, 2026
837c1c5
Merge branch 'main' into feat/onchain-zk-verification
hmzakhalid Feb 17, 2026
86b16fa
Merge branch 'main' into feat/onchain-zk-verification
hmzakhalid Feb 17, 2026
7ae9a4d
feat: use compiled circuits for test
hmzakhalid Feb 17, 2026
0f270d1
fix: add bb to CI
hmzakhalid Feb 17, 2026
26af8e9
fix: add bb to CI
hmzakhalid Feb 17, 2026
eee267c
Merge branch 'main' into feat/onchain-zk-verification
hmzakhalid Feb 18, 2026
63d5248
fix: use ZkProver for onchain test
hmzakhalid Feb 18, 2026
6915082
Merge branch 'main' into feat/onchain-zk-verification
hmzakhalid Feb 18, 2026
b2ed277
Merge branch 'main' into feat/onchain-zk-verification
hmzakhalid Feb 18, 2026
5544b40
Merge branch 'main' into feat/onchain-zk-verification
hmzakhalid Feb 19, 2026
e3185fd
chore: update zk version
hmzakhalid Feb 19, 2026
ffb68ab
chore: review fixes
hmzakhalid Feb 19, 2026
e7267f1
feat: update integration test
hmzakhalid Feb 19, 2026
5bf038d
chore: print version log for zk download
hmzakhalid Feb 19, 2026
988b130
fix: download the correct url
hmzakhalid Feb 19, 2026
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
127 changes: 73 additions & 54 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ env:
NODE_VERSION: 22
RUST_TOOLCHAIN: 1.86.0
NOIR_TOOLCHAIN: v1.0.0-beta.15
BB_VERSION: 3.0.0-nightly.20251104
HARDHAT_VAR_MNEMONIC: 'test test test test test test test test test test test junk'
HARDHAT_VAR_INFURA_API_KEY: 'zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'
PRIVATE_KEY: '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'
Expand All @@ -32,7 +33,7 @@ permissions:
packages: write

jobs:
rust_unit:
rust_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand Down Expand Up @@ -75,46 +76,6 @@ jobs:
- name: Run Unit Tests
run: 'cargo test --lib && cargo test --doc'

rust_integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- name: Cache Rust dependencies
uses: ./.github/actions/cache-dependencies

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}

# We must install foundry in order to be able to test anvil
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Install solc
run: |
sudo add-apt-repository ppa:ethereum/ethereum \
&& sudo apt-get update -y \
&& sudo apt-get install -y solc

- name: pnpm-setup
uses: pnpm/action-setup@v4

# We need to setup node in order to compile the hardhat contracts to get the artifacts
- name: 'Setup node'
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml

- name: 'Install the dependencies'
run: 'pnpm install --frozen-lockfile'

- name: Checking code format rust
run: pnpm rust:lint

- name: Run Integration Tests
run: 'cargo test --test integration -- --nocapture'

Expand Down Expand Up @@ -310,14 +271,6 @@ jobs:
- name: 'Install the dependencies'
run: 'pnpm install --frozen-lockfile'

- name: 'Lint the code'
run: 'pnpm lint'

- name: 'Add lint summary'
run: |
echo "## Lint results" >> $GITHUB_STEP_SUMMARY
echo "✅ Passed" >> $GITHUB_STEP_SUMMARY

- name: 'Run prebuild'
run: 'pnpm test:integration prebuild'

Expand Down Expand Up @@ -611,7 +564,7 @@ jobs:
path: ./examples/CRISP/playwright-report/
retention-days: 30

test_enclave_circuits:
build_circuits:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
Expand All @@ -623,19 +576,85 @@ jobs:
with:
toolchain: ${{ env.NOIR_TOOLCHAIN }}

- name: Install Barretenberg (bb)
run: |
curl -fsSL "https://github.com/AztecProtocol/aztec-packages/releases/download/v${{ env.BB_VERSION }}/barretenberg-amd64-linux.tar.gz" -o bb.tar.gz
mkdir -p bb_extract && tar -xzf bb.tar.gz -C bb_extract
BB_BIN=$(find bb_extract -name bb -type f | head -n 1)
sudo mv "$BB_BIN" /usr/local/bin/bb
chmod +x /usr/local/bin/bb
bb --version

- name: Check formatting
run: ./scripts/lint-circuits.sh

- name: Test Noir circuits
run: ./scripts/test-circuits.sh

- name: Upload circuit artifacts
- name: pnpm-setup
uses: pnpm/action-setup@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build circuits
run: pnpm build:circuits

- name: Upload compiled circuit artifacts
uses: actions/upload-artifact@v4
with:
name: circuit-artifacts
path: circuits/target/
name: compiled-circuits
path: |
circuits/bin/dkg/target/
circuits/bin/threshold/target/
retention-days: 1
if-no-files-found: warn
if-no-files-found: error

zk_prover_e2e:
runs-on: ubuntu-latest
needs: [build_circuits]
steps:
- uses: actions/checkout@v6

- name: Cache Rust dependencies
uses: ./.github/actions/cache-dependencies

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}

- name: Install Barretenberg (bb)
run: |
curl -fsSL "https://github.com/AztecProtocol/aztec-packages/releases/download/v${{ env.BB_VERSION }}/barretenberg-amd64-linux.tar.gz" -o bb.tar.gz
mkdir -p bb_extract && tar -xzf bb.tar.gz -C bb_extract
BB_BIN=$(find bb_extract -name bb -type f | head -n 1)
sudo mv "$BB_BIN" /usr/local/bin/bb
chmod +x /usr/local/bin/bb
bb --version

- name: Download compiled circuit artifacts
uses: actions/download-artifact@v4
with:
name: compiled-circuits
path: circuits/bin/

- name: Verify circuit artifacts
run: |
echo "DKG circuits:"
ls -la circuits/bin/dkg/target/*.json circuits/bin/dkg/target/*.vk
echo "Threshold circuits:"
ls -la circuits/bin/threshold/target/*.json circuits/bin/threshold/target/*.vk

- name: Run ZK prover e2e tests
run: cargo test -p e3-zk-prover --test local_e2e_tests -- --nocapture

build_e3_support_dev:
runs-on: ubuntu-latest
Expand Down
46 changes: 41 additions & 5 deletions crates/cli/src/noir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,18 @@ async fn execute_status(backend: &ZkBackend) -> Result<()> {
}

async fn execute_setup(backend: &ZkBackend, force: bool) -> Result<()> {
println!("Setting up ZK prover...\n");
println!(
" target bb version: {}",
backend.config.required_bb_version
);
println!(
" target circuits version: {}\n",
backend.config.required_circuits_version
);

if force {
println!("Force reinstalling ZK prover components...\n");
println!("Setting up ZK prover...\n");

// Force reinstall by directly downloading components
backend
Expand All @@ -142,22 +151,49 @@ async fn execute_setup(backend: &ZkBackend, force: bool) -> Result<()> {
} else {
let status = backend.check_status().await;
if matches!(status, SetupStatus::Ready) {
let version_info = backend.load_version_info().await;
println!("ZK prover is already set up and up to date.");
println!(
" bb version: {}",
version_info.bb_version.as_deref().unwrap_or("unknown")
);
println!(
" circuits version: {}",
version_info
.circuits_version
.as_deref()
.unwrap_or("unknown")
);
println!(" Use --force to reinstall.");
return Ok(());
}

println!("Setting up ZK prover...\n");

backend
.ensure_installed()
.await
.map_err(|e| anyhow!("Setup failed: {}", e))?;
}

let version_info = backend.load_version_info().await;

println!("\nZK prover setup complete!");
println!(" bb binary: {}", backend.bb_binary.display());
println!(" circuits: {}", backend.circuits_dir.display());
println!();
println!(" bb binary: {}", backend.bb_binary.display());
println!(
" bb version: {}",
version_info.bb_version.as_deref().unwrap_or("unknown")
);
println!(" circuits dir: {}", backend.circuits_dir.display());
println!(
" circuits version: {}",
version_info
.circuits_version
.as_deref()
.unwrap_or("unknown")
);
if let Some(ref ts) = version_info.last_updated {
println!(" last updated: {}", ts);
}

Ok(())
}
38 changes: 17 additions & 21 deletions crates/events/src/enclave_event/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,18 @@ pub enum CircuitName {
SkShareComputation,
/// E_SM share computation proof (C2b).
ESmShareComputation,
/// Encrypted sk share proof (C3a).
SkShareEncryption,
/// Encrypted E_SM share proof (C3b).
ESmShareEncryption,
/// Sk share decryption proof (C4a).
DkgSkShareDecryption,
/// E_SM share decryption proof (C4b).
DkgESmShareDecryption,
/// Share encryption proof (C3).
ShareEncryption,
/// DKG share decryption proof (C4).
DkgShareDecryption,
/// Public key aggregation proof (C5).
PkAggregation,
/// Decryption share proof (C6).
ThresholdShareDecryption,
/// Decrypted shares aggregation proof (C7).
DecryptedSharesAggregation,
/// Decrypted shares aggregation proof — BigNum variant (C7a).
DecryptedSharesAggregationBn,
/// Decrypted shares aggregation proof — Modular variant (C7b).
DecryptedSharesAggregationMod,
}

impl CircuitName {
Expand All @@ -67,13 +65,12 @@ impl CircuitName {
CircuitName::PkGeneration => "pk_generation",
CircuitName::SkShareComputation => "sk_share_computation",
CircuitName::ESmShareComputation => "e_sm_share_computation",
CircuitName::SkShareEncryption => "sk_share_encryption",
CircuitName::ESmShareEncryption => "e_sm_share_encryption",
CircuitName::DkgSkShareDecryption => "dkg_sk_share_decryption",
CircuitName::DkgESmShareDecryption => "dkg_e_sm_share_decryption",
CircuitName::ShareEncryption => "share_encryption",
CircuitName::DkgShareDecryption => "share_decryption",
CircuitName::PkAggregation => "pk_aggregation",
CircuitName::ThresholdShareDecryption => "threshold_share_decryption",
CircuitName::DecryptedSharesAggregation => "decrypted_shares_aggregation",
CircuitName::ThresholdShareDecryption => "share_decryption",
Comment thread
hmzakhalid marked this conversation as resolved.
CircuitName::DecryptedSharesAggregationBn => "decrypted_shares_aggregation_bn",
CircuitName::DecryptedSharesAggregationMod => "decrypted_shares_aggregation_mod",
}
}

Expand All @@ -82,14 +79,13 @@ impl CircuitName {
CircuitName::PkBfv => "dkg",
CircuitName::SkShareComputation => "dkg",
CircuitName::ESmShareComputation => "dkg",
CircuitName::SkShareEncryption => "dkg",
CircuitName::ESmShareEncryption => "dkg",
CircuitName::DkgSkShareDecryption => "dkg",
CircuitName::DkgESmShareDecryption => "dkg",
CircuitName::ShareEncryption => "dkg",
CircuitName::DkgShareDecryption => "dkg",
CircuitName::PkGeneration => "threshold",
CircuitName::ThresholdShareDecryption => "threshold",
CircuitName::PkAggregation => "threshold",
CircuitName::DecryptedSharesAggregation => "threshold",
CircuitName::DecryptedSharesAggregationBn => "threshold",
CircuitName::DecryptedSharesAggregationMod => "threshold",
}
}

Expand Down
Loading
Loading