Skip to content

chore: set target web/nodejs for crisp zk-inputs#1006

Merged
ctrlc03 merged 6 commits into
mainfrom
chore/crisp-wasm
Nov 13, 2025
Merged

chore: set target web/nodejs for crisp zk-inputs#1006
ctrlc03 merged 6 commits into
mainfrom
chore/crisp-wasm

Conversation

@cedoor

@cedoor cedoor commented Nov 12, 2025

Copy link
Copy Markdown
Contributor

Closes #1007

Summary by CodeRabbit

  • New Features

    • One-time async WASM initialization available and automatically used by key functions; browser build includes bundled base64 WASM for consistent loading.
  • Documentation

    • Added guidance showing the correct WASM init usage and environment-specific loading notes.
  • Chores

    • Simplified build/test scripts and package exports; adjusted bundler exclusions and init packaging to ensure reliable initialization.

@cedoor cedoor requested a review from ctrlc03 November 12, 2025 17:47
@vercel

vercel Bot commented Nov 12, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
crisp Ready Ready Preview Comment Nov 13, 2025 9:25am
enclave-docs Ready Ready Preview Comment Nov 13, 2025 9:25am

@coderabbitai

coderabbitai Bot commented Nov 12, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Adds explicit WASM init entrypoints (node + web), embeds web WASM as base64, updates package exports and build scripts, calls the new async initializer from CRISP SDK vote functions, expands Vite optimizeDeps exclusion, and removes a top-level build:wasm script.

Changes

Cohort / File(s) Summary
Vite config
examples/CRISP/client/vite.config.ts
Expands optimizeDeps.exclude to include @crisp-e3/zk-inputs/init and reformats the array as multi-line.
Root package scripts
examples/CRISP/package.json
Removes the build:wasm npm script.
CRISP SDK package
examples/CRISP/packages/crisp-sdk/package.json, examples/CRISP/packages/crisp-sdk/src/vote.ts
Adjusts npm scripts to invoke local ../crisp-zk-inputs build; simplifies build/test workflows. Adds import initializeWasm from '@crisp-e3/zk-inputs/init' and await initializeWasm() at start of encryptVote, encryptVoteAndGenerateCRISPInputs, and generateMaskVote.
WASM init entrypoints
examples/CRISP/packages/crisp-zk-inputs/init.d.ts, .../init_node.cjs, .../init_node.js, .../init_web.js
Adds ./init submodule: TS declaration; Node CJS/ESM no-op initializers; web initializer that memoizes a Promise, imports base64 payload, decodes to Uint8Array, and calls bindgen.initSync(bytes).
crisp-zk-inputs packaging & build
examples/CRISP/packages/crisp-zk-inputs/package.json, examples/CRISP/packages/crisp-zk-inputs/scripts/build.js
Reworks main/module/types/files/exports to point to dist/node and dist/web, adds ./init conditional exports and dist files, introduces a build script that runs wasm-pack for web/node, emits dist/web/index_base64.js, rewrites web entry to avoid direct wasm URL loading, and cleans artifacts.
Documentation
examples/CRISP/packages/crisp-zk-inputs/README.md
Adds README describing correct use of the ./init loader vs default loader with Node/browser notes and TypeScript examples.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    actor Dev
    participant SDK as CRISP SDK
    participant Init as `@crisp-e3/zk-inputs/init`
    participant Bindgen as WASM Bindgen

    Dev->>SDK: call encryptVote()
    activate SDK
    SDK->>Init: await init()
    activate Init
    alt first web init
        Init->>Init: import base64 module
        Init->>Init: decode -> Uint8Array
        Init->>Bindgen: bindgen.initSync(bytes)
        Bindgen-->>Init: initialized
        Init->>Init: cache Promise
    else node or cached
        Init-->>Init: no-op or return cached
    end
    Init-->>SDK: resolved
    deactivate Init
    SDK->>SDK: proceed with WASM-dependent crypto
    SDK-->>Dev: encrypted vote
    deactivate SDK
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Pay attention to init_web.js memoization and base64 decoding correctness.
  • Review scripts/build.js for path handling, wasm-pack commands, and robust file writes.
  • Verify package.json exports and files entries match produced dist/ layout.
  • Confirm SDK call-sites properly await the async initializer.

Possibly related PRs

Suggested reviewers

  • cedoor

Poem

🐇 I nibble bytes and wrap them tight,

A base64 moon keeps WASM warm at night,
One init call, cached in my burrow,
Votes encrypt with a quiet furrow,
Hoppity build — the bundle's right!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ 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 accurately describes the main change: configuring CRISP zk-inputs to target both web and nodejs platforms.
Linked Issues check ✅ Passed The PR implements all requirements from issue #1007: builds web and nodejs targets, adds conditional exports, and replaces bundler-only approach with dual-target packaging.
Out of Scope Changes check ✅ Passed All changes are in-scope: build script setup, package.json exports configuration, initialization files for both platforms, and SDK integration are all necessary to resolve the WASM packaging issue.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/crisp-wasm

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5657c14 and 1bce676.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (11)
  • examples/CRISP/client/vite.config.ts (1 hunks)
  • examples/CRISP/package.json (0 hunks)
  • examples/CRISP/packages/crisp-sdk/package.json (1 hunks)
  • examples/CRISP/packages/crisp-sdk/src/vote.ts (4 hunks)
  • examples/CRISP/packages/crisp-zk-inputs/README.md (1 hunks)
  • examples/CRISP/packages/crisp-zk-inputs/init.d.ts (1 hunks)
  • examples/CRISP/packages/crisp-zk-inputs/init_node.cjs (1 hunks)
  • examples/CRISP/packages/crisp-zk-inputs/init_node.js (1 hunks)
  • examples/CRISP/packages/crisp-zk-inputs/init_web.js (1 hunks)
  • examples/CRISP/packages/crisp-zk-inputs/package.json (1 hunks)
  • examples/CRISP/packages/crisp-zk-inputs/scripts/build.js (1 hunks)
💤 Files with no reviewable changes (1)
  • examples/CRISP/package.json
🚧 Files skipped from review as they are similar to previous changes (7)
  • examples/CRISP/packages/crisp-zk-inputs/init_web.js
  • examples/CRISP/packages/crisp-zk-inputs/scripts/build.js
  • examples/CRISP/packages/crisp-zk-inputs/init_node.cjs
  • examples/CRISP/client/vite.config.ts
  • examples/CRISP/packages/crisp-sdk/src/vote.ts
  • examples/CRISP/packages/crisp-zk-inputs/README.md
  • examples/CRISP/packages/crisp-zk-inputs/init.d.ts
🧰 Additional context used
🧬 Code graph analysis (1)
examples/CRISP/packages/crisp-zk-inputs/init_node.js (1)
examples/CRISP/packages/crisp-zk-inputs/init_web.js (1)
  • init (11-29)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: build_e3_support_dev
  • GitHub Check: build_sdk
  • GitHub Check: build_enclave_cli
  • GitHub Check: rust_integration
  • GitHub Check: integration_prebuild
  • GitHub Check: test_net
  • GitHub Check: test_contracts
  • GitHub Check: rust_unit
🔇 Additional comments (6)
examples/CRISP/packages/crisp-zk-inputs/package.json (4)

11-13: Conditional export configuration aligns with dual-target requirement.

The main, module, and types fields correctly point to dist/node and dist/web targets, supporting both Node.js and browser environments as required by PR #1007.


23-55: Verify that conditional exports map to all generated build artifacts.

The exports map defines:

  • Root (".") with node/browser/default conditions routing to dist/node and dist/web
  • Init ("./init") with separate node (import/require) and browser (default) paths

Ensure that the build.js script generates:

  • dist/node/index.js and dist/node/index.d.ts
  • dist/web/index.js and dist/web/index.d.ts
  • init_node.js, init_node.cjs, init_web.js, and init.d.ts

If init files are generated (not checked in), clarify in the build script or add them to .gitignore.


14-22: Clarify whether init files are generated or version-controlled.

The files array includes init_node.js, init_node.cjs, init_web.js, and init.d.ts, but it's unclear if these are:

  1. Generated by scripts/build.js and should be .gitignored, or
  2. Static/checked-in files that the build process references.

The AI summary indicates these are new init modules; clarify their source and maintenance model.


59-62: Verify build script output and WASM initialization flow.

The build script runs:

  1. pnpm compile:circuit (circuit compilation)
  2. node scripts/build.js (WASM packaging and output)

Confirm that scripts/build.js:

  • Generates dist/node and dist/web with correct TypeScript declarations
  • Embeds web WASM as base64 (as mentioned in AI summary: dist/web/index_base64.js)
  • Produces or processes the init modules (init_node.js, init_node.cjs, init_web.js)

Also verify the build process correctly exports types and initialization logic that is consumed by the SDK.

examples/CRISP/packages/crisp-sdk/package.json (1)

23-25: Build flow correctly delegates to crisp-zk-inputs.

The updated scripts properly establish a build hierarchy:

  • build:wasm → delegates to crisp-zk-inputs build
  • build → runs build:wasm, then tsup
  • test → runs build:wasm before vitest

This centralizes WASM compilation in crisp-zk-inputs (as per PR objective) and ensures consistent build ordering.

Verify that SDK code (e.g., vote.ts, encryption functions) correctly imports initializeWasm from @crisp-e3/zk-inputs/init and calls it at runtime. The AI summary indicates this pattern is used; confirm the implementation aligns with the new init entry point structure.

examples/CRISP/packages/crisp-zk-inputs/init_node.js (1)

7-9: No issues found. Node.js initialization design is correct and intentional.

The Node.js init function is intentionally empty because Node.js WebAssembly packages using wasm-bindgen auto-initialize on module import—no explicit initialization is required. This is standard behavior and is working correctly.

The apparent return value inconsistency is not an issue: the type declaration (Promise<void>) correctly documents that callers should not rely on a return value. All three call sites in vote.ts follow this pattern by awaiting the function without capturing its result. The web version's return of bindgen is an implementation detail not exposed by the type contract.


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 and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (6)
examples/CRISP/packages/crisp-zk-inputs/init_node.cjs (1)

7-9: Consider accepting the parameter for signature consistency.

While the no-op implementation is correct for Node.js, consider accepting the initParams parameter (even if unused) to match the signature of init_web.js. This makes the API more consistent across environments.

Apply this diff:

-module.exports = async function initializeWasm() {
+module.exports = async function initializeWasm(initParams) {
   // Node does not need to be loaded async
 }
examples/CRISP/packages/crisp-zk-inputs/init_web.js (2)

11-11: Remove unused parameter.

The initParams parameter is accepted but never used in the function body. Either utilize it (if it's meant for wasm-bindgen's init options) or remove it for clarity.

If not needed:

-export default async function initializeWasm(initParams) {
+export default async function initializeWasm() {

12-26: Consider adding error handling for WASM initialization.

The memoization pattern is well-implemented, ensuring single initialization even with concurrent calls. However, if the WASM initialization fails, the rejected promise is cached, and subsequent calls will receive the same rejection.

Consider resetting promise on failure to allow retry:

 export default async function initializeWasm(initParams) {
-  promise ??= (async () => {
+  promise ??= (async () => {
+    try {
       const { default: base64 } = await import("./dist/web/index_base64.js");
 
       const binaryString = atob(base64);
       const len = binaryString.length;
       const bytes = new Uint8Array(len);
 
       for (let i = 0; i < len; i++) {
         bytes[i] = binaryString.charCodeAt(i);
       }
 
       bindgen.initSync(bytes);
 
       return bindgen;
+    } catch (error) {
+      promise = undefined; // Reset to allow retry
+      throw error;
+    }
   })();
 
   return promise;
 }
examples/CRISP/packages/crisp-zk-inputs/README.md (1)

11-11: Adjust heading levels for proper hierarchy.

Using h5 (#####) skips heading levels. Markdown best practices recommend incrementing by only one level at a time.

Apply this diff:

-##### ❌ DONT USE THE DEFAULT INIT
+### ❌ DONT USE THE DEFAULT INIT
 
 ```ts
 // Bad! Because this uses the raw loader which doesn't exist in node contexts
 import init, { bfvEncryptNumber } from "@crisp-e3/zk-inputs";

-##### ✅ DO USE THE EXPORTED SUBMODULE
+### ✅ DO USE THE EXPORTED SUBMODULE



Also applies to: 18-18

</blockquote></details>
<details>
<summary>examples/CRISP/packages/crisp-zk-inputs/init_node.js (1)</summary><blockquote>

`7-9`: **No-op initialization for Node.js looks appropriate.**

The empty implementation is correct since Node.js can load WebAssembly synchronously, unlike the browser environment. However, for API consistency with the web version (which uses memoization), consider explicitly returning a resolved promise or adding a JSDoc comment explaining why no initialization is needed.




Optional improvement for clarity:

```diff
+/**
+ * Initialize WASM for Node.js environment.
+ * No-op since Node.js loads WASM synchronously.
+ */
 export default async function initializeWasm() {
   // Node does not need to be loaded async
+  return Promise.resolve();
 }
examples/CRISP/packages/crisp-zk-inputs/scripts/build.js (1)

17-32: Consider parallelizing wasm-pack builds for faster execution.

Both builds output to different directories and can run concurrently.

Optional improvement:

-  await execa("wasm-pack", [
-    "build",
-    "../../crates/zk-inputs-wasm",
-    "--target=web",
-    `--out-dir=${distWeb}`,
-    "--no-pack",
-    "--out-name=index",
-  ]);
-  await execa("wasm-pack", [
-    "build",
-    "../../crates/zk-inputs-wasm",
-    "--target=nodejs",
-    `--out-dir=${distNode}`,
-    "--no-pack",
-    "--out-name=index",
-  ]);
+  await Promise.all([
+    execa("wasm-pack", [
+      "build",
+      "../../crates/zk-inputs-wasm",
+      "--target=web",
+      `--out-dir=${distWeb}`,
+      "--no-pack",
+      "--out-name=index",
+    ]),
+    execa("wasm-pack", [
+      "build",
+      "../../crates/zk-inputs-wasm",
+      "--target=nodejs",
+      `--out-dir=${distNode}`,
+      "--no-pack",
+      "--out-name=index",
+    ]),
+  ]);
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cf8dd2c and f506ebf.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (11)
  • examples/CRISP/client/vite.config.ts (1 hunks)
  • examples/CRISP/package.json (0 hunks)
  • examples/CRISP/packages/crisp-sdk/package.json (1 hunks)
  • examples/CRISP/packages/crisp-sdk/src/vote.ts (4 hunks)
  • examples/CRISP/packages/crisp-zk-inputs/README.md (1 hunks)
  • examples/CRISP/packages/crisp-zk-inputs/init.d.ts (1 hunks)
  • examples/CRISP/packages/crisp-zk-inputs/init_node.cjs (1 hunks)
  • examples/CRISP/packages/crisp-zk-inputs/init_node.js (1 hunks)
  • examples/CRISP/packages/crisp-zk-inputs/init_web.js (1 hunks)
  • examples/CRISP/packages/crisp-zk-inputs/package.json (1 hunks)
  • examples/CRISP/packages/crisp-zk-inputs/scripts/build.js (1 hunks)
💤 Files with no reviewable changes (1)
  • examples/CRISP/package.json
🧰 Additional context used
🧬 Code graph analysis (5)
examples/CRISP/packages/crisp-zk-inputs/init_node.cjs (2)
examples/CRISP/packages/crisp-zk-inputs/init_node.js (1)
  • initializeWasm (7-9)
examples/CRISP/packages/crisp-zk-inputs/init_web.js (1)
  • initializeWasm (11-29)
examples/CRISP/packages/crisp-zk-inputs/init.d.ts (1)
packages/enclave-sdk/src/greco.ts (1)
  • Params (59-75)
examples/CRISP/packages/crisp-zk-inputs/init_node.js (1)
examples/CRISP/packages/crisp-zk-inputs/init_web.js (1)
  • initializeWasm (11-29)
examples/CRISP/packages/crisp-zk-inputs/init_web.js (1)
examples/CRISP/packages/crisp-zk-inputs/init_node.js (1)
  • initializeWasm (7-9)
examples/CRISP/packages/crisp-sdk/src/vote.ts (2)
examples/CRISP/packages/crisp-zk-inputs/init_node.js (1)
  • initializeWasm (7-9)
examples/CRISP/packages/crisp-zk-inputs/init_web.js (1)
  • initializeWasm (11-29)
🪛 LanguageTool
examples/CRISP/packages/crisp-zk-inputs/README.md

[grammar] ~3-~3: Ensure spelling is correct
Context: ...for consumption in typescript to enable use to share code between Rust and Typescri...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🪛 markdownlint-cli2 (0.18.1)
examples/CRISP/packages/crisp-zk-inputs/README.md

11-11: Heading levels should only increment by one level at a time
Expected: h3; Actual: h5

(MD001, heading-increment)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: build_enclave_cli
  • GitHub Check: build_sdk
  • GitHub Check: test_contracts
  • GitHub Check: integration_prebuild
  • GitHub Check: rust_integration
  • GitHub Check: rust_unit
  • GitHub Check: test_net
🔇 Additional comments (5)
examples/CRISP/client/vite.config.ts (1)

26-34: LGTM! Appropriate exclusion of initialization module.

Excluding @crisp-e3/zk-inputs/init from Vite's optimization is correct since this module handles runtime WASM initialization that shouldn't be pre-bundled.

examples/CRISP/packages/crisp-zk-inputs/package.json (1)

48-53: Verify the "default" condition in "./init" exports.

The "default" condition includes both import (Node) and default (web) paths, which seems unusual. Typically, the "default" condition should specify a single fallback path, not multiple conditions.

Review whether this configuration is intentional. The typical pattern would be:

"default": {
  "types": "./init.d.ts",
  "default": "./init_web.js"
}

Or if you want to support both import/require in the default case:

"default": {
  "types": "./init.d.ts",
  "import": "./init_node.js",
  "require": "./init_node.cjs"
}

The current setup with "import", "require", and "default" all at the same level in the "default" condition may not resolve as expected. Can you verify this works correctly in both Node and browser environments?

examples/CRISP/packages/crisp-sdk/src/vote.ts (1)

8-8: LGTM! Proper WASM initialization pattern.

The initialization calls ensure WASM is ready before using ZKInputsGenerator. The memoization in init_web.js ensures efficient handling of multiple calls - the first call initializes, and subsequent calls reuse the cached promise.

Also applies to: 157-157, 196-196, 245-245

examples/CRISP/packages/crisp-sdk/package.json (1)

23-25: LGTM! Simplified and clearer build flow.

The streamlined build scripts properly ensure WASM compilation precedes SDK building and testing.

examples/CRISP/packages/crisp-zk-inputs/scripts/build.js (1)

34-36: LGTM!

The base64 conversion logic is correct and aligns with the loading approach in init_web.js.

Comment thread examples/CRISP/packages/crisp-zk-inputs/init.d.ts Outdated
Comment thread examples/CRISP/packages/crisp-zk-inputs/README.md Outdated
Comment thread examples/CRISP/packages/crisp-zk-inputs/scripts/build.js
@vercel vercel Bot temporarily deployed to Preview – crisp November 12, 2025 17:52 Inactive
@vercel vercel Bot temporarily deployed to Preview – enclave-docs November 12, 2025 17:52 Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f506ebf and 66f6d31.

📒 Files selected for processing (1)
  • examples/CRISP/packages/crisp-zk-inputs/README.md (1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
examples/CRISP/packages/crisp-zk-inputs/README.md

11-11: Heading levels should only increment by one level at a time
Expected: h3; Actual: h5

(MD001, heading-increment)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: build_sdk
  • GitHub Check: build_enclave_cli
  • GitHub Check: integration_prebuild
  • GitHub Check: test_net
  • GitHub Check: test_contracts
  • GitHub Check: rust_integration
  • GitHub Check: rust_unit

Comment thread examples/CRISP/packages/crisp-zk-inputs/README.md Outdated
@vercel vercel Bot temporarily deployed to Preview – enclave-docs November 12, 2025 17:56 Inactive
@vercel vercel Bot temporarily deployed to Preview – crisp November 12, 2025 17:56 Inactive
@vercel vercel Bot temporarily deployed to Preview – enclave-docs November 12, 2025 17:58 Inactive
@vercel vercel Bot temporarily deployed to Preview – crisp November 12, 2025 17:58 Inactive

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 66f6d31 and 5657c14.

📒 Files selected for processing (4)
  • examples/CRISP/packages/crisp-zk-inputs/init.d.ts (1 hunks)
  • examples/CRISP/packages/crisp-zk-inputs/init_node.cjs (1 hunks)
  • examples/CRISP/packages/crisp-zk-inputs/init_node.js (1 hunks)
  • examples/CRISP/packages/crisp-zk-inputs/init_web.js (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (4)
examples/CRISP/packages/crisp-zk-inputs/init_node.cjs (2)
examples/CRISP/packages/crisp-zk-inputs/init_node.js (1)
  • init (7-9)
examples/CRISP/packages/crisp-zk-inputs/init_web.js (1)
  • init (11-29)
examples/CRISP/packages/crisp-zk-inputs/init_web.js (1)
examples/CRISP/packages/crisp-zk-inputs/init_node.js (1)
  • init (7-9)
examples/CRISP/packages/crisp-zk-inputs/init_node.js (1)
examples/CRISP/packages/crisp-zk-inputs/init_web.js (1)
  • init (11-29)
examples/CRISP/packages/crisp-zk-inputs/init.d.ts (2)
examples/CRISP/packages/crisp-zk-inputs/init_node.js (1)
  • init (7-9)
examples/CRISP/packages/crisp-zk-inputs/init_web.js (1)
  • init (11-29)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: build_enclave_cli
  • GitHub Check: build_sdk
  • GitHub Check: test_contracts
  • GitHub Check: rust_unit
  • GitHub Check: integration_prebuild
  • GitHub Check: rust_integration
  • GitHub Check: test_net
🔇 Additional comments (3)
examples/CRISP/packages/crisp-zk-inputs/init_node.cjs (1)

7-9: LGTM! CommonJS variant maintains API consistency.

The empty implementation is correct for Node.js, which can load WASM synchronously. This module provides CommonJS compatibility while maintaining the same async API signature as the ES module variants.

examples/CRISP/packages/crisp-zk-inputs/init_web.js (1)

7-9: LGTM! Proper setup for lazy initialization.

The bindgen import and memoization variable are correctly structured to support the single-initialization pattern.

examples/CRISP/packages/crisp-zk-inputs/init_node.js (1)

7-9: LGTM! Node.js initialization correctly simplified.

The empty implementation is appropriate since Node.js can load WASM synchronously. The async signature maintains API consistency with the web variant, allowing consumers to use the same initialization pattern across platforms.

Comment thread examples/CRISP/packages/crisp-zk-inputs/init_web.js
Comment thread examples/CRISP/packages/crisp-zk-inputs/init.d.ts
@vercel vercel Bot temporarily deployed to Preview – enclave-docs November 12, 2025 18:01 Inactive
@vercel vercel Bot temporarily deployed to Preview – crisp November 12, 2025 18:01 Inactive
@vercel vercel Bot temporarily deployed to Preview – crisp November 12, 2025 22:58 Inactive
@vercel vercel Bot temporarily deployed to Preview – enclave-docs November 12, 2025 22:58 Inactive

@ctrlc03 ctrlc03 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

utACK

@ctrlc03 ctrlc03 enabled auto-merge (squash) November 13, 2025 08:55
@ctrlc03 ctrlc03 deleted the chore/crisp-wasm branch November 17, 2025 19:15
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.

Align CRISP zk-input WASM packaging with Enclave WASM

2 participants