Sitelet https://github.com/zkmopro/NoirKotlin/pull/1
Skip to content

feat: update bindings for noir-rs v1.0.0-beta.19 - #1

Merged
moven0831 merged 3 commits into
mainfrom
noir-rs/upgrade-beta.19
Jun 23, 2026
Merged

moven0831 merged 3 commits into
mainfrom
noir-rs/upgrade-beta.19

Conversation

@moven0831

@moven0831 moven0831 commented Jun 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Update NoirKotlin to noir-rs v1.0.0-beta.19. Downstream counterpart of zkmopro/mopro#705 (tracked under zkmopro/mopro#704), which adopted noir-rs beta.19 + the official barretenberg-rs 4.2.0-aztecnr-rc.2 and a new Zig/BB_LIB_DIR Android build path, but left the wrapper repos to their own repos.

Changes

  • jniLibs rebuilt for beta.19 via the mopro CLI (built from mopro main, post-#705): libmopro_example_app_noir.so and libc++_shared.so for arm64-v8a and x86_64; libjnidispatch.so (JNA) kept as-is.
  • uniffi/mopro/mopro.kt regenerated (uniffi contract version 30).
  • Instrumented test replaced the leftover Circom-stub template test with a real Noir getNoirVerificationKey → generateNoirProof → verifyNoirProof flow against the beta.19 fixtures.
  • README dependency snippet bumped v1.0.0-beta.8 → v1.0.0-beta.19.

Verification

  • ./gradlew assemble → BUILD SUCCESSFUL.
  • Instrumented Noir test passes on an Android API 36 emulator (real generate → verify).

After merge, tag v1.0.0-beta.19 for JitPack distribution.

Refs: zkmopro/mopro#705, zkmopro/mopro#704

Summary by CodeRabbit

Release Notes

  • Chores

    • Updated dependency version to latest beta release.
  • Tests

    • Transitioned test suite from Circom to Noir proof system verification.
    • Added new test assets for Noir circuit validation.
  • Refactor

    • Internal FFI and binding layer optimizations.

moven0831 and others added 2 commits June 9, 2026 19:47
- Regenerate uniffi mopro.kt (contract version 29 -> 30, new function checksums) and jniLibs (libmopro_example_app_noir.so + libc++_shared.so for arm64-v8a and x86_64) from mopro-example-app-noir at noir-rs v1.0.0-beta.19, built with the mopro CLI (from main, post-#705) so the barretenberg Android fix (BB_LIB_DIR + Zig) is applied. libjnidispatch.so (JNA) kept as-is.
- README: bump the dependency example to v1.0.0-beta.19.

Both .so verified free of undefined glibc/__cxx11 symbols; bionic deps only. Publish by pushing a v1.0.0-beta.19 tag (JitPack builds the AAR).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The androidTest was a mopro-template leftover exercising generateCircomProof
against a Circom .zkey — but NoirKotlin wraps the Noir-only
mopro-example-app-noir crate, where Circom/Halo2 are non-functional stubs.
Replace it with getNoirVerificationKey -> generateNoirProof -> verifyNoirProof
over the beta.19 noir_multiplier2 fixtures, and bundle those fixtures under
androidTest/assets. Validated on an API 36 (arm64) emulator: OK (1 test).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 22, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@moven0831, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 39 minutes and 24 seconds. Learn how PR review limits work.

To continue reviewing without waiting, enable usage-based billing in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f920276c-a21c-4161-a2d3-c9be8bde3c73

📥 Commits

Reviewing files that changed from the base of the PR and between b007613 and 5f7d79f.

📒 Files selected for processing (1)
  • lib/src/androidTest/kotlin/com/github/zkmopro/MoproTest.kt
📝 Walkthrough

Walkthrough

The PR updates the README JitPack dependency to v1.0.0-beta.19, replaces Circom-based instrumented tests with a Noir proof test (adding noir_multiplier2.json as a test asset), and regenerates the entire UniFFI Kotlin binding (mopro.kt) with updated JNA initialization style, new handle semantics, recursive Disposable cleanup, and rewired public API entrypoints.

Changes

Noir Test Migration and README Version Bump

Layer / File(s) Summary
Noir circuit asset, test rewrite, and README version bump
lib/src/androidTest/assets/noir_multiplier2.json, lib/src/androidTest/kotlin/com/github/zkmopro/MoproTest.kt, README.md
Adds noir_multiplier2.json with ABI and embedded bytecode. Replaces the two Circom-based test methods (useAppContext, testMoproFunctionality) with a single testNoirProof that copies Noir assets and calls getNoirVerificationKey → generateNoirProof → verifyNoirProof. Bumps the README JitPack version from v1.0.0-beta.8 to v1.0.0-beta.19.

UniFFI Kotlin Binding Regeneration

Layer / File(s) Summary
Low-level FFI primitives and error plumbing
lib/src/main/kotlin/uniffi/mopro/mopro.kt
Refactors RustBuffer/ForeignBytes struct helpers, FfiConverter method signatures and buffer validation, UniffiRustCallStatus predicate helpers, error plumbing around InternalException/uniffiRustCallWithError, and UniffiHandleMap with a new start-at-1/step-by-2 counter strategy and stack-trace capture for unexpected errors.
JNA object initialization, async support, and uniffiEnsureInitialized
lib/src/main/kotlin/uniffi/mopro/mopro.kt
Replaces lazily-loaded interface+INSTANCE pattern with internal object + Native.register(...) init blocks for IntegrityCheckingUniffiLib and UniffiLib, rewires async future callback/struct types, and adds the public uniffiEnsureInitialized() function.
Disposable cleanup, placeholder objects, converters, and public API entrypoints
lib/src/main/kotlin/uniffi/mopro/mopro.kt
Extends Disposable.destroy to recursively handle ArrayList, Map values, and Iterable. Adds UniffiWithHandle and NoHandle, removes NoPointer. Refactors FfiConverter implementations for strings, byte arrays, ProofLib enum, optional/sequence/map types, and rewires all generated proof API entrypoints to call UniffiLib.<ffi_fn> directly.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 Hopped away from Circom's trail,
Now Noir proofs tell a fresher tale!
The bindings shed their INSTANCE skin,
With objects init'd from within.
Beta-19 hops onto the shelf—
The rabbit versioned it himself! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.44% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: update bindings for noir-rs v1.0.0-beta.19' accurately summarizes the main change: updating NoirKotlin bindings to support a new version of noir-rs.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch noir-rs/upgrade-beta.19

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
lib/src/main/kotlin/uniffi/mopro/mopro.kt (1)

254-256: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Minor: String interpolation may not work as intended.

Line 255 uses $status.code which interpolates status and then appends .code as literal text. Should be ${status.code} to interpolate the code field.

-        throw InternalException("Unknown rust call status: $status.code")
+        throw InternalException("Unknown rust call status: ${status.code}")

This is a minor issue since this branch should rarely be hit (only for unknown status codes from Rust).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/src/main/kotlin/uniffi/mopro/mopro.kt` around lines 254 - 256, The string
interpolation in the InternalException message uses incorrect syntax. The
expression `$status.code` only interpolates the `status` variable and appends
`.code` as literal text instead of accessing the code field. Fix this by
wrapping the property access in curly braces to change `$status.code` to
`${status.code}` so that the code field value is properly interpolated into the
error message.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@lib/src/main/kotlin/uniffi/mopro/mopro.kt`:
- Around line 254-256: The string interpolation in the InternalException message
uses incorrect syntax. The expression `$status.code` only interpolates the
`status` variable and appends `.code` as literal text instead of accessing the
code field. Fix this by wrapping the property access in curly braces to change
`$status.code` to `${status.code}` so that the code field value is properly
interpolated into the error message.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 523c0be0-e63e-4be7-acd0-e3d09059092e

📥 Commits

Reviewing files that changed from the base of the PR and between 685595b and b007613.

⛔ Files ignored due to path filters (4)
  • lib/src/main/jniLibs/arm64-v8a/libc++_shared.so is excluded by !**/*.so
  • lib/src/main/jniLibs/arm64-v8a/libmopro_example_app_noir.so is excluded by !**/*.so
  • lib/src/main/jniLibs/x86_64/libc++_shared.so is excluded by !**/*.so
  • lib/src/main/jniLibs/x86_64/libmopro_example_app_noir.so is excluded by !**/*.so
📒 Files selected for processing (5)
  • README.md
  • lib/src/androidTest/assets/noir_multiplier2.json
  • lib/src/androidTest/assets/noir_multiplier2.srs
  • lib/src/androidTest/kotlin/com/github/zkmopro/MoproTest.kt
  • lib/src/main/kotlin/uniffi/mopro/mopro.kt

Condense the 3-line narrative into one line.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@moven0831
moven0831 merged commit 9d3f325 into main Jun 23, 2026
1 check passed
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