Skip to content

Pin the circuit toolchain and document proving flags (audit N-01, N-05) - #788

Merged
brozorec merged 1 commit into
mainfrom
fix/n01-circuits-toolchain
Jul 16, 2026
Merged

brozorec merged 1 commit into
mainfrom
fix/n01-circuits-toolchain

Conversation

@brozorec

@brozorec brozorec commented Jul 13, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #781 (audit findings N-01 and N-05).

N-01: All 14 circuit manifests declared compiler_version = ">=0.30.0", which newer nargo releases satisfy and then fail to build against (changed stdlib APIs). Nargo requirement strings cannot name prerelease versions (=1.0.0-beta.11 is rejected with "Requirements may only refer to full releases"), so the exact pin the audit suggests is not expressible. This PR uses the tightest expressible bound, =1.0.0 (nargo's gate ignores prerelease tags, so 1.0.0-beta.11 satisfies it while 0.x and 1.0.1+ are rejected), and adds a manifest comment stating the exact supported toolchain (nargo 1.0.0-beta.11 + bb 0.87.0) with a pointer to the CI pin in .github/workflows/noir.yml.

N-05: Adds a provisional Proving section to vks/README.md documenting the non-default flags a proof must be generated with to match the verifier (--oracle_hash keccak, no --zk), explicitly marked to be finalized together with the unfinished UltraHonk backend.

Validated locally: nargo compile --workspace passes under the pinned 1.0.0-beta.11.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Added provisional instructions for generating proofs compatible with the deployed UltraHonk verifier.
    • Documented required proving options and clarified that zero-knowledge mode is not currently supported.
  • Chores

    • Standardized confidential circuit builds on the pinned Noir compiler version 1.0.0 for more consistent toolchain compatibility.

Nargo requirements cannot name prereleases, so =1.0.0 is the tightest
expressible bound; the manifest comments carry the exact supported
nargo + bb versions. Adds a provisional proving recipe to vks/README.md.
@coderabbitai

coderabbitai Bot commented Jul 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1a6a8d67-8d38-4e2d-9798-ba2c0539e3f9

📥 Commits

Reviewing files that changed from the base of the PR and between 1e51389 and 652c935.

📒 Files selected for processing (15)
  • packages/tokens/src/confidential/circuits/gadgets/assert_on_curve/Nargo.toml
  • packages/tokens/src/confidential/circuits/gadgets/commit/Nargo.toml
  • packages/tokens/src/confidential/circuits/gadgets/ecdh/Nargo.toml
  • packages/tokens/src/confidential/circuits/gadgets/encrypt_amount/Nargo.toml
  • packages/tokens/src/confidential/circuits/gadgets/poseidon_with_domain/Nargo.toml
  • packages/tokens/src/confidential/circuits/gadgets/sponge_squeeze_2/Nargo.toml
  • packages/tokens/src/confidential/circuits/gadgets/vk_from_sk/Nargo.toml
  • packages/tokens/src/confidential/circuits/lib/Nargo.toml
  • packages/tokens/src/confidential/circuits/register/Nargo.toml
  • packages/tokens/src/confidential/circuits/revoke_spender/Nargo.toml
  • packages/tokens/src/confidential/circuits/set_spender/Nargo.toml
  • packages/tokens/src/confidential/circuits/spender_transfer/Nargo.toml
  • packages/tokens/src/confidential/circuits/transfer/Nargo.toml
  • packages/tokens/src/confidential/circuits/vks/README.md
  • packages/tokens/src/confidential/circuits/withdraw/Nargo.toml

Walkthrough

The circuit manifests now pin the Nargo compiler to 1.0.0, with comments describing toolchain constraints. The VKS README adds provisional instructions for generating verifier-compatible proofs with nargo execute and bb prove.

Changes

Circuit toolchain and proving flow

Layer / File(s) Summary
Pin circuit compiler manifests
packages/tokens/src/confidential/circuits/**/Nargo.toml
Circuit manifests replace >=0.30.0 with the exact =1.0.0 compiler requirement and add comments about prerelease naming limitations and supported tooling.
Document verifier-compatible proving
packages/tokens/src/confidential/circuits/vks/README.md
The README adds provisional nargo execute and bb prove instructions, requiring --oracle_hash keccak and excluding --zk.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: bidzyyys

Poem

I’m a rabbit with circuits to tune,
Pinning each tool beneath the moon.
Keccak hops in, proofs take flight,
No-ZK flags keep the transcript right.
Nargo and bb now run in line—
A tidy burrow, byte by byte, divine!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: pinning the circuit toolchain and documenting proving flags.
Description check ✅ Passed The description covers the issue reference, change summary, context, and validation, with only non-critical checklist details left unfilled.
Linked Issues check ✅ Passed The PR addresses the requested manifest pinning and adds the proving guidance for the verifier flags, matching the linked issue's scope.
Out of Scope Changes check ✅ Passed The changes stay within the manifest pinning and README documentation requested by the issue, with no unrelated edits apparent.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/n01-circuits-toolchain

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.56%. Comparing base (1e51389) to head (652c935).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #788   +/-   ##
=======================================
  Coverage   96.56%   96.56%           
=======================================
  Files          71       71           
  Lines        7346     7346           
=======================================
  Hits         7094     7094           
  Misses        252      252           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@brozorec brozorec self-assigned this Jul 13, 2026
@brozorec
brozorec requested a review from ozgunozerk July 15, 2026 14:45
@brozorec
brozorec merged commit 4313bb0 into main Jul 16, 2026
9 checks passed
@brozorec
brozorec deleted the fix/n01-circuits-toolchain branch July 16, 2026 11:27
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.

[Audit N-01/N-05] Pin circuit toolchain in Nargo manifests and document proving flags

2 participants