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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ jobs:
libclang-dev \
protobuf-compiler
- name: Run clippy (all targets)
run: cargo clippy --all-targets --locked -- -D warnings
run: SKIP_CIRCUIT_BUILD=1 cargo clippy --all-targets --locked -- -D warnings
- name: Run clippy (library only)
run: cargo clippy --lib --locked -- -D warnings
run: SKIP_CIRCUIT_BUILD=1 cargo clippy --lib --locked -- -D warnings
- name: Generate documentation
run: cargo doc --locked --no-deps
run: SKIP_CIRCUIT_BUILD=1 cargo doc --locked --no-deps
- name: Check documentation (with private items)
run: cargo doc --locked --no-deps --document-private-items
run: SKIP_CIRCUIT_BUILD=1 cargo doc --locked --no-deps --document-private-items

security-audit:
name: 🔒 Security Audit
Expand Down
44 changes: 22 additions & 22 deletions Cargo.lock

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

20 changes: 11 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,20 @@ subxt-metadata = "0.44"
# ZK proof generation (aligned with chain)
anyhow = "1.0"

qp-plonky2 = { version = "1.4.0", default-features = false, features = ["rand", "std"] }
qp-wormhole-circuit = { version = "1.4.0", default-features = false, features = ["std"] }
qp-wormhole-prover = { version = "1.4.0", default-features = false, features = ["std"] }
qp-wormhole-verifier = { version = "1.4.0", default-features = false, features = ["std"] }
qp-wormhole-aggregator = { version = "1.4.0", default-features = false, features = ["rayon", "std"] }
qp-wormhole-inputs = { version = "1.4.0", default-features = false, features = ["std"] }
qp-zk-circuits-common = { version = "1.4.0", default-features = false, features = ["std"] }
qp-wormhole-circuit-builder = { version = "1.4.0" }
qp-plonky2 = { version = "1.4.1", default-features = false, features = ["rand", "std"] }
qp-wormhole-circuit = { version = "1.4.2", default-features = false, features = ["std"] }
qp-wormhole-prover = { version = "1.4.2", default-features = false, features = ["std"] }
qp-wormhole-verifier = { version = "1.4.2", default-features = false, features = ["std"] }
qp-wormhole-aggregator = { version = "1.4.2", default-features = false, features = ["rayon", "std"] }
qp-wormhole-inputs = { version = "1.4.2", default-features = false, features = ["std"] }
qp-zk-circuits-common = { version = "1.4.2", default-features = false, features = ["std"] }
qp-wormhole-circuit-builder = { version = "1.4.2" }


[build-dependencies]
qp-wormhole-circuit-builder = { version = "1.4.0" }
hex = "0.4"
qp-poseidon-core = "1.4.0"
qp-wormhole-circuit-builder = { version = "1.4.2" }

[dev-dependencies]
tempfile = "3.8.1"
Expand Down
39 changes: 39 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,40 @@
//! `generated-bins/` in the project root for runtime access — but only during
//! normal builds, **not** during `cargo publish` verification where modifying the
//! source directory is forbidden.
//!
//! Set `SKIP_CIRCUIT_BUILD=1` to skip circuit generation (useful for CI jobs
//! that don't need the circuits, like clippy/doc checks).

use std::{env, path::Path, time::Instant};

/// Compute Poseidon2 hash of bytes and return hex string
fn poseidon_hex(data: &[u8]) -> String {
let hash = qp_poseidon_core::hash_bytes(data);
hex::encode(&hash[..16]) // first 16 bytes for shorter display
}

/// Print hash of a generated binary file
fn print_bin_hash(dir: &Path, filename: &str) {
let path = dir.join(filename);
if let Ok(data) = std::fs::read(&path) {
println!(
"cargo:warning= {}: {} bytes, hash: {}",
filename,
data.len(),
poseidon_hex(&data)
);
}
}

fn main() {
// Allow skipping circuit generation for CI jobs that don't need it
if env::var("SKIP_CIRCUIT_BUILD").is_ok() {
println!(
"cargo:warning=[quantus-cli] Skipping circuit generation (SKIP_CIRCUIT_BUILD is set)"
);
return;
}

let out_dir = env::var("OUT_DIR").expect("OUT_DIR not set");
let manifest_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set");

Expand Down Expand Up @@ -49,6 +79,15 @@ fn main() {
elapsed.as_secs_f64()
);

// Print hashes of generated binaries
print_bin_hash(&build_output_dir, "common.bin");
print_bin_hash(&build_output_dir, "verifier.bin");
print_bin_hash(&build_output_dir, "prover.bin");
print_bin_hash(&build_output_dir, "dummy_proof.bin");
print_bin_hash(&build_output_dir, "aggregated_common.bin");
print_bin_hash(&build_output_dir, "aggregated_verifier.bin");
print_bin_hash(&build_output_dir, "aggregated_prover.bin");

// Copy bins to project root for runtime access, but NOT during `cargo publish`
// verification (manifest_dir is inside target/package/ in that case).
let project_bins = Path::new(&manifest_dir).join("generated-bins");
Expand Down
Loading