Public proof agg#116
Conversation
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>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 2 potential issues.
❌ 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.
|
|
||
| [profile.release.build-override] | ||
| opt-level = 3 | ||
|
|
There was a problem hiding this comment.
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)
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 |
There was a problem hiding this comment.
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)
Reviewed by Cursor Bugbot for commit c6fadf8. Configure here.


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 singlepublic-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 unsignedverify_public_batchextrinsic and reports the resulting events, including theaggregator rebate.
wormhole parse-proof --public-batch: parses and pretty-prints public-batchpublic inputs (aggregator address, header, per-segment exit slots and nullifiers).
wormhole multiround --public: extends the existing end-to-end test command torun 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
circuits repo (
verify_aggregated_proof→verify_private_batch).quantus_subxt.rs,quantus_metadata.scale) against the updated runtime withverify_public_batch.Build / infra
build.rsandsrc/bins.rsgenerate 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 theqp-wormhole-*/qp-zk-circuits-commoncrates at the local../qp-zk-circuitscheckout.Must be switched to published crate versions before merge.
Test plan
cargo build --releasecompiles cleanly.--devnode built from the companion chain PR:quantus wormhole multiround(private-batch flow, regression) passes.quantus wormhole multiround --publiccompletes the full public-batch flow;events show segment mints and the aggregator rebate credited to the wallet.
quantus exercisewormhole scenario still compiles and runs (updated for thenew
--publicflag).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_eventsinstead of the old aggregated helpers, andbuild-circuits/ chain copy steps referenceprivate_batch_*binaries (notaggregated_*).Circuit generation now takes
QP_NUM_PRIVATE_BATCH_PROOFS(default 4, matching the pallet) alongside leaf count.build.rsand runtimebinsrequire private and public batch prover/verifier/common bins plusdummy_private_batch_proof.bin, andconfig.jsonreadiness checks acceptnum_private_batch_proofs(withnum_layer0_proofsalias).[patch.crates-io]temporarily pointsqp-wormhole-*at a local../qp-zk-circuitscheckout until published 3.1.0;Cargo.lockdrops crates.io checksums for those patched packages.Adds a nightly / manual GitHub workflow that builds
quantus-node(fast-governance) fromQuantus-Network/chain, starts a dev node, and runsquantus exercise --jsonwith artifact upload.Reviewed by Cursor Bugbot for commit c6fadf8. Configure here.