Skip to content

Public proof agg#116

Open
illuzen wants to merge 6 commits into
mainfrom
illuzen/public-proof-agg
Open

Public proof agg#116
illuzen wants to merge 6 commits into
mainfrom
illuzen/public-proof-agg

Conversation

@illuzen

@illuzen illuzen commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Wires the new second-layer ("public batch") wormhole aggregation into the CLI so the
full flow — leaf proofs → private batches → public batch → on-chain verification with
aggregator fee rebate — can be exercised end to end against a dev node.

Changes

New / extended commands

  • wormhole aggregate-public: aggregates private-batch proof files into a single
    public-batch proof, embedding the wallet's address as the aggregator_address
    (partial batches are padded with dummies automatically).
  • wormhole verify-public-batch: submits a public-batch proof via the unsigned
    verify_public_batch extrinsic and reports the resulting events, including the
    aggregator rebate.
  • wormhole parse-proof --public-batch: parses and pretty-prints public-batch
    public inputs (aggregator address, header, per-segment exit slots and nullifiers).
  • wormhole multiround --public: extends the existing end-to-end test command to
    run the complete public-batch flow — generate leaf proofs, aggregate into private
    batches, aggregate those into a public batch (wallet as aggregator), submit, and
    verify balances/events.

Terminology and bindings

  • Renamed to private-batch / public-batch terminology throughout, matching the
    circuits repo (verify_aggregated_proofverify_private_batch).
  • Regenerated subxt bindings and embedded metadata (quantus_subxt.rs,
    quantus_metadata.scale) against the updated runtime with verify_public_batch.

Build / infra

  • build.rs and src/bins.rs generate and validate public-batch circuit binaries;
    branching factor configurable via QP_NUM_PRIVATE_BATCH_PROOFS
    (default DEFAULT_NUM_PRIVATE_BATCH_PROOFS = 4, matching the pallet).
  • [patch.crates-io] temporarily points the qp-wormhole-* /
    qp-zk-circuits-common crates at the local ../qp-zk-circuits checkout.
    Must be switched to published crate versions before merge.

Test plan

  • cargo build --release compiles cleanly.
  • Against a --dev node built from the companion chain PR:
    • quantus wormhole multiround (private-batch flow, regression) passes.
    • quantus wormhole multiround --public completes the full public-batch flow;
      events show segment mints and the aggregator rebate credited to the wallet.
  • quantus exercise wormhole scenario still compiles and runs (updated for the
    new --public flag).

Note

High Risk
Changes ZK circuit binaries and wormhole verification artifact names that must stay in sync with chain pallet defaults; the temporary [patch.crates-io] path breaks builds/CI without a sibling circuits repo.

Overview
Aligns wormhole aggregated proof naming and artifacts with private-batch / public-batch circuits: SDK examples and docs call verify_private_batch_and_get_events instead of the old aggregated helpers, and build-circuits / chain copy steps reference private_batch_* binaries (not aggregated_*).

Circuit generation now takes QP_NUM_PRIVATE_BATCH_PROOFS (default 4, matching the pallet) alongside leaf count. build.rs and runtime bins require private and public batch prover/verifier/common bins plus dummy_private_batch_proof.bin, and config.json readiness checks accept num_private_batch_proofs (with num_layer0_proofs alias). [patch.crates-io] temporarily points qp-wormhole-* at a local ../qp-zk-circuits checkout until published 3.1.0; Cargo.lock drops crates.io checksums for those patched packages.

Adds a nightly / manual GitHub workflow that builds quantus-node (fast-governance) from Quantus-Network/chain, starts a dev node, and runs quantus exercise --json with artifact upload.

Reviewed by Cursor Bugbot for commit c6fadf8. Configure here.

illuzen and others added 6 commits July 3, 2026 19:37
Adds a scenario-based exercise command that drives every call path the
CLI wraps against a live node, for pre-runtime-upgrade regression
testing and CI:

- Phases: reads, balances, reversible, multisig, recovery, preimage,
  governance, negative, seeded fuzz; opt-in wormhole and a
  governance-driven runtime-upgrade phase (--upgrade-wasm, requires a
  fast-governance node) with automatic post-upgrade re-run.
- Negative scenarios pin expected rejections (incl. scheduler-disabled
  and removed-pallet canaries) so upgrades that loosen validation fail.
- CI-friendly: --json report, nonzero exit on failure, --seed for
  reproducible fuzzing, --fail-fast; nightly exercise.yml workflow that
  builds a fast-governance node and runs the suite.
- Regenerate subxt metadata for spec 134 and drop the removed
  Referenda/ConvictionVoting modules and disabled Scheduler calls.
- Add quiet logging mode so expected-failure transaction chatter does
  not drown the per-step report output.

Co-authored-by: Cursor <cursoragent@cursor.com>
Proof generation is fast enough on release builds; use --skip wormhole
on debug builds. The post-upgrade re-run now also covers wormhole.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Remove the truncated secret prefix from check-nullifiers output and the
full secret / generated mnemonic from verbose multiround logs, so no
secret material reaches logs (flagged by CodeQL cleartext-logging).

Co-authored-by: Cursor <cursoragent@cursor.com>
Point the qp circuit crates at the local qp-zk-circuits checkout (temporary
until 3.1.0 is published), rename the SDK surface to match the renamed
pallet extrinsic (verify_aggregated_proof -> verify_private_batch) and
circuit APIs (PrivateBatchAggregator, PrivateBatchPublicInputs,
private_batch_*.bin), and regenerate the subxt bindings from the updated
runtime metadata. User-facing CLI flags and default filenames are unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit c6fadf8. Configure here.

Comment thread Cargo.toml

[profile.release.build-override]
opt-level = 3

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLI version not bumped

Medium Severity

The crate version stays at 1.5.0 while this change adds public-batch circuit parameters (DEFAULT_NUM_PRIVATE_BATCH_PROOFS), new required bin artifacts, and [patch.crates-io] overrides for the wormhole circuit crates. Without a CLI version bump, is_ready()’s .quantus-cli-version marker can still match for installs that already had 1.5.0 but stale generated bins from an earlier build with the same version string.

Additional Locations (2)
Fix in Cursor Fix in Web

Triggered by learned rule: Bump CLI version when proof system parameters or circuit crate versions change

Reviewed by Cursor Bugbot for commit c6fadf8. Configure here.

run: cargo build --release -p quantus-node --features quantus-runtime/fast-governance

- name: Build quantus-cli
run: SKIP_CIRCUIT_BUILD=1 cargo build --release --locked

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exercise CI missing circuits checkout

High Severity

The new Chain Exercise workflow checks out only quantus-cli and chain, then runs cargo build --release --locked. The same commit adds [patch.crates-io] entries pointing at ../qp-zk-circuits/..., which is not present on the runner, so dependency resolution fails before the suite can run.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c6fadf8. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant