Repository navigation
feat: @aztec-foundation/react-native, to run a labs PXE in a React Native app - #25878
Open
charlielye wants to merge 20 commits into
Open
charlielye wants to merge 20 commits into
charlielye wants to merge 20 commits into
Conversation
…tive app Hermes has no WebAssembly and no workers, so a service runs in a React Native app as its native library, linked in, and its JavaScript client reaches it through JSI: - ipc-runtime/cpp/jsi: `__ipcRuntimeJsi.createInstance(ffiName)` (an instance on a thread of its own; call() returns a promise) and `createInstanceSync` (on the JavaScript thread). Host calls are answered by JavaScript, asynchronously for an asynchronous instance while its thread waits. A library is found by its FFI name: registered by the app (statically linked), else dlopened. - ipc-runtime/ts: the `react-native` entry, with the JSI backends (jsi.ts). - ipc-codegen: the generated TS packages choose the JSI backends under React Native. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015HXzMEGRnmFYs5yXRcAWCb
bb.js's "react-native" entry (dest/react-native) runs bb as the native library the app links, through ipc-runtime's JSI binding (BackendType.Jsi, the in-process backend there instead of Wasm). The CRS is downloaded with XMLHttpRequest and cached in the app's data directory, under the file names bb uses in node, and random bytes come from crypto.getRandomValues. bb.js's bootstrap builds it with the other outputs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015HXzMEGRnmFYs5yXRcAWCb
…tive app Hermes has no WebAssembly and no workers, so the package links the client stack's native code into the app and reaches it through ipc-runtime's JSI binding: - bb, for bb.js (prebuilt per platform by the release); - the ACVM (@aztec-labs/acvm's crate as a static library: `make acvm-mobile`, pure Rust there, blake3 included). withAztec resolves Noir's acvm_js and noirc_abi to js/noir, their API over the ACVM service; - kv-sqlite, the PXE's store, compiled into the module from the sources scripts/vendor.sh copies from native-packages/kv-sqlite, with SQLite's symbols renamed. Labs' kv-store resolves its browser store to it under React Native (labs patch 0017), and the wallets their browser entry (0018). The tests run in a host program over Hermes, as an app does: the module's own with kv-sqlite's, bb.js's, and acvm_js's and noirc_abi's against Noir's own fixtures. acvm and kv-sqlite join the release, ahead of the package. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015HXzMEGRnmFYs5yXRcAWCb
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015HXzMEGRnmFYs5yXRcAWCb
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
charlielye
marked this pull request as ready for review
November 19, 2026 16:14
…ackage Its node_modules portal to @aztec-labs/acvm's and kv-sqlite's TS packages, which their builds generate; on a fresh checkout `yarn install --immutable` found no manifest there. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015HXzMEGRnmFYs5yXRcAWCb
A library that exports the asynchronous FFI runs under JSI as an asynchronous instance on its service thread, its host calls answered by JS promises, so a handler awaiting one keeps the instance serving (a Brillig foreign call that re-enters the caller, for one). A library without it keeps the blocking instance. The Hermes echo test nests relays on one instance and checks an unbound target's message; the test host's event loop outlives main, since a service thread may still post to it after a failed test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015HXzMEGRnmFYs5yXRcAWCb
…1990 KB #25878's browser kv-store already had it at 1964.07 KB on CI, over the 1960 KB limit, and ipc-runtime's asynchronous instances take it to 1965.87 KB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015HXzMEGRnmFYs5yXRcAWCb
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DSxF9AgGYcAcCTjXEeJT4L
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DSxF9AgGYcAcCTjXEeJT4L
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DSxF9AgGYcAcCTjXEeJT4L
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DSxF9AgGYcAcCTjXEeJT4L
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DSxF9AgGYcAcCTjXEeJT4L
Collaborator
Flakey Tests🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
@aztec-foundation/react-native, so a React Native app can run a labs PXE or embedded wallet, bb.js and Noir. It sits on #25876 (kv-sqlite), which sits on #25728 (the ACVM package).How an app uses it. It installs the package, wraps its Metro config in
withAztec, and imports@aztec-foundation/react-nativefirst in its entry file. The stack then runs as on the web (native-packages/react-native/README.md).What runs where. Hermes has no WebAssembly and no workers, so the native code is linked into the app and reached through ipc-runtime's JSI binding (
ipc-runtime/cpp/jsi; generated TS packages fall back to it in React Native):@aztec-labs/acvm's crate is built as a static library for iOS and Android (make acvm-mobile). It is pure Rust there, using blake3'spurefeature.withAztecresolves Noir'sacvm_jsandnoirc_abitojs/noir/, which implements their API over the ACVM service: executions with foreign calls, witness (de)compression, and ABI encode/decode/error decoding.scripts/vendor.shcopies fromnative-packages/kv-sqlite. SQLite's symbols are renamed so the app can link another SQLite. Labs patch 0017 gives@aztec-labs/kv-store/sqlite-opfsareact-nativeexport with the browser store's API overAztecKvSqliteStore. Each store is a file in the app's data directory, in the browser's per-store layout. Patch 0018 resolves the embedded wallet's browser entry.Release.
@aztec-labs/acvmand@aztec-labs/kv-sqlitejoin the public and private release lists. They publish before the RN package, which depends on them.Testing
make react-native-testsruns three suites under Hermes 0.88 in a test host:acvm_js/noirc_abiagainst Noir's ownacvm_jsandnoirc_abi_wasmfixtures (11/11).react_native.test.tsruns the RN store over node's backend, with the app's files stubbed (26/26).withAztec. It passes under Hermes against a local network:aarch64-linux-androidandaarch64-apple-iosand exports its FFI.🤖 Generated with Claude Code
https://claude.ai/code/session_015HXzMEGRnmFYs5yXRcAWCb