Skip to content

feat: update to enclave specific org#673

Merged
ctrlc03 merged 12 commits into
mainfrom
feat/update-org
Sep 4, 2025
Merged

feat: update to enclave specific org#673
ctrlc03 merged 12 commits into
mainfrom
feat/update-org

Conversation

@ctrlc03

@ctrlc03 ctrlc03 commented Sep 2, 2025

Copy link
Copy Markdown
Collaborator

migrate to new org and bump versions.

Let's first merge the other open PRs so we can publish the new version with the updated content.

fix #584

folder package
./packages/enclave-config @enclave-e3/config
./packages/enclave-react @enclave-e3/react
./packages/enclave-sdk @enclave-e3/sdk
./packages/enclave-contracts @enclave-e3/contracts
./crates/wasm @enclave-e3/wasm

Summary by CodeRabbit

  • New Features

    • Default client template adds BFV support and switches to SDK-based encryptNumber flow.
  • Documentation

    • Updated guides, READMEs, examples and templates to use the new @enclave-e3/* packages and enclave-contracts paths.
    • Adjusted Vite and docs examples to reference updated WASM package names.
  • Chores

    • Migrated packages and manifests from @gnosis-guild/* to @enclave-e3/* with version bumps and publish settings; renamed evm → enclave-contracts across workspace, scripts, CI/CD, Docker, and deploy tooling.
  • Refactor

    • Minor contract artifact typing adjustment in IEnclave artifact.

@ctrlc03 ctrlc03 self-assigned this Sep 2, 2025
@vercel

vercel Bot commented Sep 2, 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 Sep 4, 2025 10:06am
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
enclave-docs Skipped Skipped Sep 4, 2025 10:06am

@coderabbitai

coderabbitai Bot commented Sep 2, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Repository-wide rebrand: references moved from packages/evm and @gnosis-guild/* to packages/enclave-contracts and @enclave-e3/*, plus related updates across CI, Docker, Rust artifacts, SDK/React packages, templates, examples, and docs. Also adds SDK BFV encryption flow in the default client.

Changes

Cohort / File(s) Summary of changes
CI/CD workflows
​.github/workflows/...
Replace packages/evm references with packages/enclave-contracts; adjust artifact checks, publication, triggers, and add git sync/clean in releases.
Build & deployment scripts / Docker
crates/Dockerfile, deploy/local/*.sh, examples/CRISP/scripts/*, examples/CRISP/docker-compose.yaml
Shift build/deploy/mount targets from packages/evmpackages/enclave-contracts; preserve commands.
Rust crates (artifacts/sol! macros)
crates/entrypoint/build.rs, crates/evm/src/*_sol*.rs
Update artifact/deployments paths to packages/enclave-contracts (sol! macro and rebuild triggers); no logic changes.
Contracts package
packages/enclave-contracts/*, pnpm-workspace.yaml
Rename package to @enclave-e3/contracts, bump versions, update tsconfig/tsup extends, update artifacts (IEnclave.json internalType), replace workspace entry for packages/evm.
SDK / React / WASM packages
packages/enclave-sdk/*, packages/enclave-react/*, crates/wasm/*
Rename to @enclave-e3/sdk, @enclave-e3/react, @enclave-e3/wasm; bump versions; update deps, publishConfig, scripts; update imports in source files and tsconfig/tsup references.
Root scripts & config
package.json, .changeset/config.json, docs/package.json
Root scripts updated to target enclave-contracts; expand .changeset ignore list; mark docs private.
Templates & Examples
templates/default/**, examples/CRISP/**
Replace @gnosis-guild/* with @enclave-e3/*, update imports/remappings, Vite optimizeDeps, adjust template WizardSDK to use SDK-based BFV encryption (FheProtocol + sdk.encryptNumber).
Docs
docs/pages/*
Update docs examples and commands to use packages/enclave-contracts and @enclave-e3/*.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant UI as WizardSDK (client)
  participant Hook as useEnclaveSDK (@enclave-e3/react)
  participant SDK as Enclave SDK (@enclave-e3/sdk)
  participant WASM as WASM (@enclave-e3/wasm)
  participant Chain as Enclave Contracts

  User->>UI: enter value → Publish
  UI->>Hook: init/configure(protocol: BFV)
  Hook->>SDK: configure(sdkConfig)
  UI->>SDK: sdk.encryptNumber(value, publicKey)
  SDK->>WASM: perform BFV encrypt
  WASM-->>SDK: ciphertext bytes
  SDK-->>UI: ciphertext bytes
  UI->>Chain: publishInput(hex(ciphertext))
  Chain-->>UI: tx receipt
  UI-->>User: show result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Assessment against linked issues

Objective Addressed Explanation
Rename packages/evm to packages/enclave (#584) PR renames to packages/enclave-contracts and updates imports to @enclave-e3/*; it does not create packages/enclave as requested.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
New BFV SDK encryption flow (templates/default/client/src/pages/WizardSDK.tsx) Introduces protocol/config and replaces previous bfv helper with sdk.encryptNumber — functionality beyond a straight path/package rename.
ABI internalType rename in IEnclave artifact (packages/enclave-contracts/artifacts/.../IEnclave.json) Changes ABI internalType string to IEnclave.E3RequestParams, which alters contract artifact metadata beyond path renaming.
Publish/publishConfig removals and making packages public (crates/wasm/package.json, packages/enclave-*.package.json) Changes package publish metadata (remove private flags, add publishConfig) — not required for directory rename.

Possibly related PRs

Suggested reviewers

  • ryardley
  • hmzakhalid
  • 0xjei

Poem

In burrows of code I twitch my nose,
Paths hop from evm to enclave-rose.
New carrots: @enclave-e3 sprout in rows,
BFV breezes where the wasm blows.
I thump deploys, the pipeline goes— a rabbit's merge, with tidy toes. 🥕✨


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9c47373 and 4a96c8a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (11)
  • .changeset/config.json (1 hunks)
  • crates/wasm/package.json (1 hunks)
  • docs/package.json (1 hunks)
  • examples/CRISP/client/package.json (1 hunks)
  • examples/CRISP/client/vite.config.ts (1 hunks)
  • examples/CRISP/package.json (1 hunks)
  • packages/enclave-config/package.json (1 hunks)
  • packages/enclave-contracts/package.json (3 hunks)
  • packages/enclave-react/package.json (2 hunks)
  • packages/enclave-sdk/package.json (4 hunks)
  • templates/default/package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (10)
  • examples/CRISP/package.json
  • packages/enclave-config/package.json
  • docs/package.json
  • examples/CRISP/client/package.json
  • packages/enclave-contracts/package.json
  • .changeset/config.json
  • templates/default/package.json
  • crates/wasm/package.json
  • packages/enclave-sdk/package.json
  • packages/enclave-react/package.json
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/update-org

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore or @coderabbit ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ctrlc03

ctrlc03 commented Sep 3, 2025

Copy link
Copy Markdown
Collaborator Author

CLI template tests will fail due to trying to download the packages from npmjs, where they are not yet published

@0xjei 0xjei 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.

utACK - we should double check one import and remove the two custom scripts.

Comment thread docs/pages/setting-up-server.mdx Outdated
Comment thread enclave.sh Outdated
Comment thread run_nodes.sh Outdated
@0xjei 0xjei marked this pull request as ready for review September 3, 2025 10:22

@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: 21

Caution

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

⚠️ Outside diff range comments (10)
packages/enclave-react/CHANGELOG.md (1)

3-10: Sync CHANGELOG version with package.json
packages/enclave-react/CHANGELOG.md (line 1): the header “## 0.0.6-test.0” doesn’t match the package.json version “0.0.7-test”; update the changelog entry to the correct version before adding date or links.

crates/wasm/README.md (1)

3-3: Fix typos/grammar in the introduction.

“funcionality” → “functionality”; “enable use to share” → “enable us to share.”

Apply:

-Here we export wasm funcionality for consumption in typescript to enable use to share code between Rust and Typescript.
+Here we export Wasm functionality for consumption in TypeScript to enable us to share code between Rust and TypeScript.
crates/init/src/lib.rs (1)

62-79: Consider collecting versions for all first-party packages used by templates.

You substitute versions for contracts/react/sdk, but templates may also reference @enclave-e3/wasm and @enclave-e3/config (e.g., vite optimizeDeps mentions wasm). Add reads and filters for those to avoid mismatched versions after scaffolding.

Proposed change:

@@
-    let react_version = spinner
+    let react_version = spinner
         .run("Getting workspace version of enclave-react...", || async {
             package_json::get_version_from_package_json(
                 &PathBuf::from(TEMP_DIR).join("packages/enclave-react/package.json"),
             )
             .await
         })
         .await?;
 
     let sdk_version = spinner
@@
         .await?;
+
+    let wasm_version = spinner
+        .run("Getting workspace version of enclave-wasm...", || async {
+            package_json::get_version_from_package_json(
+                &PathBuf::from(TEMP_DIR).join("crates/wasm/package.json"),
+            )
+            .await
+        })
+        .await?;
+
+    let config_version = spinner
+        .run("Getting workspace version of enclave-config...", || async {
+            package_json::get_version_from_package_json(
+                &PathBuf::from(TEMP_DIR).join("packages/enclave-config/package.json"),
+            )
+            .await
+        })
+        .await?;
@@
-                    Filter::new(
+                    Filter::new(
                         "**/package.json",
                         r#""@enclave-e3/sdk":\s*"[^"]*""#,
                         &format!(r#""@enclave-e3/sdk": "{}""#, sdk_version),
                     ),
+                    Filter::new(
+                        "**/package.json",
+                        r#""@enclave-e3/wasm":\s*"[^"]*""#,
+                        &format!(r#""@enclave-e3/wasm": "{}""#, wasm_version),
+                    ),
+                    Filter::new(
+                        "**/package.json",
+                        r#""@enclave-e3/config":\s*"[^"]*""#,
+                        &format!(r#""@enclave-e3/config": "{}""#, config_version),
+                    ),
.github/workflows/releases.yml (1)

133-140: Ensure prereleases aren’t published under latest.
Your package.json’s release script (pnpm build && changeset publish) doesn’t include a dist-tag, so CI’s pnpm release will default to latest. Either:

  • Add --tag test directly in the script (package.json):
     "release": "pnpm build && changeset publish"
    +"release": "pnpm build && changeset publish --tag test"
  • Or override it in the workflow (.github/workflows/releases.yml):
     - publish: pnpm release
    + publish: pnpm run release -- --tag test
templates/default/contracts/InputValidator.sol (1)

17-21: Missing override on interface implementation.

Solidity requires override when implementing interface functions; this will fail to compile.

-    ) external returns (bytes memory input) {
+    ) external override returns (bytes memory input) {
packages/enclave-contracts/tsup.config.mjs (1)

4-10: Remove or update missing types/index.ts entry in tsup.config.mjs
The entry "types/index.ts" under packages/enclave-contracts doesn’t exist (no types/ directory), which will break the tsup build—either remove this entry (and its include pattern) or point it to the correct file path.

templates/default/server/index.ts (2)

33-52: Harden CHAIN_ID handling (env is string; guard may mis-evaluate).

If CHAIN_ID comes as a string (e.g., "31337"), value in EnclaveSDK.chains may fail and chainId passed to the SDK may be wrong-typed. Coerce to number and validate against SDK-supported chains.

Apply:

@@
   } = getCheckedEnvVars();
 
-  if (!isSupportedChain(CHAIN_ID)) {
+  const numericChainId =
+    typeof CHAIN_ID === "string" ? Number(CHAIN_ID) : CHAIN_ID;
+  if (!isSupportedChain(numericChainId)) {
     throw new Error(`Unsupported CHAIN_ID: ${CHAIN_ID}`);
   }
@@
-    chainId: CHAIN_ID,
+    chainId: numericChainId as keyof typeof EnclaveSDK.chains,
   });
@@
-function isSupportedChain(value: any): value is keyof typeof EnclaveSDK.chains {
-  return value in EnclaveSDK.chains;
+function isSupportedChain(value: any): value is keyof typeof EnclaveSDK.chains {
+  const v = typeof value === "string" ? Number(value) : value;
+  return v in EnclaveSDK.chains;
 }

Also applies to: 222-224


230-247: Validate e3_id before BigInt() and use a parsed bigint.

Malformed e3_id will throw on BigInt(e3_id). Add a numeric-string check and reuse the parsed bigint.

@@
-    const { e3_id, ciphertext, proof } = req.body;
+    const { e3_id, ciphertext, proof } = req.body;
     if (e3_id === undefined || !ciphertext || !proof) {
@@
-    if (!isValidHexString(ciphertext) || !isValidHexString(proof)) {
+    if (!isValidHexString(ciphertext) || !isValidHexString(proof)) {
       console.error("ciphertext and proof must be valid hex strings");
@@
     }
 
+    if (typeof e3_id !== "string" || !/^\d+$/.test(e3_id)) {
+      console.error("e3_id must be a base-10 numeric string");
+      res.status(400).json({ error: "e3_id must be a base-10 numeric string" });
+      return;
+    }
+    const e3Id = BigInt(e3_id);
+
     console.log(`🔄 Publishing output for E3 ${e3_id}...`);
@@
-    const sdk = await createPrivateSDK();
-    await sdk.publishCiphertextOutput(BigInt(e3_id), ciphertext, proof);
+    const sdk = await createPrivateSDK();
+    await sdk.publishCiphertextOutput(e3Id, ciphertext, proof);
@@
-    const sessionKey = e3_id.toString();
+    const sessionKey = e3Id.toString();
@@
-      console.log(`✅ Successfully completed E3 ${e3_id}`);
+      console.log(`✅ Successfully completed E3 ${e3Id}`);

Also applies to: 266-276

.github/workflows/ci.yml (1)

1-673: Remove stale evm references across the repository
Stale evm:* scripts and paths remain and should be removed or updated to prevent hidden breakages:

  • package.json: remove all evm: scripts (lines ~13–40, 48)
  • tests/integration/fns.sh: drop pnpm evm:node invocations (lines 181, 183)
  • crates/README.md: clear EVM: annotations (lines 56, 78)
packages/enclave-contracts/package.json (1)

34-41: Update TypeChain outDir to dist/types to match package exports.

In packages/enclave-contracts/hardhat.config.cts (around line 135), change:

 typechain: {
-  outDir: "types",
+  outDir: "dist/types",
   target: "ethers-v6",
 },
♻️ Duplicate comments (2)
enclave.sh (1)

1-28: Don’t commit ad-hoc dev bootstrap scripts to main

Prefer moving this to scripts/dev or docs, or gate via make/just target. Prior feedback already noted this.

run_nodes.sh (1)

7-8: Don’t commit runnable scripts with embedded dev keys; move to .example.

Agree with prior feedback; keep as documentation or a *.example users can copy, and source sensitive values from env.

Suggested rename and ignore:

- run_nodes.sh
+ run_nodes.sh.example

Add a README snippet:

cp run_nodes.sh.example run_nodes.sh
export ANVIL_PRIVATE_KEY=0x...
bash run_nodes.sh
🧹 Nitpick comments (51)
enclave.sh (3)

6-7: Typo: “Contacts” → “Contracts”

Comment nit only.

-# Deploy Contacts
+# Deploy Contracts

13-13: Replace fixed sleep with readiness check

Poll the enclave/port with a timeout (e.g., curl/nc) instead of sleep 2.


15-23: De-duplicate address handling with a loop; improves readability and idempotency

Also easier to extend later.

-# Get the addresses of the ciphernodes
-CN1=0xbDA5747bFD65F08deb54cb465eB87D40e51B197E
-CN2=0xdD2FD4581271e230360230F9337D5c0430Bf44C0
-CN3=0x2546BcD3c84621e976D8185a91A922aE77ECEc30
-
-# Add the ciphernodes to the enclave
-pnpm ciphernode:add --ciphernode-address "$CN1" --network "localhost"
-pnpm ciphernode:add --ciphernode-address "$CN2" --network "localhost"
-pnpm ciphernode:add --ciphernode-address "$CN3" --network "localhost"
+# Get the addresses of the ciphernodes
+ADDRESSES=(
+  0xbDA5747bFD65F08deb54cb465eB87D40e51B197E
+  0xdD2FD4581271e230360230F9337D5c0430Bf44C0
+  0x2546BcD3c84621e976D8185a91A922aE77ECEc30
+)
+
+# Add the ciphernodes to the enclave
+for addr in "${ADDRESSES[@]}"; do
+  pnpm ciphernode:add --ciphernode-address "$addr" --network "localhost"
+done

Note: if ciphernode:add is not idempotent, consider checking existence first to avoid errors on reruns.

packages/enclave-contracts/README.md (1)

8-8: Clarify install command during pre-release window

Looks good for the final stable publish. While packages remain unpublished under the new org, consider making the channel explicit to avoid confusion for template users running this today.

Example tweak:

-pnpm add @enclave-e3/contracts
+pnpm add @enclave-e3/contracts@latest
+// If you need the pre-release before GA:
+// pnpm add @enclave-e3/contracts@0.0.7-test
packages/enclave-config/CHANGELOG.md (1)

3-7: Version mismatch with package.json (pre mode alignment)

Changelog shows 0.0.6-test.0 but package.json was bumped to 0.0.7-test in this PR. Please sync versions or regenerate with Changesets pre mode to avoid confusing consumers.

Proposed quick fix:

-## 0.0.6-test.0
+## 0.0.7-test
crates/wasm/CHANGELOG.md (1)

3-7: Changelog version likely out of sync

Same as config: 0.0.6-test.0 here vs the repo-wide bump to 0.0.7-test. Recommend regenerating changelogs or adjusting the header to match the published version you intend.

-## 0.0.6-test.0
+## 0.0.7-test
templates/default/deploy/enclave.ts (1)

7-8: Verify subpath exports exist in @enclave-e3/contracts

If the package’s exports field doesn’t expose "deploy/enclave" and "deploy/mocks", Hardhat will fail at runtime. Confirm those subpaths are exported, or switch to a root-level named export if available.

If supported by the package, this can reduce subpath fragility:

-import deployEnclave from "@enclave-e3/contracts/deploy/enclave";
-import deployMocks from "@enclave-e3/contracts/deploy/mocks";
+import { deployEnclave, deployMocks } from "@enclave-e3/contracts";
templates/default/client/vite.config.ts (1)

24-25: Outdated include pattern still references /packages/evm/

This regex no longer matches the renamed packages and is likely dead weight in the template. Suggest removing it or updating to the new folder names if you rely on in-repo E2E runs.

Option A (template-friendly):

-      include: [/node_modules/, /packages\/evm/],
+      include: [/node_modules/],

Option B (in-repo E2E-friendly):

-      include: [/node_modules/, /packages\/evm/],
+      include: [
+        /node_modules/,
+        /packages\/enclave-(contracts|sdk|react|config)/,
+      ],
examples/CRISP/scripts/evm_deploy.sh (1)

5-8: Use npx to invoke wait-on to avoid PATH dependency.

Ensures the script works in fresh environments where wait-on isn’t globally installed.

-wait-on tcp:8545 && \
+npx wait-on tcp:8545 && \
 (cd ../../packages/enclave-contracts && \
   rm -rf deployments/localhost && \
   pnpm deploy:mocks --network localhost)
examples/CRISP/scripts/setup.sh (1)

10-10: Update log label to match enclave-contracts
Change the echo from “evm” to “contracts” for clarity.

-echo "evm"
+echo "contracts"
examples/CRISP/CHANGELOG.md (1)

3-9: Add release date and PR/issue reference for traceability.

Changelogs are more useful with a date and a link back to the PR or issue.

-## 0.0.1-test.0
+## 0.0.1-test.0 - 2025-09-02
 ...
-### Patch Changes
+### Patch Changes
 - Updated dependencies
   - @enclave-e3/contracts@0.0.6-test.0
+  ([#673])
+
+[#673]: https://github.com/gnosisguild/enclave/pull/673
deploy/local/contracts.sh (1)

1-4: Fix shebang and harden script; also correct “Contacts” typo.

Current shebang is invalid (“# !/bin/bash”). Add strict mode and correct the comment.

-# !/bin/bash
+#!/usr/bin/env bash
+set -euo pipefail
@@
-# Deploy Contacts
+# Deploy Contracts
 (cd packages/enclave-contracts && rm -rf deployments/localhost && pnpm deploy:mocks --network localhost)

Also applies to: 6-8

packages/enclave-sdk/CHANGELOG.md (1)

5-10: Add a brief migration note for consumers.

Renaming the npm org affects installs/imports for users.

Apply:

 ### Patch Changes
 - Migrate npm org
 - Updated dependencies
   - @enclave-e3/contracts@0.0.6-test.0
   - @enclave-e3/wasm@0.0.6-test.0
+
+### Migration
+- Package published under new scope. Update installs/imports to `@enclave-e3/sdk`.
examples/CRISP/scripts/build.sh (1)

3-7: Harden the script flags.

Prefer fail-fast defaults.

Apply:

-set -e
+set -Eeuo pipefail
.github/workflows/ec2-deployment.yml (2)

10-10: Watcher path rename LGTM; consider catching deploy/script/config changes too.

Broaden to avoid missing contract-affecting changes; also confirm GHCR org is intended to remain gnosisguild.

Apply:

       - "crates/**"
-      - "packages/enclave-contracts/contracts/**"
+      - "packages/enclave-contracts/contracts/**"
+      - "packages/enclave-contracts/deploy/**"
+      - "packages/enclave-contracts/script/**"
+      - "packages/enclave-contracts/foundry.toml"
+      - "packages/enclave-contracts/package.json"

And mirror the same under pull_request.paths.

Verify GHCR target is correct for the org migration.

Also applies to: 18-18


35-35: Bump checkout to v4.

Minor maintenance.

Apply:

-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
docs/pages/CRISP/setup.mdx (1)

250-250: Clarify working directory.

Readers should run this from examples/CRISP (as implied). Add a short note to reduce path confusion.

Apply:

-   cd ../../packages/enclave-contracts
+   # from examples/CRISP
+   cd ../../packages/enclave-contracts
packages/enclave-sdk/src/wasm.ts (1)

10-16: Avoid repeated WASM init on every call.

Cache initialization; keeps semantics, improves perf.

Apply:

 import init from "@enclave-e3/wasm/init";
 
 export async function encryptNumber(
   data: bigint,
   public_key: Uint8Array,
 ): Promise<Uint8Array> {
-  await init();
+  // Initialize once per process
+  // eslint-disable-next-line @typescript-eslint/no-explicit-any
+  const g = globalThis as any;
+  g.__e3_wasm_init ||= init();
+  await g.__e3_wasm_init;
   return encrypt_number(data, public_key);
 }

Alternative (module-scoped promise):

let wasmInit: Promise<void> | null = null;
const ensureWasm = () => (wasmInit ??= init());

await ensureWasm();
examples/CRISP/docker-compose.yaml (3)

16-16: Rename the volume to match the new package path (avoids lingering “evm” terminology).

The mount target moved to packages/enclave-contracts but the named volume is still evm-node-modules. Consider renaming for clarity. This is non-breaking functionally, but it reduces confusion.

Apply:

-      - evm-node-modules:/app/packages/enclave-contracts/node_modules
+      - enclave-contracts-node-modules:/app/packages/enclave-contracts/node_modules
@@
-  evm-node-modules:
+  enclave-contracts-node-modules:

Also applies to: 42-42


10-23: Speed up installs with a persisted pnpm store cache.

Persisting the pnpm store significantly reduces install time inside the container.

Apply:

       - cargo-registry:/home/ubuntu/.cargo/registry
       - server-target:/app/examples/CRISP/server/target
+      - pnpm-store:/home/ubuntu/.local/share/pnpm/store
@@
   synpress-cache:
   test-results:
   playwright-report:
+  pnpm-store:

Also applies to: 38-51


3-3: Optional: drop hardcoded platform to improve Apple Silicon DX.

platform: linux/amd64 can hurt M1/M2 dev machines. If not strictly required, consider omitting it or documenting how to override via DOCKER_DEFAULT_PLATFORM.

templates/default/scripts/deploy-local.ts (1)

18-19: Avoid mixing ESM imports with require()/require.main checks.

This template may run under ESM; require is undefined there. Prefer ESM-safe patterns.

Apply:

-  const hre = require("hardhat");
+  import hre from "hardhat";
@@
-if (require.main === module) {
-  main()
-    .then(() => process.exit(0))
-    .catch((error) => {
-      console.error(error);
-      process.exit(1);
-    });
-}
+import { pathToFileURL } from "node:url";
+if (import.meta.url === pathToFileURL(process.argv[1]).href) {
+  main()
+    .then(() => process.exit(0))
+    .catch((error) => {
+      console.error(error);
+      process.exit(1);
+    });
+}

If the template is explicitly CJS, keep require but convert top-level imports to CJS or switch the file to full ESM consistently.

Also applies to: 51-58

crates/wasm/README.md (1)

11-11: Minor wording: add apostrophe in “DON’T”.

Apply:

-##### ❌ DONT USE THE DEFAULT INIT
+##### ❌ DON'T USE THE DEFAULT INIT
crates/wasm/package.json (1)

47-53: Optional metadata touch-ups for the new org.

  • Consider updating author to reflect the @enclave-e3 org.
  • Optionally add publishConfig.access to avoid passing flags.

Apply:

   "author": {
-    "name": "gnosisguild",
-    "url": "https://github.com/gnosisguild"
+    "name": "enclave-e3",
+    "url": "https://github.com/gnosisguild/enclave"
   },
+  "publishConfig": { "access": "public" },
packages/enclave-config/package.json (1)

5-23: Tidy publishing surface and metadata (optional).

Add files to constrain the publish output and basic metadata; also consider aligning “main” with actual files or removing it if unused.

Apply:

   "description": "",
-  "module": true,
-  "main": "index.js",
+  "module": true,
+  "main": "./index.js",
   "type": "module",
+  "files": [
+    "tsup.config.js",
+    "tsconfig.json",
+    "dom.tsconfig.json",
+    "index.js",
+    "README.md",
+    "LICENSE"
+  ],
@@
   "author": "",
+  "publishConfig": { "access": "public" },

If there is no index.js in this package, consider removing “main” altogether to avoid confusing consumers.

packages/enclave-sdk/src/types.ts (1)

80-96: Optional: tighten address typing in event payloads.

Several fields represent EVM addresses but are typed as string. Consider using 0x${string} for stronger compile-time guarantees.

Example pattern:

export interface E3 {
  // …
  e3Program: `0x${string}`;
  inputValidator: `0x${string}`;
  decryptionVerifier: `0x${string}`;
  committeePublicKey: string; // keep as string if not an address
  // …
}

export interface RegistryEventData {
  [RegistryEventType.ENCLAVE_SET]: { enclave: `0x${string}` };
  // …
}

Also applies to: 176-185

packages/enclave-react/README.md (1)

66-67: Sample values: prefer seconds for timestamps and parseEther for readability.

EVM APIs typically expect seconds; parseEther improves clarity over raw wei.

Apply:

-        startWindow: [BigInt(Date.now()), BigInt(Date.now() + 300000)],
+        startWindow: [
+          BigInt(Math.floor(Date.now() / 1000)),
+          BigInt(Math.floor(Date.now() / 1000) + 300),
+        ],
-        value: BigInt('1000000000000000') // 0.001 ETH
+        value: parseEther('0.001') // viem: import { parseEther } from 'viem'

Also applies to: 71-71

crates/Dockerfile (1)

34-35: Confirm COPY sources exist at build time; fail early if not.

If deployments aren’t present for all targets, the COPY will fail.

Optional guard (add before COPY):

# sanity check (optional)
# RUN test -d /build/packages/enclave-contracts/artifacts && test -d /build/packages/enclave-contracts/deployments

Also consider renaming the stage from evm-builder to contracts-builder to match the new naming.

crates/init/src/lib.rs (1)

331-335: Issue link may need org update.

Installer error path still points to gnosisguild/enclave. If issues are tracked elsewhere after the move, adjust the link.

packages/enclave-sdk/README.md (4)

212-224: Invalid TS in usage snippet (object keys marked optional).

value?: and gasLimit?: inside an object literal is invalid syntax. Present a typed interface or remove ? in the usage snippet.

Apply:

-// Request a new E3 computation
-await sdk.requestE3({
+// Request a new E3 computation
+await sdk.requestE3({
   filter: `0x${string}`,
   threshold: [number, number],
   startWindow: [bigint, bigint],
   duration: bigint,
   e3Program: `0x${string}`,
   e3ProgramParams: `0x${string}`,
   computeProviderParams: `0x${string}`,
-  value?: bigint,
-  gasLimit?: bigint
+  // optionally:
+  // value: bigint,
+  // gasLimit: bigint
 });

Or add a separate “Type signature” block with the exact types.


225-231: Function-call snippet uses type annotations in call site.

await sdk.activateE3(e3Id: bigint, ...) is not valid usage. Show either a signature or a plain call with example values.

Apply:

-// Activate an E3 computation
-await sdk.activateE3(e3Id: bigint, publicKey: `0x${string}`, gasLimit?: bigint);
+// Activate an E3 computation
+await sdk.activateE3(1n, '0x...', /* optional */ undefined);
+
+// Type signature:
+// activateE3(e3Id: bigint, publicKey: `0x${string}`, gasLimit?: bigint): Promise<Hash>

306-309: “Building the SDK” points to enclave-contracts.

If SDK build depends on contract artifacts, clarify the prerequisite vs. the SDK build itself (e.g., “Compile contracts first, then build SDK”). Add the SDK’s own build command to reduce confusion.


324-326: Testing section targets contracts.

If this file documents the SDK, add or link to SDK tests (and keep the contracts tests as a prerequisite if needed).

.github/workflows/releases.yml (1)

36-76: Aggressive clean is fine but double-check stash/reset ordering.

You stash, then hard-reset and clean twice. That’s safe but redundant. Minor simplification possible. Also verify the listed artifact paths exist after the rename (they do in this PR).

packages/enclave-react/package.json (1)

45-54: Dependency alignment looks consistent; consider peer ranges.

  • @enclave-e3/sdk as workspace dep is good.
  • You may want to declare react-dom as a peer if any hooks rely on it indirectly (optional).
  • Consider using a caret range for viem to ease patch upgrades unless you’ve hit regressions.
docs/pages/write-e3-contract.mdx (1)

47-49: Verify link target and improve anchor text.

The link points to a specific commit and a renamed path. Please confirm the file exists at that commit and update the anchor text for clarity.

Proposed tweak:

-[mockup](https://github.com/gnosisguild/enclave/blob/cf50fd6c10f0df8f03eecfd19cedc17b051e72a6/packages/enclave-contracts/contracts/test/MockE3Program.sol#L9)
+[MockE3Program.sol (test)](https://github.com/gnosisguild/enclave/blob/cf50fd6c10f0df8f03eecfd19cedc17b051e72a6/packages/enclave-contracts/contracts/test/MockE3Program.sol#L9)
docs/pages/setting-up-server.mdx (1)

35-36: Note on template CI failures (npm publish lag).

Given these docs encourage using newly renamed packages, consider adding a short note or using pnpm overrides in templates to link to local workspaces during CI until publish completes.

Example (in template package.json):

{
  "pnpm": {
    "overrides": {
+     "@enclave-e3/sdk": "link:../../packages/enclave-sdk",
+     "@enclave-e3/contracts": "link:../../packages/enclave-contracts",
+     "@enclave-e3/react": "link:../../packages/enclave-react"
    }
  }
}

Also applies to: 41-42, 211-211, 228-229

templates/default/contracts/InputValidator.sol (2)

8-8: Inconsistent import path vs. docs; consider the aggregator.

Docs use @enclave-e3/contracts/interfaces.sol, while this template uses @enclave-e3/contracts/contracts/interfaces/IInputValidator.sol. Standardize to one canonical path to avoid user confusion.

Option A (prefer consistent docs + shorter path):

-import {IInputValidator} from "@enclave-e3/contracts/contracts/interfaces/IInputValidator.sol";
+import {IInputValidator} from "@enclave-e3/contracts/interfaces.sol";

Option B (if aggregator isn’t exported, keep the long path but update docs accordingly).


18-20: Unused parameter warning for sender.

If not used, prefix with _ to silence warnings or add a TODO about intended use.

-        address sender,
+        address /*sender*/,
templates/default/package.json (1)

19-20: Replace workspace: deps in template package.json files*
templates/default/package.json (lines 19–20) and templates/default/client/package.json (lines 18–19) still reference workspace:*. Outside the monorepo these won’t resolve and will break template installs. Update them to the published semver (e.g. ^x.y.z) or ensure your CLI scaffolder swaps workspace:* for the correct versions post–publish.

packages/enclave-sdk/src/contract-client.ts (1)

22-27: Optional: remove or use contractInfo to avoid redundant state

initialize() populates contractInfo, but the call sites still read abis/addresses directly. Either use contractInfo everywhere or drop it to simplify.

Also applies to: 53-71, 95-98, 150-153, 196-199, 243-246, 280-283

templates/default/server/index.ts (2)

299-301: Duplicate GET /sessions route.

Defined twice; drop one to avoid confusion. Functionally harmless but noisy.

-app.get("/sessions", handleGetSessions);
-
 // This allows us to test interaction between server and program
 // TEST_MODE=1 pnpm dev:server
 if (process.env.TEST_MODE) {
   app.get("/test", handleTestInteraction);
 }
 
-app.get("/sessions", handleGetSessions);
+app.get("/sessions", handleGetSessions);

Also applies to: 308-309


44-55: Consider reusing a single SDK instance.

createPrivateSDK() is called in multiple paths (events, runner, webhook), each initializing a new client. Pooling a singleton reduces startup latency and WS/HTTP overhead.

Also applies to: 205-216

templates/default/tests/integration.spec.ts (1)

198-199: Minor: prefer parseEther for readability.

value: parseEther("0.001") is clearer than a hardcoded wei bigint.

templates/default/client/src/pages/WizardSDK.tsx (1)

792-805: Prefer viem’s toHex for byte→hex conversion (minor).

Small readability win and avoids manual mapping.

Example:

import { toHex } from 'viem';

// ...
await publishInput(e3State.id, toHex(encryptedInput1) as `0x${string}`);
const hash2 = await publishInput(e3State.id, toHex(encryptedInput2) as `0x${string}`);
.github/workflows/ci.yml (1)

541-547: Uploading enclave-contracts artifacts — OK; consider bundling npm tarballs to unblock template jobs pre-publish.

Given packages aren’t yet on npm, add a step to pack local tarballs and ship them with sdk-artifacts, then install those in template jobs.

Example steps to add (build_sdk):

- name: Pack npm tarballs
  run: |
    pnpm --filter @enclave-e3/contracts pack --pack-destination artifacts/npm
    pnpm --filter @enclave-e3/sdk pack --pack-destination artifacts/npm
    pnpm --filter @enclave-e3/react pack --pack-destination artifacts/npm

- name: Upload npm tarballs
  uses: actions/upload-artifact@v4
  with:
    name: npm-tarballs
    path: artifacts/npm/*.tgz
    retention-days: 1

And in template_integration (before tests):

- name: Download npm tarballs
  uses: actions/download-artifact@v4
  with:
    name: npm-tarballs
    path: ./artifacts/npm

- name: Install local packages into template
  working-directory: templates/default
  run: |
    pnpm add ./../artifacts/npm/@enclave-e3-contracts-*.tgz
    pnpm add ./../artifacts/npm/@enclave-e3-sdk-*.tgz
    pnpm add ./../artifacts/npm/@enclave-e3-react-*.tgz
packages/enclave-contracts/package.json (1)

110-115: TypeChain runs twice; remove duplicate invocation.

compile:ts already runs typechain, and postcompile runs it again after compile. This adds minutes to CI with no benefit.

Apply:

 "compile:ts": "pnpm typechain && tsup",
-"postcompile": "pnpm typechain",

Also applies to: 124-124

packages/enclave-sdk/package.json (2)

16-16: Avoid brittle cd chains; use workspace filters.

This is more robust to path changes and works cross-shell.

-"prebuild": "cd ../enclave-contracts && pnpm compile:ts && cd ../../crates/wasm && pnpm build",
+"prebuild": "pnpm --filter @enclave-e3/contracts compile:ts && pnpm --filter @enclave-e3/wasm build",

33-41: Trim runtime deps; move test/build-only deps to dev, and make viem a peer.

  • vitest and Vite plugins are not needed by consumers → move to devDependencies.
  • Consider viem as a peer to prevent duplicate installs in apps. Keep it in devDeps for local builds/tests.
  • Optional: declare "sideEffects": false for better tree-shaking.
   "devDependencies": {
     "@enclave-e3/config": "workspace:*",
     "concurrently": "^9.1.2",
     "tsup": "^8.5.0",
     "typescript": "5.8.3",
-    "vite": "^6.2.0",
-    "vite-plugin-dts": "^4.5.3"
+    "vite": "^6.2.0",
+    "vite-plugin-dts": "^4.5.3",
+    "vitest": "^1.6.1",
+    "vite-plugin-top-level-await": "^1.5.0",
+    "vite-plugin-wasm": "^3.4.1",
+    "viem": "2.30.6"
   },
+  "peerDependencies": {
+    "viem": "^2.30.6"
+  },
   "dependencies": {
-    "@enclave-e3/wasm": "workspace:*",
-    "@enclave-e3/contracts": "workspace:*",
-    "comlink": "^4.4.2",
-    "viem": "2.30.6",
-    "vite-plugin-top-level-await": "^1.5.0",
-    "vite-plugin-wasm": "^3.4.1",
-    "vitest": "^1.6.1",
-    "web-worker": "^1.5.0"
+    "@enclave-e3/wasm": "workspace:*",
+    "@enclave-e3/contracts": "workspace:*",
+    "comlink": "^4.4.2",
+    "web-worker": "^1.5.0"
   }

Optionally add at top-level:

+ "sideEffects": false,
package.json (1)

12-41: Script path migration LGTM; consider workspace filters to reduce cd usage.

Keeps scripts resilient to future path changes and improves Windows/devcontainer DX.

Example changes:

-"clean": "cd packages/enclave-contracts && pnpm clean",
+"clean": "pnpm --filter @enclave-e3/contracts clean",
-"evm:build": "cd packages/enclave-contracts && pnpm compile",
+"evm:build": "pnpm --filter @enclave-e3/contracts compile",
-"evm:test": "cd packages/enclave-contracts && pnpm test",
+"evm:test": "pnpm --filter @enclave-e3/contracts test",
-"sdk:build": "cd packages/enclave-sdk && pnpm build",
+"sdk:build": "pnpm --filter @enclave-e3/sdk build",
.changeset/lazy-llamas-arrive.md (1)

9-9: Strengthen the changelog: call out the scope change and add brief migration notes.

Consumers must update import paths and dependency names. Make that explicit in the summary.

Apply:

-Migrate to enclave-e3 org
+BREAKING: migrate package scope from @gnosis-guild/* to @enclave-e3/*.
+
+Migration:
+- Update package.json deps to the @enclave-e3 scope.
+- Update imports, e.g. `import { ... } from '@enclave-e3/sdk'`.
+- Old @gnosis-guild packages will be deprecated; switch to @enclave-e3 equivalents.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ed02ae2 and 696f234.

⛔ Files ignored due to path filters (2)
  • packages/enclave-contracts/test/fixtures/pubkey.bin is excluded by !**/*.bin
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (69)
  • .changeset/lazy-llamas-arrive.md (1 hunks)
  • .changeset/pre.json (1 hunks)
  • .github/workflows/ci.yml (3 hunks)
  • .github/workflows/ec2-deployment.yml (1 hunks)
  • .github/workflows/releases.yml (2 hunks)
  • crates/Dockerfile (2 hunks)
  • crates/entrypoint/build.rs (2 hunks)
  • crates/evm/src/ciphernode_registry_sol.rs (1 hunks)
  • crates/evm/src/enclave_sol_reader.rs (1 hunks)
  • crates/evm/src/enclave_sol_writer.rs (1 hunks)
  • crates/evm/src/registry_filter_sol.rs (1 hunks)
  • crates/init/src/lib.rs (2 hunks)
  • crates/wasm/CHANGELOG.md (1 hunks)
  • crates/wasm/README.md (1 hunks)
  • crates/wasm/package.json (1 hunks)
  • deploy/local/contracts.sh (1 hunks)
  • deploy/local/start.sh (1 hunks)
  • docs/pages/CRISP/setup.mdx (2 hunks)
  • docs/pages/setting-up-server.mdx (5 hunks)
  • docs/pages/write-e3-contract.mdx (2 hunks)
  • enclave.sh (1 hunks)
  • examples/CRISP/CHANGELOG.md (1 hunks)
  • examples/CRISP/Readme.md (1 hunks)
  • examples/CRISP/contracts/CRISPInputValidator.sol (1 hunks)
  • examples/CRISP/contracts/CRISPProgram.sol (1 hunks)
  • examples/CRISP/deploy/Deploy.s.sol (1 hunks)
  • examples/CRISP/docker-compose.yaml (1 hunks)
  • examples/CRISP/package.json (1 hunks)
  • examples/CRISP/remappings.txt (1 hunks)
  • examples/CRISP/scripts/build.sh (1 hunks)
  • examples/CRISP/scripts/evm_deploy.sh (1 hunks)
  • examples/CRISP/scripts/setup.sh (1 hunks)
  • package.json (2 hunks)
  • packages/enclave-config/CHANGELOG.md (1 hunks)
  • packages/enclave-config/package.json (1 hunks)
  • packages/enclave-contracts/README.md (1 hunks)
  • packages/enclave-contracts/artifacts/contracts/interfaces/IEnclave.sol/IEnclave.json (1 hunks)
  • packages/enclave-contracts/package.json (2 hunks)
  • packages/enclave-contracts/tsconfig.json (1 hunks)
  • packages/enclave-contracts/tsup.config.mjs (1 hunks)
  • packages/enclave-react/CHANGELOG.md (1 hunks)
  • packages/enclave-react/README.md (2 hunks)
  • packages/enclave-react/package.json (2 hunks)
  • packages/enclave-react/src/index.ts (2 hunks)
  • packages/enclave-react/src/useEnclaveSDK.ts (2 hunks)
  • packages/enclave-react/tsconfig.json (1 hunks)
  • packages/enclave-react/tsup.config.js (1 hunks)
  • packages/enclave-sdk/CHANGELOG.md (1 hunks)
  • packages/enclave-sdk/README.md (8 hunks)
  • packages/enclave-sdk/package.json (3 hunks)
  • packages/enclave-sdk/src/contract-client.ts (1 hunks)
  • packages/enclave-sdk/src/enclave-sdk.ts (1 hunks)
  • packages/enclave-sdk/src/types.ts (1 hunks)
  • packages/enclave-sdk/src/wasm.ts (1 hunks)
  • packages/enclave-sdk/tsconfig.json (1 hunks)
  • packages/enclave-sdk/tsup.config.js (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
  • run_nodes.sh (1 hunks)
  • templates/default/client/package.json (1 hunks)
  • templates/default/client/src/pages/WizardSDK.tsx (2 hunks)
  • templates/default/client/vite.config.ts (1 hunks)
  • templates/default/contracts/InputValidator.sol (1 hunks)
  • templates/default/contracts/MyProgram.sol (1 hunks)
  • templates/default/deploy/enclave.ts (1 hunks)
  • templates/default/hardhat.config.ts (2 hunks)
  • templates/default/package.json (1 hunks)
  • templates/default/scripts/deploy-local.ts (1 hunks)
  • templates/default/server/index.ts (1 hunks)
  • templates/default/tests/integration.spec.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (9)
📚 Learning: 2024-11-05T06:56:49.157Z
Learnt from: ryardley
PR: gnosisguild/enclave#173
File: packages/ciphernode/enclave_node/src/aggregator.rs:0-0
Timestamp: 2024-11-05T06:56:49.157Z
Learning: `RegistryFilterSol` does not have a reader and does not require a repository reader or deploy block when calling `RegistryFilterSol::attach` in `packages/ciphernode/enclave_node/src/aggregator.rs`.

Applied to files:

  • crates/evm/src/registry_filter_sol.rs
📚 Learning: 2024-10-22T03:39:29.448Z
Learnt from: ryardley
PR: gnosisguild/enclave#145
File: packages/ciphernode/evm/src/enclave_sol_reader.rs:87-89
Timestamp: 2024-10-22T03:39:29.448Z
Learning: In the `ciphernode` project, specifically in `packages/ciphernode/evm/src/enclave_sol_reader.rs`, the method `EnclaveSolReader::attach` should be retained even if it directly calls `EvmEventReader::attach` without additional processing. Avoid suggesting its removal in future reviews.

Applied to files:

  • crates/evm/src/enclave_sol_reader.rs
  • crates/evm/src/ciphernode_registry_sol.rs
  • crates/evm/src/enclave_sol_writer.rs
📚 Learning: 2024-09-26T03:11:29.311Z
Learnt from: ryardley
PR: gnosisguild/enclave#107
File: packages/ciphernode/sortition/src/distance.rs:1-1
Timestamp: 2024-09-26T03:11:29.311Z
Learning: In `packages/ciphernode/core/src/events.rs`, the import statements use the correct and updated `alloy::primitives` module.

Applied to files:

  • packages/enclave-sdk/src/types.ts
  • crates/evm/src/ciphernode_registry_sol.rs
📚 Learning: 2025-08-25T10:28:56.174Z
Learnt from: ctrlc03
PR: gnosisguild/enclave#657
File: Cargo.toml:32-34
Timestamp: 2025-08-25T10:28:56.174Z
Learning: The examples/CRISP directory has its own Cargo.toml workspace configuration with members like "server", "wasm-crypto", "program/core", "program/client", etc. The root workspace intentionally excludes "examples/CRISP/server", "examples/CRISP/program", and "examples/CRISP/wasm-crypto" to prevent double workspace membership, which is the correct approach for self-contained example workspaces.

Applied to files:

  • examples/CRISP/docker-compose.yaml
📚 Learning: 2024-10-08T07:15:06.690Z
Learnt from: ryardley
PR: gnosisguild/enclave#139
File: packages/ciphernode/evm/src/ciphernode_registry_sol.rs:133-143
Timestamp: 2024-10-08T07:15:06.690Z
Learning: In `packages/ciphernode/evm/src/ciphernode_registry_sol.rs`, the function `helpers::stream_from_evm` in Rust returns `()`, not a `Result`, so error handling with `if let Err(e) = ...` is not applicable.

Applied to files:

  • crates/evm/src/ciphernode_registry_sol.rs
📚 Learning: 2024-11-05T06:48:58.177Z
Learnt from: ryardley
PR: gnosisguild/enclave#173
File: packages/ciphernode/config/src/app_config.rs:13-21
Timestamp: 2024-11-05T06:48:58.177Z
Learning: In the `packages/ciphernode/config/src/app_config.rs` file, for the `Contract` enum, the team prefers to use `String` type for `address` fields, relying on parsing to handle validation, instead of using the `Address` type.

Applied to files:

  • crates/evm/src/ciphernode_registry_sol.rs
📚 Learning: 2024-10-29T01:03:50.414Z
Learnt from: ryardley
PR: gnosisguild/enclave#156
File: packages/ciphernode/config/src/app_config.rs:21-26
Timestamp: 2024-10-29T01:03:50.414Z
Learning: In `packages/ciphernode/config/src/app_config.rs`, the `rpc_url` field in the `ChainConfig` struct is not considered sensitive and does not need to be encrypted.

Applied to files:

  • crates/evm/src/ciphernode_registry_sol.rs
📚 Learning: 2025-08-29T16:46:50.251Z
Learnt from: ctrlc03
PR: gnosisguild/enclave#666
File: examples/CRISP/contracts/CRISPChecker.sol:9-9
Timestamp: 2025-08-29T16:46:50.251Z
Learning: In hashcloak/semaphore-contracts-noir package, the interface is still named ISemaphore, not ISemaphoreNoir. The Noir support was added via Noir verifier contracts while keeping the original ISemaphore interface name.

Applied to files:

  • examples/CRISP/deploy/Deploy.s.sol
📚 Learning: 2024-09-26T04:15:32.544Z
Learnt from: ryardley
PR: gnosisguild/enclave#107
File: tests/basic_integration/test.sh:81-83
Timestamp: 2024-09-26T04:15:32.544Z
Learning: In `tests/basic_integration/test.sh`, it's acceptable to wait indefinitely for the EVM node to start without a timeout, as it's unlikely to fail here.

Applied to files:

  • examples/CRISP/scripts/evm_deploy.sh
🧬 Code graph analysis (2)
run_nodes.sh (1)
crates/config/src/app_config.rs (1)
  • nodes (283-285)
crates/init/src/lib.rs (1)
crates/init/src/copy.rs (1)
  • new (21-27)
🪛 LanguageTool
packages/enclave-sdk/CHANGELOG.md

[grammar] ~9-~9: There might be a mistake here.
Context: ...s - @enclave-e3/contracts@0.0.6-test.0 - @enclave-e3/wasm@0.0.6-test.0

(QB_NEW_EN)


[grammar] ~10-~10: There might be a mistake here.
Context: ...test.0 - @enclave-e3/wasm@0.0.6-test.0

(QB_NEW_EN)

packages/enclave-react/CHANGELOG.md

[grammar] ~9-~9: There might be a mistake here.
Context: ...dencies - @enclave-e3/sdk@0.0.6-test.0

(QB_NEW_EN)

examples/CRISP/CHANGELOG.md

[grammar] ~8-~8: There might be a mistake here.
Context: ...s - @enclave-e3/contracts@0.0.6-test.0

(QB_NEW_EN)

docs/pages/write-e3-contract.mdx

[grammar] ~47-~47: There might be a mistake here.
Context: ...cts/contracts/test/MockE3Program.sol#L9) or check out the [demo implementation fo...

(QB_NEW_EN)

🪛 Shellcheck (0.10.0)
run_nodes.sh

[error] 1-1: Remove spaces between # and ! in the shebang.

(SC1115)

enclave.sh

[error] 1-1: Remove spaces between # and ! in the shebang.

(SC1115)

🪛 Gitleaks (8.27.2)
enclave.sh

10-10: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🔇 Additional comments (66)
templates/default/client/vite.config.ts (1)

20-21: LGTM: wasm package exclude updated

Excluding '@enclave-e3/wasm' from optimizeDeps matches the new namespace and avoids Vite pre-bundling issues with wasm.

deploy/local/contracts.sh (1)

7-7: Path migration LGTM.

Switch to packages/enclave-contracts for local deploy matches the org/package rename.

examples/CRISP/scripts/build.sh (1)

6-6: Path update to enclave-contracts looks correct.

docs/pages/CRISP/setup.mdx (1)

179-183: Docs path update LGTM.

packages/enclave-sdk/src/wasm.ts (1)

7-8: Verified “./init” subpath export is present — the import at lines 7–8 in packages/enclave-sdk/src/wasm.ts will resolve correctly.

examples/CRISP/Readme.md (1)

125-125: Documentation update aligns with package migration.

The path update from evm to enclave-contracts correctly reflects the package restructuring described in the PR objectives.

templates/default/hardhat.config.ts (1)

9-9: Hardhat configuration updated for new package organization.

Both the import path and external artifacts path have been correctly updated to reference the new @enclave-e3/contracts package instead of the old @gnosis-guild/enclave path.

Also applies to: 54-54

deploy/local/start.sh (1)

71-71: Local deployment script updated consistently.

The deployment path has been properly updated to use packages/enclave-contracts instead of packages/evm, maintaining consistency with the broader package restructuring.

crates/entrypoint/build.rs (1)

24-24: Build script paths updated for contract deployment artifacts.

Both the deployment artifacts path and the cargo rebuild trigger have been correctly updated to reference the new enclave-contracts package location. This ensures the build system continues to work properly with the restructured package layout.

Also applies to: 66-66

examples/CRISP/docker-compose.yaml (1)

1-51: No stale evm references found outside the intended docker‐compose entries.

templates/default/scripts/deploy-local.ts (2)

12-12: Default export confirmed: the module "@enclave-e3/contracts/deploy/enclave" provides a default export (func) in packages/enclave-contracts/deploy/enclave.ts (line 119).


35-43: Deployment artifact names verified unchanged
The IDs “Enclave”, “CiphernodeRegistryOwnable”, and “NaiveRegistryFilter” in templates/default/scripts/deploy-local.ts match the names used in packages/enclave-contracts/deploy/enclave.ts.

crates/wasm/README.md (2)

15-16: LGTM: import path updated to @enclave-e3/wasm.

Matches the new org/scope.


22-24: LGTM: submodule init usage is correct.

Using @enclave-e3/wasm/init for universal loading is aligned with the exports map.

crates/wasm/package.json (1)

2-5: LGTM: package rename and version bump match the org migration.

Name and version are set for publishing under the new scope.

packages/enclave-config/package.json (1)

2-5: LGTM: scope and version updated.

No issues spotted.

examples/CRISP/remappings.txt (1)

5-5: Remapping approved – examples/CRISP/package.json includes the @enclave-e3/contracts dependency.

packages/enclave-sdk/src/types.ts (1)

9-14: Import path is correct; no change needed.
@enclave-e3/contracts publishes a ./types export (pointing to dist/types/index.*) and contains no typechain-types directory, so importing from "@enclave-e3/contracts/types" is valid.

Likely an incorrect or invalid review comment.

crates/Dockerfile (1)

8-8: Contracts package path updated—good.

COPY now targets packages/enclave-contracts, consistent with the repo rename.

crates/init/src/lib.rs (3)

53-60: Path update to enclave-contracts looks correct.

Reading the version from packages/enclave-contracts/package.json aligns with the rename.


27-31: Template repo/org still points to gnosisguild.

If the repo is also moving orgs, update DEFAULT_TEMPLATE_URL accordingly; otherwise, this is fine for now.


193-203: Submodule source still under gnosisguild.

Confirm https://github.com/gnosisguild/risc0-ethereum remains the canonical location post-org migration. If it’s moving, update here.

packages/enclave-sdk/README.md (2)

86-102: Vite section aligns with wasm rename; good.

Excluding @enclave-e3/wasm looks correct given the bundling requirements.


163-176: Fix import sources for React hook and enum

Replace the incorrect contracts import with the React package and import the event enum directly from SDK:

-import { useEnclaveSDK } from '@enclave-e3/contracts/sdk';
+import { useEnclaveSDK } from '@enclave-e3/react';
+import { EnclaveEventType } from '@enclave-e3/sdk';
.github/workflows/releases.yml (2)

81-89: Validate release-plz version pin.

Confirm version: "0.3.83" remains valid. Pinning too old a version can break later. Consider moving to a maintained tag or parameterizing via repo-wide action input.


141-158: Binary release trigger looks good.

Dispatch payload wires version from Rust release job output as expected.

packages/enclave-react/package.json (2)

2-4: Rename/version bump LGTM.

Name change and test pre-version bump align with the org migration.


55-59: Repository metadata still points to gnosisguild.

If/when the repo moves, update the URL and directory to keep npm links accurate.

docs/pages/setting-up-server.mdx (3)

49-49: LGTM: SDK imports align with the new namespace.


95-96: LGTM: React hook import matches the package rename.


302-302: LGTM: SDKError import is correct.

packages/enclave-contracts/tsup.config.mjs (1)

1-1: No changes needed: baseConfig is correctly exported
The @enclave-e3/config/tsup subpath points to tsup.config.js, which contains export const baseConfig as expected.

pnpm-workspace.yaml (2)

9-9: LGTM: workspace now includes enclave-contracts.


1-12: No stale references found
The grep search returned no matches for packages/evm or @gnosis-guild scopes.

packages/enclave-react/tsconfig.json (1)

2-2: tsconfig extends path validated
Verified that packages/enclave-config/dom.tsconfig.json exists and no lingering @gnosis-guild extends references remain.

packages/enclave-sdk/tsconfig.json (1)

2-2: Confirm base config resolution Both packages/enclave-sdk/tsconfig.json and packages/enclave-contracts/tsconfig.json correctly extend @enclave-e3/config/tsconfig.json, the base config files exist under packages/enclave-config, and there are no remaining @gnosis-guild references.

templates/default/package.json (1)

19-20: Add missing CLI dependency
File: templates/default/package.json (around lines 19–20)

  • No workspace package declares an enclave bin entry, so predev:allenclave program compile will fail unless it’s global.
  • Confirm which package provides the enclave CLI (e.g. @enclave-e3/cli) and add it as a devDependency alongside @enclave-e3/contracts and @enclave-e3/sdk.
packages/enclave-contracts/tsconfig.json (1)

2-2: Verified Hardhat/ts-node compatibility: local tsconfig module=commonjs & moduleResolution=node

templates/default/client/package.json (1)

18-19: Scaffold CLI already rewrites workspace: for @enclave-e3/react and @enclave-e3/sdk*
Rewrite logic in crates/init/src/lib.rs (lines 95–101) replaces the "workspace:*" markers with the correct published semver ranges at scaffold time.

examples/CRISP/contracts/CRISPInputValidator.sol (1)

8-8: Import path migration LGTM

Path switched to @enclave-e3/contracts; no functional changes in this unit.

examples/CRISP/package.json (1)

25-25: Dependency rename LGTM; no stale references found
Verified—there are no remaining "@gnosis-guild/enclave" imports in the examples/CRISP directory.

packages/enclave-sdk/src/contract-client.ts (1)

18-18: Approve import path migration

All old @gnosis-guild/enclave imports have been removed; types now consistently come from @enclave-e3/contracts/types.

crates/evm/src/ciphernode_registry_sol.rs (1)

24-24: Artifact path and event presence confirmed: The artifact exists at the specified path and defines the CiphernodeAdded and CiphernodeRemoved events.

crates/evm/src/registry_filter_sol.rs (1)

154-163: Attach flow remains minimal (no reader/deploy block required) — consistent with past guidance.

Matches the learning that RegistryFilterSol attach does not require a repository reader or deploy block.

packages/enclave-sdk/src/enclave-sdk.ts (1)

21-23: Publish generated TypeChain types
Hardhat is configured to emit TypeChain output to packages/enclave-contracts/types, but that directory isn’t committed—ensure your build/publish process includes the types folder (with factories/contracts/CiphernodeRegistryOwnable__factory and factories/contracts/Enclave__factory, plus their ABIs) so @enclave-e3/contracts/types exports the expected factories and downstream consumers remain functional.

packages/enclave-react/tsup.config.js (1)

8-8: Exports for tsup entrypoint verified@enclave-e3/config’s package.json exports "./tsup": "./tsup.config.js", and tsup.config.js exports baseConfig.

templates/default/server/index.ts (1)

13-13: Import path migration looks correct.

@enclave-e3/sdk exports used here should remain compatible.

templates/default/tests/integration.spec.ts (1)

20-20: Import path migration looks correct.

RegistryEventType from @enclave-e3/sdk matches the SDK rename.

packages/enclave-sdk/tsup.config.js (1)

8-8: Config import validated — approve changes. Verified that packages/enclave-config’s package.json declares name "@enclave-e3/config" and exports "./tsup" → tsup.config.js, which defines and exports baseConfig. Ensure the config package is published before SDK.

examples/CRISP/contracts/CRISPProgram.sol (1)

10-13: Remapping for @enclave-e3/contracts confirmed in examples/CRISP/remappings.txt:5. Foundry auto-loads this file, so your imports will resolve in CI.

packages/enclave-contracts/artifacts/contracts/interfaces/IEnclave.sol/IEnclave.json (1)

588-591: ABI tuple internalType renamed to IEnclave.E3RequestParams — verify codegen consumers

Artifact packages/enclave-contracts/artifacts/contracts/interfaces/IEnclave.sol/IEnclave.json now uses internalType "struct IEnclave.E3RequestParams". Repo search shows no in-repo references to "RequestParams"/"E3RequestParams" (only runtime enclave.request(...) calls), but regenerate/update TypeScript (TypeChain), Rust (sol!)/bindings, and any custom ABI parsers or SDK typings that rely on ABI.internalType.

crates/evm/src/enclave_sol_writer.rs (1)

25-29: ABI artifact verified
publishPlaintextOutput and struct IEnclave.E3RequestParams are present in packages/enclave-contracts/artifacts/contracts/interfaces/IEnclave.sol/IEnclave.json; no further action needed.

packages/enclave-react/src/useEnclaveSDK.ts (2)

7-18: Import namespace migration to @enclave-e3/sdk looks good.

Matches the org/package rename; types and EnclaveSDK usage remain consistent.


56-59: Docs example updated to @enclave-e3/react — good catch.

Prevents copy/paste errors for consumers.

packages/enclave-react/src/index.ts (2)

8-8: Package header updated to new scope — ok.


16-33: Re-exports now sourced from @enclave-e3/sdk — consistent with the migration.

No API surface changes apparent.

templates/default/client/src/pages/WizardSDK.tsx (1)

17-28: SDK/react import path updates are correct.

Aligns the template with the new published scopes.

.github/workflows/ci.yml (2)

285-286: Artifact verification path switched to enclave-contracts — OK.

Keeps downstream jobs looking in the right place.


594-595: Template job artifact path updated — OK.

Mirrors the earlier upload step.

packages/enclave-contracts/package.json (3)

45-45: Dev config package switch LGTM.

Moving to @enclave-e3/config aligns with the org migration.


134-137: Verified removal of WASM dependency — no imports of @gnosis-guild/e3-wasm or @enclave-e3/wasm remain in packages/enclave-contracts.


2-5: Scope rename complete—no lingering @gnosis-guild/enclave references detected.

packages/enclave-sdk/package.json (1)

2-5: Package rename and version bump LGTM.

Name, version, and privacy settings align with the new scope.

package.json (1)

12-41: Issue linkage mismatch with #584.

Linked issue maps to @gnosis-guild/* targets, while this PR moves to @enclave-e3/*. Consider updating/closing #584 with a note that it’s superseded by this org migration.

.changeset/lazy-llamas-arrive.md (2)

1-7: Changeset frontmatter looks valid.

YAML delimiters and package→bump mappings follow the Changesets format.


2-6: All affected @enclave-e3 packages are included and inter-package ranges align; no lingering @gnosis-guild deps or additional publishable packages need bump.

Comment thread .changeset/pre.json Outdated
Comment thread .changeset/pre.json Outdated
Comment thread crates/Dockerfile
Comment thread crates/evm/src/enclave_sol_reader.rs
Comment thread crates/evm/src/registry_filter_sol.rs
Comment thread packages/enclave-react/README.md
Comment thread packages/enclave-sdk/CHANGELOG.md
Comment thread run_nodes.sh Outdated
Comment thread run_nodes.sh Outdated
Comment thread templates/default/contracts/MyProgram.sol

@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

♻️ Duplicate comments (1)
packages/enclave-sdk/CHANGELOG.md (1)

3-3: Sync CHANGELOG header with package.json (likely mismatch).

Previous review already flagged this; echoing to avoid publish/tag confusion.

Run to verify and fail on mismatch:

#!/bin/bash
set -Eeuo pipefail
pkg="packages/enclave-sdk/package.json"
chg="packages/enclave-sdk/CHANGELOG.md"
pkg_ver="$(jq -r '.version' "$pkg")"
chg_ver="$(grep -m1 -E '^##\s+[0-9A-Za-z.+-]+' "$chg" | sed -E 's/^##\s+//')"
printf 'package.json: %s\nCHANGELOG.md: %s\n' "$pkg_ver" "$chg_ver"
test "$pkg_ver" = "$chg_ver" || { echo "Mismatch between package.json and CHANGELOG"; exit 1; }

If package.json is 0.0.7-test, apply:

-## 0.0.6-test.0
+## 0.0.7-test
🧹 Nitpick comments (8)
examples/CRISP/package.json (1)

1-4: Mark example package as private to avoid accidental publish

Add "private": true to this example package.

Apply this diff:

 {
   "name": "crisp",
   "version": "0.0.0",
+  "private": true,
   "description": "CRISP - Coercion-Resistant Impartial Selection Protocol",
packages/enclave-react/CHANGELOG.md (2)

7-7: Clarify wording of migration note.

Be explicit about the target org.

-- Migrate npm org
+- Migrate to @enclave-e3 org

8-9: Ensure dependency updates are complete.

If @enclave-e3/config also changed (as in package.json), list it here.

 - Updated dependencies
   - @enclave-e3/sdk@0.0.6-test.0
+  - @enclave-e3/config@<matching-version>
docs/pages/write-e3-contract.mdx (2)

47-47: Update link target to avoid 404 after rename; improve link text

The permalink uses a commit SHA that may predate the path rename to packages/enclave-contracts. Prefer main to keep the path valid post-merge, and use a clearer link label.

-[mockup](https://github.com/gnosisguild/enclave/blob/cf50fd6c10f0df8f03eecfd19cedc17b051e72a6/packages/enclave-contracts/contracts/test/MockE3Program.sol#L9)
+[MockE3Program example](https://github.com/gnosisguild/enclave/blob/main/packages/enclave-contracts/contracts/test/MockE3Program.sol#L9)

83-83: Confirm published package path and add a short note about availability

Import path looks correct for the new scope, but please verify that @enclave-e3/contracts exposes interfaces.sol at this location when published. Given the PR note about templates failing until publish, consider adding a one-line note below the snippet indicating the minimum version or that the package is required to be published before this import works.

I can draft the short availability note and adjust once the package version is known.

examples/CRISP/CHANGELOG.md (1)

3-6: Optional: include a release date if your changelog style uses dates.
If your convention includes dates, append one to the version heading for quick scanning.

Example diff:

-## 0.0.1-test.0
+## 0.0.1-test.0 - 2025-09-02
packages/enclave-sdk/CHANGELOG.md (1)

7-8: Tighten wording for clarity.

Spell out the scope to reduce ambiguity in release notes.

-- Migrate npm org
+- Migrate npm organization scope to @enclave-e3
templates/default/hardhat.config.ts (1)

54-55: Resolve artifacts path via require.resolve for pnpm/Yarn PnP robustness.

Avoid hard-coding node_modules paths; resolve from the package root.

Apply:

   external: {
     contracts: [
       {
-        artifacts: "node_modules/@enclave-e3/contracts/artifacts",
+        artifacts: contractsArtifacts,
       },
     ],
   },

Add near the top of this file (outside the changed hunk):

import path from "node:path";

// resolve artifacts dir from the installed package (works with pnpm/Yarn PnP/hoisting)
const contractsArtifacts = path.join(
  path.dirname(require.resolve("@enclave-e3/contracts/package.json")),
  "artifacts",
);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 696f234 and add1a3a.

⛔ Files ignored due to path filters (3)
  • Cargo.lock is excluded by !**/*.lock
  • packages/enclave-contracts/test/fixtures/pubkey.bin is excluded by !**/*.bin
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (67)
  • .changeset/lazy-llamas-arrive.md (1 hunks)
  • .changeset/pre.json (1 hunks)
  • .github/workflows/ci.yml (3 hunks)
  • .github/workflows/ec2-deployment.yml (1 hunks)
  • .github/workflows/releases.yml (2 hunks)
  • crates/Dockerfile (2 hunks)
  • crates/entrypoint/build.rs (2 hunks)
  • crates/evm/src/ciphernode_registry_sol.rs (1 hunks)
  • crates/evm/src/enclave_sol_reader.rs (1 hunks)
  • crates/evm/src/enclave_sol_writer.rs (1 hunks)
  • crates/evm/src/registry_filter_sol.rs (1 hunks)
  • crates/init/src/lib.rs (2 hunks)
  • crates/wasm/CHANGELOG.md (1 hunks)
  • crates/wasm/README.md (1 hunks)
  • crates/wasm/package.json (1 hunks)
  • deploy/local/contracts.sh (1 hunks)
  • deploy/local/start.sh (1 hunks)
  • docs/pages/CRISP/setup.mdx (2 hunks)
  • docs/pages/setting-up-server.mdx (5 hunks)
  • docs/pages/write-e3-contract.mdx (2 hunks)
  • examples/CRISP/CHANGELOG.md (1 hunks)
  • examples/CRISP/Readme.md (1 hunks)
  • examples/CRISP/contracts/CRISPInputValidator.sol (1 hunks)
  • examples/CRISP/contracts/CRISPProgram.sol (1 hunks)
  • examples/CRISP/deploy/Deploy.s.sol (1 hunks)
  • examples/CRISP/docker-compose.yaml (1 hunks)
  • examples/CRISP/package.json (1 hunks)
  • examples/CRISP/remappings.txt (1 hunks)
  • examples/CRISP/scripts/build.sh (1 hunks)
  • examples/CRISP/scripts/evm_deploy.sh (1 hunks)
  • examples/CRISP/scripts/setup.sh (1 hunks)
  • package.json (2 hunks)
  • packages/enclave-config/CHANGELOG.md (1 hunks)
  • packages/enclave-config/package.json (1 hunks)
  • packages/enclave-contracts/README.md (1 hunks)
  • packages/enclave-contracts/artifacts/contracts/interfaces/IEnclave.sol/IEnclave.json (1 hunks)
  • packages/enclave-contracts/package.json (2 hunks)
  • packages/enclave-contracts/tsconfig.json (1 hunks)
  • packages/enclave-contracts/tsup.config.mjs (1 hunks)
  • packages/enclave-react/CHANGELOG.md (1 hunks)
  • packages/enclave-react/README.md (2 hunks)
  • packages/enclave-react/package.json (2 hunks)
  • packages/enclave-react/src/index.ts (2 hunks)
  • packages/enclave-react/src/useEnclaveSDK.ts (2 hunks)
  • packages/enclave-react/tsconfig.json (1 hunks)
  • packages/enclave-react/tsup.config.js (1 hunks)
  • packages/enclave-sdk/CHANGELOG.md (1 hunks)
  • packages/enclave-sdk/README.md (8 hunks)
  • packages/enclave-sdk/package.json (3 hunks)
  • packages/enclave-sdk/src/contract-client.ts (1 hunks)
  • packages/enclave-sdk/src/enclave-sdk.ts (1 hunks)
  • packages/enclave-sdk/src/types.ts (1 hunks)
  • packages/enclave-sdk/src/wasm.ts (1 hunks)
  • packages/enclave-sdk/tsconfig.json (1 hunks)
  • packages/enclave-sdk/tsup.config.js (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
  • templates/default/client/package.json (1 hunks)
  • templates/default/client/src/pages/WizardSDK.tsx (2 hunks)
  • templates/default/client/vite.config.ts (1 hunks)
  • templates/default/contracts/InputValidator.sol (1 hunks)
  • templates/default/contracts/MyProgram.sol (1 hunks)
  • templates/default/deploy/enclave.ts (1 hunks)
  • templates/default/hardhat.config.ts (2 hunks)
  • templates/default/package.json (1 hunks)
  • templates/default/scripts/deploy-local.ts (1 hunks)
  • templates/default/server/index.ts (1 hunks)
  • templates/default/tests/integration.spec.ts (1 hunks)
✅ Files skipped from review due to trivial changes (5)
  • packages/enclave-config/CHANGELOG.md
  • .changeset/lazy-llamas-arrive.md
  • crates/evm/src/registry_filter_sol.rs
  • crates/wasm/CHANGELOG.md
  • crates/wasm/README.md
🚧 Files skipped from review as they are similar to previous changes (55)
  • templates/default/deploy/enclave.ts
  • examples/CRISP/docker-compose.yaml
  • packages/enclave-sdk/tsconfig.json
  • deploy/local/start.sh
  • packages/enclave-sdk/tsup.config.js
  • templates/default/package.json
  • crates/evm/src/enclave_sol_writer.rs
  • examples/CRISP/scripts/build.sh
  • crates/entrypoint/build.rs
  • templates/default/client/vite.config.ts
  • examples/CRISP/contracts/CRISPInputValidator.sol
  • packages/enclave-config/package.json
  • packages/enclave-contracts/tsconfig.json
  • examples/CRISP/Readme.md
  • packages/enclave-contracts/README.md
  • packages/enclave-contracts/artifacts/contracts/interfaces/IEnclave.sol/IEnclave.json
  • packages/enclave-sdk/src/wasm.ts
  • packages/enclave-sdk/src/contract-client.ts
  • examples/CRISP/deploy/Deploy.s.sol
  • packages/enclave-sdk/src/enclave-sdk.ts
  • deploy/local/contracts.sh
  • crates/evm/src/ciphernode_registry_sol.rs
  • templates/default/client/src/pages/WizardSDK.tsx
  • packages/enclave-react/tsup.config.js
  • packages/enclave-react/package.json
  • examples/CRISP/scripts/evm_deploy.sh
  • packages/enclave-sdk/src/types.ts
  • crates/wasm/package.json
  • .github/workflows/ci.yml
  • packages/enclave-sdk/README.md
  • examples/CRISP/contracts/CRISPProgram.sol
  • packages/enclave-sdk/package.json
  • packages/enclave-react/src/index.ts
  • docs/pages/CRISP/setup.mdx
  • templates/default/tests/integration.spec.ts
  • packages/enclave-contracts/tsup.config.mjs
  • templates/default/server/index.ts
  • crates/evm/src/enclave_sol_reader.rs
  • package.json
  • packages/enclave-contracts/package.json
  • packages/enclave-react/tsconfig.json
  • examples/CRISP/scripts/setup.sh
  • crates/init/src/lib.rs
  • templates/default/client/package.json
  • examples/CRISP/remappings.txt
  • .changeset/pre.json
  • crates/Dockerfile
  • packages/enclave-react/src/useEnclaveSDK.ts
  • templates/default/contracts/InputValidator.sol
  • .github/workflows/releases.yml
  • docs/pages/setting-up-server.mdx
  • packages/enclave-react/README.md
  • .github/workflows/ec2-deployment.yml
  • pnpm-workspace.yaml
  • templates/default/contracts/MyProgram.sol
🧰 Additional context used
🪛 LanguageTool
examples/CRISP/CHANGELOG.md

[grammar] ~8-~8: There might be a mistake here.
Context: ...s - @enclave-e3/contracts@0.0.6-test.0

(QB_NEW_EN)

docs/pages/write-e3-contract.mdx

[grammar] ~47-~47: There might be a mistake here.
Context: ...cts/contracts/test/MockE3Program.sol#L9) or check out the [demo implementation fo...

(QB_NEW_EN)

packages/enclave-react/CHANGELOG.md

[grammar] ~9-~9: There might be a mistake here.
Context: ...dencies - @enclave-e3/sdk@0.0.6-test.0

(QB_NEW_EN)

packages/enclave-sdk/CHANGELOG.md

[grammar] ~9-~9: There might be a mistake here.
Context: ...s - @enclave-e3/contracts@0.0.6-test.0 - @enclave-e3/wasm@0.0.6-test.0

(QB_NEW_EN)


[grammar] ~10-~10: There might be a mistake here.
Context: ...test.0 - @enclave-e3/wasm@0.0.6-test.0

(QB_NEW_EN)

⏰ 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). (3)
  • GitHub Check: rust_unit
  • GitHub Check: build_enclave_cli
  • GitHub Check: Build & Push Image
🔇 Additional comments (9)
examples/CRISP/package.json (2)

26-26: Dependency scope migration looks correct

Switching to "@enclave-e3/contracts" with "workspace:*" aligns with the repo-wide namespace change and will link locally in the monorepo.


5-9: Verify repository/author metadata reflects the intended org

If the GitHub org is also migrating, update "repository" and "author.url/name" accordingly. If not, ignore.

packages/enclave-react/CHANGELOG.md (1)

3-3: Version mismatch with package.json?

Confirm the intended version. If package.json is at 0.0.7-test, align the changelog header.

-## 0.0.6-test.0
+## 0.0.7-test
examples/CRISP/CHANGELOG.md (2)

1-1: Header looks correct for a Changesets-generated changelog.
Matches package name style; no action needed.


7-8: Changelog entry content LGTM.
Dependency bump reflects the repo-wide org migration; no further edits needed.

templates/default/hardhat.config.ts (2)

9-9: Import scope/org migration looks correct.

Side-effect import switched to @enclave-e3/contracts and aligns with the repo-wide rename.


9-9: Dependency and artifacts check passed.
templates/default/package.json already declares “@enclave-e3/contracts” and packages/enclave-contracts/artifacts/ is present; no further action required.

templates/default/scripts/deploy-local.ts (2)

12-12: Import path migration looks good.

Assuming the package exports a default deploy function at this path, this is consistent with the new scope.


12-12: No changes needed: default export and expected contract deployments are intact. Verified default export of deploy/enclave.ts and deployment of Enclave, CiphernodeRegistryOwnable, and NaiveRegistryFilter.

Comment thread examples/CRISP/CHANGELOG.md
Comment thread packages/enclave-sdk/CHANGELOG.md

@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: 6

Caution

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

⚠️ Outside diff range comments (2)
templates/default/client/src/pages/WizardSDK.tsx (2)

794-808: Update encryption calls to new SDK API

bfvVerifiableEncryptNumber is removed with the org migration. encryptNumber now returns a Uint8Array (ciphertext), not an object with encryptedVote. Adjust calls and publishing.

Apply this diff:

-      // Encrypt both inputs
-      const encryptedInput1 = await bfvVerifiableEncryptNumber(num1, publicKeyBytes)
-      const encryptedInput2 = await bfvVerifiableEncryptNumber(num2, publicKeyBytes)
-
-      if (!encryptedInput1 || !encryptedInput2) {
-        throw new Error('Failed to encrypt inputs')
-      }
-
-      // Publish first input
-      await publishInput(e3State.id, `0x${Array.from(encryptedInput1.encryptedVote, (b) => b.toString(16).padStart(2, '0')).join('')}` as `0x${string}`)
-
-      // Publish second input
-      const hash2 = await publishInput(
-        e3State.id,
-        `0x${Array.from(encryptedInput2.encryptedVote, (b) => b.toString(16).padStart(2, '0')).join('')}` as `0x${string}`,
-      )
+      // Encrypt both inputs
+      const encryptedInput1 = await encryptNumber(num1, publicKeyBytes)
+      const encryptedInput2 = await encryptNumber(num2, publicKeyBytes)
+
+      // Publish inputs
+      await publishInput(e3State.id, bytesToHex(encryptedInput1) as `0x${string}`)
+      const hash2 = await publishInput(e3State.id, bytesToHex(encryptedInput2) as `0x${string}`)

1-985: Resolve merge conflict and update encryption API usage

  • In templates/default/client/src/pages/WizardSDK.tsx lines 25–32, remove the <<<<<<<, =======, and >>>>>>> markers and choose the new import from @enclave-e3/sdk.
  • Replace the bfvVerifiableEncryptNumber import/usage with encryptNumber, ensuring the function name and package match.
  • Verify that no lingering @gnosis-guild/enclave-sdk or bfvVerifiableEncryptNumber references remain.
♻️ Duplicate comments (3)
packages/enclave-sdk/CHANGELOG.md (2)

3-3: Sync CHANGELOG header with package.json version.

Header shows 0.0.6-test.0, but package.json appears to be 0.0.7-test per earlier review. Align to avoid confusing publish/tag outputs.

Apply if package.json indeed has 0.0.7-test:

-## 0.0.6-test.0
+## 0.0.7-test

Run to verify and fail CI on mismatch:

#!/bin/bash
set -Eeuo pipefail
pkg="packages/enclave-sdk/package.json"
chg="packages/enclave-sdk/CHANGELOG.md"
pkg_ver="$(jq -r '.version' "$pkg")"
chg_ver="$(grep -m1 -E '^##\s+[0-9]+' "$chg" | sed -E 's/^##\s+//')"
echo "package.json: $pkg_ver"
echo "CHANGELOG.md: $chg_ver"
test "$pkg_ver" = "$chg_ver" || { echo "Mismatch between package.json and CHANGELOG"; exit 1; }

9-10: Fix dependency versions to match pre.json/publish plan.

Remove the trailing “.0” so these reflect 0.0.6-test (as noted previously).

-  - @enclave-e3/contracts@0.0.6-test.0
-  - @enclave-e3/wasm@0.0.6-test.0
+  - @enclave-e3/contracts@0.0.6-test
+  - @enclave-e3/wasm@0.0.6-test

Verify against .changeset/pre.json:

#!/bin/bash
set -Eeuo pipefail
chg="packages/enclave-sdk/CHANGELOG.md"
pre=".changeset/pre.json"
jq -r '.initialVersions | .["@enclave-e3/contracts"], .["@enclave-e3/wasm"]' "$pre"
grep -E '^\s+-\s+@enclave-e3/(contracts|wasm)@' "$chg"
examples/CRISP/CHANGELOG.md (1)

7-8: Pin the example’s dependency instead of workspace reference.

This mirrors a prior comment: switch "@enclave-e3/contracts": "workspace:*" to "^0.0.6-test.0" in examples/CRISP/package.json so the example reflects the released contract lib.

#!/bin/bash
set -e
jq -r '.dependencies["@enclave-e3/contracts"] // .devDependencies["@enclave-e3/contracts"]' examples/CRISP/package.json
# Expect: ^0.0.6-test.0 or 0.0.6-test.0
🧹 Nitpick comments (16)
packages/enclave-sdk/CHANGELOG.md (1)

7-8: Tighten wording for clarity.

-- Migrate npm org
+- Migrate to @enclave-e3 org
examples/CRISP/CHANGELOG.md (1)

1-1: Capitalize the package header for consistency.

Use "CRISP" to match the example folder/name.

-# crisp
+# CRISP
examples/CRISP/scripts/evm_deploy.sh (3)

5-8: Avoid fragile relative cd; leverage pnpm workspace filter.

This makes the script resilient to invocation dir and the new package scope, and removes path-coupling.

Apply:

-wait-on tcp:8545 && \
-  (cd ../../packages/enclave-contracts && \
-    rm -rf deployments/localhost && \
-    pnpm deploy:mocks --network localhost)
+pnpm dlx wait-on tcp:8545 && \
+pnpm -w -F @enclave-e3/contracts exec bash -lc 'rm -rf deployments/localhost && pnpm run deploy:mocks --network localhost'

5-5: Ensure wait-on availability.

If wait-on isn’t globally installed, prefer pnpm dlx (or npx) for portability.

Example already shown in the previous diff.


5-8: Parameterize RPC endpoint.

Consider HOST/PORT envs to ease local variations without editing the script.

-wait-on tcp:8545 && \
+RPC_HOST="${RPC_HOST:-127.0.0.1}"
+RPC_PORT="${RPC_PORT:-8545}"
+pnpm dlx wait-on "tcp:${RPC_HOST}:${RPC_PORT}" && \
packages/enclave-react/CHANGELOG.md (2)

1-4: Add release date and PR reference for traceability.

Including the date and PR/issue links makes the entry auditable.

-## 0.0.6-test.0
+## 0.0.6-test.0 - 2025-09-02
+
+Refs: PR #673, Issue #584

7-9: Tighten wording and fix minor grammar.

Clarify scope change and make “Updated dependencies” read as a proper lead-in.

-- Migrate npm org
-- Updated dependencies
-  - @enclave-e3/sdk@0.0.6-test.0
+- Migrate package scope to `@enclave-e3`
+- Updated dependencies:
+  - `@enclave-e3/sdk@0.0.6-test.0`
examples/CRISP/client/package.json (1)

6-11: Confirm author/homepage reflect the new org branding.

If CRISP moved with the rebrand, update these fields to the new org to avoid mixed attribution.

templates/default/client/src/pages/WizardSDK.tsx (2)

10-11: Import bytesToHex for cleaner ciphertext publishing

You’re converting bytes to hex manually later. Prefer viem’s bytesToHex.

Apply this diff:

-import { hexToBytes } from 'viem'
+import { hexToBytes, bytesToHex } from 'viem'

738-739: Optional: use parseEther for clarity

Hardcoding wei is brittle. parseEther("0.001") is clearer.

Apply this diff and add parseEther to the viem import:

-        value: BigInt('1000000000000000'), // 0.001 ETH
+        value: parseEther('0.001'),

Additional import change:

-import { hexToBytes, bytesToHex } from 'viem'
+import { hexToBytes, bytesToHex, parseEther } from 'viem'
packages/enclave-sdk/src/enclave-sdk.ts (5)

118-119: Avoid re-initializing WASM on every call; cache initializeWasm().

Initialize once and reuse to cut latency and redundant work.

Apply within these ranges:

-    await initializeWasm();
+    await ensureWasm();

Add near the imports:

let wasmReady: Promise<void> | undefined;
async function ensureWasm() {
  wasmReady ??= initializeWasm();
  await wasmReady;
}

Also applies to: 146-147


88-90: Unify error handling for unsupported protocol (SDKError or exhaustive switch).

Use SDKError (with a code) or an exhaustive check to make this fail-fast and consistent.

-          throw new Error("Protocol not supported")
+          throw new SDKError("Protocol not supported", "UNSUPPORTED_PROTOCOL")

Alternative: enforce exhaustiveness

const assertNever = (x: never): never => { throw new SDKError(`Unsupported protocol: ${x}`, "UNSUPPORTED_PROTOCOL"); };

Also applies to: 129-131, 165-167


184-184: Remove stray debug log.

Leaking console noise in lib code.

-    console.log(">>> REQUEST");

157-159: Delete stale commented code or document why it’s needed.

The // inputs.params = defaultParams; comment is confusing after removing defaultParams import. Either remove or add a brief note on where params come from now.

-        // inputs.params = defaultParams;

385-387: Narrow return type for waitForTransaction.

Promise weakens consumers. Prefer the concrete viem receipt type used by ContractClient.waitForTransaction.

-  public async waitForTransaction(hash: Hash): Promise<unknown> {
+  public async waitForTransaction(hash: Hash): Promise<ReturnType<typeof this['contractClient']['waitForTransaction']> extends Promise<infer R> ? R : never> {

Or export a Receipt type from ContractClient and reference it here.

templates/default/scripts/deploy-local.ts (1)

8-9: Remove unused types and avoid mixing import/require

Minor cleanup and better typings by importing the typed HRE directly.

-import { DeployFunction } from "hardhat-deploy/types";
-import { HardhatRuntimeEnvironment } from "hardhat/types";
+import hre from "hardhat";
@@
-  const hre = require("hardhat");
+  // Using typed HRE import; no require needed

Also applies to: 18-18

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between add1a3a and 1bc6c00.

⛔ Files ignored due to path filters (3)
  • Cargo.lock is excluded by !**/*.lock
  • packages/enclave-contracts/test/fixtures/pubkey.bin is excluded by !**/*.bin
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (66)
  • .changeset/lazy-llamas-arrive.md (1 hunks)
  • .changeset/pre.json (1 hunks)
  • .github/workflows/ci.yml (3 hunks)
  • .github/workflows/ec2-deployment.yml (1 hunks)
  • .github/workflows/releases.yml (2 hunks)
  • crates/Dockerfile (2 hunks)
  • crates/entrypoint/build.rs (2 hunks)
  • crates/evm/src/ciphernode_registry_sol.rs (1 hunks)
  • crates/evm/src/enclave_sol_reader.rs (1 hunks)
  • crates/evm/src/enclave_sol_writer.rs (1 hunks)
  • crates/evm/src/registry_filter_sol.rs (1 hunks)
  • crates/init/src/lib.rs (2 hunks)
  • crates/wasm/CHANGELOG.md (1 hunks)
  • crates/wasm/README.md (1 hunks)
  • crates/wasm/package.json (1 hunks)
  • deploy/local/contracts.sh (1 hunks)
  • deploy/local/start.sh (1 hunks)
  • docs/pages/CRISP/setup.mdx (2 hunks)
  • docs/pages/setting-up-server.mdx (5 hunks)
  • docs/pages/write-e3-contract.mdx (2 hunks)
  • examples/CRISP/CHANGELOG.md (1 hunks)
  • examples/CRISP/Readme.md (1 hunks)
  • examples/CRISP/client/package.json (1 hunks)
  • examples/CRISP/contracts/CRISPInputValidator.sol (1 hunks)
  • examples/CRISP/contracts/CRISPProgram.sol (1 hunks)
  • examples/CRISP/deploy/Deploy.s.sol (1 hunks)
  • examples/CRISP/docker-compose.yaml (1 hunks)
  • examples/CRISP/package.json (1 hunks)
  • examples/CRISP/remappings.txt (1 hunks)
  • examples/CRISP/scripts/build.sh (1 hunks)
  • examples/CRISP/scripts/evm_deploy.sh (1 hunks)
  • examples/CRISP/scripts/setup.sh (1 hunks)
  • package.json (2 hunks)
  • packages/enclave-config/CHANGELOG.md (1 hunks)
  • packages/enclave-config/package.json (1 hunks)
  • packages/enclave-contracts/README.md (1 hunks)
  • packages/enclave-contracts/package.json (3 hunks)
  • packages/enclave-contracts/tsconfig.json (1 hunks)
  • packages/enclave-contracts/tsup.config.mjs (1 hunks)
  • packages/enclave-react/CHANGELOG.md (1 hunks)
  • packages/enclave-react/README.md (2 hunks)
  • packages/enclave-react/package.json (2 hunks)
  • packages/enclave-react/src/index.ts (2 hunks)
  • packages/enclave-react/src/useEnclaveSDK.ts (2 hunks)
  • packages/enclave-react/tsconfig.json (1 hunks)
  • packages/enclave-react/tsup.config.js (1 hunks)
  • packages/enclave-sdk/CHANGELOG.md (1 hunks)
  • packages/enclave-sdk/README.md (8 hunks)
  • packages/enclave-sdk/package.json (4 hunks)
  • packages/enclave-sdk/src/contract-client.ts (1 hunks)
  • packages/enclave-sdk/src/enclave-sdk.ts (2 hunks)
  • packages/enclave-sdk/src/types.ts (1 hunks)
  • packages/enclave-sdk/tsconfig.json (1 hunks)
  • packages/enclave-sdk/tsup.config.js (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
  • templates/default/client/package.json (1 hunks)
  • templates/default/client/src/pages/WizardSDK.tsx (1 hunks)
  • templates/default/client/vite.config.ts (1 hunks)
  • templates/default/contracts/InputValidator.sol (1 hunks)
  • templates/default/contracts/MyProgram.sol (1 hunks)
  • templates/default/deploy/enclave.ts (1 hunks)
  • templates/default/hardhat.config.ts (2 hunks)
  • templates/default/package.json (1 hunks)
  • templates/default/scripts/deploy-local.ts (1 hunks)
  • templates/default/server/index.ts (1 hunks)
  • templates/default/tests/integration.spec.ts (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • .changeset/pre.json
  • crates/wasm/README.md
🚧 Files skipped from review as they are similar to previous changes (55)
  • packages/enclave-contracts/tsconfig.json
  • crates/wasm/CHANGELOG.md
  • packages/enclave-contracts/README.md
  • templates/default/package.json
  • .changeset/lazy-llamas-arrive.md
  • templates/default/client/vite.config.ts
  • examples/CRISP/scripts/setup.sh
  • packages/enclave-sdk/tsconfig.json
  • packages/enclave-react/tsconfig.json
  • packages/enclave-sdk/src/contract-client.ts
  • packages/enclave-react/package.json
  • templates/default/hardhat.config.ts
  • packages/enclave-contracts/tsup.config.mjs
  • templates/default/contracts/InputValidator.sol
  • examples/CRISP/contracts/CRISPInputValidator.sol
  • packages/enclave-config/package.json
  • deploy/local/start.sh
  • examples/CRISP/package.json
  • examples/CRISP/scripts/build.sh
  • crates/evm/src/ciphernode_registry_sol.rs
  • packages/enclave-config/CHANGELOG.md
  • examples/CRISP/Readme.md
  • packages/enclave-react/tsup.config.js
  • crates/evm/src/enclave_sol_writer.rs
  • examples/CRISP/deploy/Deploy.s.sol
  • crates/evm/src/enclave_sol_reader.rs
  • examples/CRISP/remappings.txt
  • packages/enclave-contracts/package.json
  • .github/workflows/ci.yml
  • examples/CRISP/docker-compose.yaml
  • docs/pages/CRISP/setup.mdx
  • .github/workflows/ec2-deployment.yml
  • packages/enclave-sdk/src/types.ts
  • packages/enclave-react/src/useEnclaveSDK.ts
  • crates/init/src/lib.rs
  • crates/evm/src/registry_filter_sol.rs
  • crates/Dockerfile
  • crates/wasm/package.json
  • examples/CRISP/contracts/CRISPProgram.sol
  • deploy/local/contracts.sh
  • packages/enclave-sdk/README.md
  • crates/entrypoint/build.rs
  • packages/enclave-react/README.md
  • templates/default/server/index.ts
  • docs/pages/setting-up-server.mdx
  • package.json
  • templates/default/client/package.json
  • packages/enclave-react/src/index.ts
  • templates/default/deploy/enclave.ts
  • packages/enclave-sdk/package.json
  • templates/default/contracts/MyProgram.sol
  • .github/workflows/releases.yml
  • templates/default/tests/integration.spec.ts
  • pnpm-workspace.yaml
  • packages/enclave-sdk/tsup.config.js
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-09-26T04:15:32.544Z
Learnt from: ryardley
PR: gnosisguild/enclave#107
File: tests/basic_integration/test.sh:81-83
Timestamp: 2024-09-26T04:15:32.544Z
Learning: In `tests/basic_integration/test.sh`, it's acceptable to wait indefinitely for the EVM node to start without a timeout, as it's unlikely to fail here.

Applied to files:

  • examples/CRISP/scripts/evm_deploy.sh
🧬 Code graph analysis (1)
templates/default/client/src/pages/WizardSDK.tsx (1)
packages/enclave-sdk/src/enclave-sdk.ts (1)
  • encryptNumber (118-132)
🪛 LanguageTool
docs/pages/write-e3-contract.mdx

[grammar] ~47-~47: There might be a mistake here.
Context: ...cts/contracts/test/MockE3Program.sol#L9) or check out the [demo implementation fo...

(QB_NEW_EN)

examples/CRISP/CHANGELOG.md

[grammar] ~8-~8: There might be a mistake here.
Context: ...s - @enclave-e3/contracts@0.0.6-test.0

(QB_NEW_EN)

packages/enclave-react/CHANGELOG.md

[grammar] ~9-~9: There might be a mistake here.
Context: ...dencies - @enclave-e3/sdk@0.0.6-test.0

(QB_NEW_EN)

packages/enclave-sdk/CHANGELOG.md

[grammar] ~9-~9: There might be a mistake here.
Context: ...s - @enclave-e3/contracts@0.0.6-test.0 - @enclave-e3/wasm@0.0.6-test.0

(QB_NEW_EN)


[grammar] ~10-~10: There might be a mistake here.
Context: ...test.0 - @enclave-e3/wasm@0.0.6-test.0

(QB_NEW_EN)

🪛 Biome (2.1.2)
templates/default/client/src/pages/WizardSDK.tsx

[error] 25-26: Expected an identifier but instead found '<<'.

Expected an identifier here.

(parse)


[error] 32-32: numbers cannot be followed by identifiers directly after

an identifier cannot appear here

(parse)

⏰ 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: rust_unit
  • GitHub Check: integration_prebuild
  • GitHub Check: build_sdk
  • GitHub Check: build_enclave_cli
  • GitHub Check: test_contracts
  • GitHub Check: test_net
  • GitHub Check: Build & Push Image
🔇 Additional comments (6)
examples/CRISP/scripts/evm_deploy.sh (1)

6-8: Rename alignment looks good.

Switching to packages/enclave-contracts matches the repo-wide rename and the subshell prevents cwd leakage.

packages/enclave-react/CHANGELOG.md (1)

1-9: Changelog entry matches the org migration—LGTM.

Entry is concise and aligns with the repo-wide scope move.

templates/default/client/src/pages/WizardSDK.tsx (1)

18-18: Import scope migration looks correct

@enclave-e3/react is the right target for useEnclaveSDK.

packages/enclave-sdk/src/enclave-sdk.ts (1)

19-19: Verify WASM and TypeChain exports

  • The “./init” subpath is already exported in @enclave-e3/wasm (package.json ✅)
  • Ensure the WASM binary actually exposes bfv_encrypt_number and bfv_verifiable_encrypt_number
  • Confirm @enclave-e3/contracts/types factories still define a static readonly abi
templates/default/scripts/deploy-local.ts (2)

12-12: Import path migrated — confirm export shape (default vs named) and ESM/CJS interop

Looks aligned with the org rebrand. Please verify that @enclave-e3/contracts/deploy/enclave publishes a default export compatible with your TS/Hardhat module settings. If it’s a named export, switch to:

-import deployEnclave from "@enclave-e3/contracts/deploy/enclave";
+import { deployEnclave } from "@enclave-e3/contracts/deploy/enclave";

Also confirm the deploy function signature remains deployEnclave(hre) to avoid runtime errors once the package is published.


35-43: Verify Hardhat-deploy artifact names post-rename

Ensure the deployment keys didn’t change with the contract package move. We’ve confirmed the contracts Enclave, CiphernodeRegistryOwnable and NaiveRegistryFilter still exist under packages/enclave-contracts. To test your local deploy, either run from the template directory or specify the config file:

cd templates/default
npx hardhat run --network hardhat scripts/deploy-local.ts

or

npx hardhat run \
  --config templates/default/hardhat.config.ts \
  --network hardhat \
  templates/default/scripts/deploy-local.ts

If a name mismatch occurs, list all registered deployments to debug:

const all = await hre.deployments.all();
console.log(Object.keys(all));

Comment thread docs/pages/write-e3-contract.mdx
Comment thread docs/pages/write-e3-contract.mdx
Comment thread examples/CRISP/CHANGELOG.md
Comment thread examples/CRISP/client/package.json Outdated
Comment thread packages/enclave-react/CHANGELOG.md
Comment thread templates/default/client/src/pages/WizardSDK.tsx Outdated
@vercel vercel Bot temporarily deployed to Preview – crisp September 3, 2025 15:21 Inactive
@vercel vercel Bot temporarily deployed to Preview – enclave-docs September 3, 2025 15:21 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: 0

♻️ Duplicate comments (1)
templates/default/client/src/pages/WizardSDK.tsx (1)

18-27: Merge conflict resolved and org-scope imports unified — LGTM

Imports are now consistently under @enclave-e3 and the conflict markers are gone. Nice cleanup.

🧹 Nitpick comments (2)
templates/default/client/src/pages/WizardSDK.tsx (2)

791-793: Guard sdk once and parallelize encryption

Avoid optional chaining on awaited calls; fail fast if sdk is unavailable and encrypt both inputs concurrently.

-      // Encrypt both inputs
-      const encryptedInput1 = await sdk?.encryptNumber(num1, publicKeyBytes)
-      const encryptedInput2 = await sdk?.encryptNumber(num2, publicKeyBytes)
-
-      if (!encryptedInput1 || !encryptedInput2) {
-        throw new Error('Failed to encrypt inputs')
-      }
+      // Encrypt both inputs
+      if (!sdk) {
+        throw new Error('SDK not initialized')
+      }
+      const [encryptedInput1, encryptedInput2] = await Promise.all([
+        sdk.encryptNumber(num1, publicKeyBytes),
+        sdk.encryptNumber(num2, publicKeyBytes),
+      ])

799-805: Use bytesToHex for serialization; drop manual hex concat and cast

Cleaner, faster, and typed as 0x${string} by viem.

-      await publishInput(e3State.id, `0x${Array.from(encryptedInput1, (b) => b.toString(16).padStart(2, '0')).join('')}` as `0x${string}`)
+      await publishInput(e3State.id, bytesToHex(encryptedInput1))

-        `0x${Array.from(encryptedInput2, (b) => b.toString(16).padStart(2, '0')).join('')}` as `0x${string}`,
+        bytesToHex(encryptedInput2),

Add the import:

-import { hexToBytes } from 'viem'
+import { hexToBytes, bytesToHex } from 'viem'
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 1bc6c00 and e207c9a.

📒 Files selected for processing (3)
  • templates/default/client/src/pages/WizardSDK.tsx (4 hunks)
  • templates/default/server/index.ts (1 hunks)
  • templates/default/tests/integration.spec.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • templates/default/server/index.ts
  • templates/default/tests/integration.spec.ts
🧰 Additional context used
🧬 Code graph analysis (1)
templates/default/client/src/pages/WizardSDK.tsx (3)
packages/enclave-sdk/src/index.ts (1)
  • FheProtocol (42-42)
examples/CRISP/client/libs/wasm/pkg/crisp_worker.js (1)
  • sdk (18-30)
packages/enclave-sdk/src/contract-client.ts (1)
  • publishInput (184-224)
⏰ 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 & Push Image
  • GitHub Check: integration_prebuild
  • GitHub Check: build_sdk
  • GitHub Check: test_net
  • GitHub Check: rust_unit
  • GitHub Check: test_contracts
  • GitHub Check: build_enclave_cli
🔇 Additional comments (2)
templates/default/client/src/pages/WizardSDK.tsx (2)

576-577: sdk exposure from hook — OK

Destructuring sdk here is fine and matches the updated API.


561-563: Confirmed hook config includes protocol: FheProtocol
The UseEnclaveSDKConfig type in packages/enclave-react/src/useEnclaveSDK.ts declares protocol: FheProtocol;—no further changes needed.

@vercel vercel Bot temporarily deployed to Preview – enclave-docs September 3, 2025 15:40 Inactive
@vercel vercel Bot temporarily deployed to Preview – enclave-docs September 3, 2025 21:38 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: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5c5d07c and df56d90.

📒 Files selected for processing (1)
  • examples/CRISP/client/vite.config.ts (2 hunks)
⏰ 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: integration_prebuild
  • GitHub Check: test_contracts
  • GitHub Check: test_net
  • GitHub Check: rust_unit
  • GitHub Check: Build & Push Image

Comment thread examples/CRISP/client/vite.config.ts Outdated
Comment thread examples/CRISP/client/vite.config.ts Outdated
Comment thread examples/CRISP/client/vite.config.ts Outdated
@vercel vercel Bot temporarily deployed to Preview – crisp September 4, 2025 10:02 Inactive
@vercel vercel Bot temporarily deployed to Preview – enclave-docs September 4, 2025 10:02 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

Caution

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

⚠️ Outside diff range comments (1)
packages/enclave-sdk/package.json (1)

40-50: Move test/bundler plugins out of runtime deps.
vitest, vite-plugin-top-level-await, and vite-plugin-wasm are build/test-time only; shipping them as runtime deps bloats consumers.

Apply:

   "devDependencies": {
     "@enclave-e3/config": "workspace:*",
     "concurrently": "^9.1.2",
     "tsup": "^8.5.0",
     "typescript": "5.8.3",
     "vite": "^6.2.0",
-    "vite-plugin-dts": "^4.5.3"
+    "vite-plugin-dts": "^4.5.3",
+    "vitest": "^1.6.1",
+    "vite-plugin-top-level-await": "^1.5.0",
+    "vite-plugin-wasm": "^3.4.1"
   },
   "dependencies": {
     "@aztec/bb.js": "^0.82.2",
     "@noir-lang/noir_js": "1.0.0-beta.3",
     "@enclave-e3/wasm": "^0.0.10-test",
     "@enclave-e3/contracts": "workspace:*",
-    "comlink": "^4.4.2",
-    "viem": "2.30.6",
-    "vite-plugin-top-level-await": "^1.5.0",
-    "vite-plugin-wasm": "^3.4.1",
-    "vitest": "^1.6.1",
-    "web-worker": "^1.5.0"
+    "comlink": "^4.4.2",
+    "viem": "2.30.6",
+    "web-worker": "^1.5.0"
   }
♻️ Duplicate comments (1)
packages/enclave-sdk/package.json (1)

29-29: Release script still won’t disable git checks.
Past feedback requested --no-git-checks; it’s still missing here.

Apply:

-    "release": "pnpm publish --access=public"
+    "release": "pnpm publish --access=public --no-git-checks"
🧹 Nitpick comments (2)
packages/enclave-sdk/package.json (2)

23-23: Avoid brittle cross-package cd; use pnpm workspace filtering.
Relative cd chains are fragile; run package scripts via workspace filters.

Use:

-    "prebuild": "cd ../enclave-contracts && pnpm compile:ts && cd ../../crates/wasm && pnpm build",
+    "prebuild": "pnpm -w --filter @enclave-e3/contracts run compile:ts && pnpm -w --filter @enclave-e3/wasm run build",

31-38: Consider removing unused dev dep and adding Node engine.

  • concurrently isn’t used in scripts here; drop it if unused.
  • Add engines.node to match Vite 6 requirements (Node ≥18).

Add near the top-level:

"engines": { "node": ">=18.0.0" }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9c47373 and 4a96c8a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (11)
  • .changeset/config.json (1 hunks)
  • crates/wasm/package.json (1 hunks)
  • docs/package.json (1 hunks)
  • examples/CRISP/client/package.json (1 hunks)
  • examples/CRISP/client/vite.config.ts (1 hunks)
  • examples/CRISP/package.json (1 hunks)
  • packages/enclave-config/package.json (1 hunks)
  • packages/enclave-contracts/package.json (3 hunks)
  • packages/enclave-react/package.json (2 hunks)
  • packages/enclave-sdk/package.json (4 hunks)
  • templates/default/package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (10)
  • docs/package.json
  • examples/CRISP/client/package.json
  • templates/default/package.json
  • .changeset/config.json
  • packages/enclave-config/package.json
  • examples/CRISP/package.json
  • examples/CRISP/client/vite.config.ts
  • packages/enclave-contracts/package.json
  • packages/enclave-react/package.json
  • crates/wasm/package.json
🔇 Additional comments (4)
packages/enclave-sdk/package.json (4)

2-3: Scope rename and version bump look correct.
Package identity matches the new org and versioning scheme.


19-21: publishConfig is valid.
Keeping only access: "public" is correct; no unsupported keys present.


32-32: Dev dependency scope update looks good.
Using workspace:* here is appropriate.


23-29: Ensure PR CI installs from the workspace root
CI jobs must run pnpm install at the monorepo root so that workspace:* dependencies in packages/enclave-sdk are linked locally rather than fetched from npm and failing (pnpm.io). Confirm or adjust your PR CI config accordingly.

Comment thread packages/enclave-sdk/package.json
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.

Rename packages/evm to packages/enclave

2 participants