Skip to content

chore: new crisp folder structure#895

Merged
cedoor merged 7 commits into
devfrom
chore/crisp-folders
Oct 24, 2025
Merged

chore: new crisp folder structure#895
cedoor merged 7 commits into
devfrom
chore/crisp-folders

Conversation

@cedoor

@cedoor cedoor commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Chores

    • Reorganized CRISP into package-based layout (crisp-contracts, crisp-sdk) and updated workspace configuration.
    • Moved and re-linked a repository submodule into the new package path and adjusted related volumes.
  • Documentation

    • Updated README and changelog content to reflect new structure, addresses, and streamlined commands.
  • Refactor

    • Relocated deployment and dev scripts to run from the new package paths and consolidated package metadata and scripts.

@vercel

vercel Bot commented Oct 24, 2025

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
crisp Skipped Skipped Oct 24, 2025 4:44pm
enclave-docs Skipped Skipped Oct 24, 2025 4:44pm

@coderabbitai

coderabbitai Bot commented Oct 24, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This PR reorganizes the CRISP example into a nested packages layout under examples/CRISP/packages/, moving contract and SDK artifacts, updating submodule paths, workspace entries, deployment/build scripts, docker volumes, package manifests, and documentation to reflect the new structure. (48 words)

Changes

Cohort / File(s) Change Summary
Git configuration
\.gitmodules
Updated submodule entry path from examples/CRISP/lib/risc0-ethereum to examples/CRISP/packages/crisp-contracts/lib/risc0-ethereum (URL unchanged).
Submodule move
examples/CRISP/lib/risc0-ethereum, examples/CRISP/packages/crisp-contracts/lib/risc0-ethereum
Removed submodule linkage at original path; added submodule commit reference at new nested path.
Deployment & start scripts
deploy/local/contracts.sh, deploy/local/start.sh
Changed working directory/paths for contract deployment to examples/CRISP/packages/crisp-contracts (forge invocation path updated).
CRISP scripts
examples/CRISP/scripts/compile_circuits.sh, examples/CRISP/scripts/crisp_deploy.sh, examples/CRISP/scripts/dev.sh
Adjusted targets/working directories to packages/crisp-contracts (copying verifier, deployment, and hardhat node now run from nested package).
Workspace
pnpm-workspace.yaml
Replaced examples/CRISP/sdk with examples/CRISP/packages/crisp-sdk and examples/CRISP/packages/crisp-contracts in workspace packages list.
Top-level CRISP package.json
examples/CRISP/package.json
Made package private, removed version/repository fields, trimmed scripts/devDeps, and delegated contract-related scripts to packages/crisp-contracts.
crisp-contracts package
examples/CRISP/packages/crisp-contracts/package.json, .../contracts/CRISPProgram.sol, .../deployed_contracts.json
Added new @enclave/crisp-contracts package.json with build/test/deploy scripts and deps; minor formatting change in CRISPProgram.sol; newline added to JSON.
crisp-sdk package
examples/CRISP/packages/crisp-sdk/package.json, examples/CRISP/packages/crisp-sdk/src/token.ts
Repositioned author/packageManager fields in package.json; adjusted ERC20Votes artifact import path (./artifacts/ERC20Votes.json./ERC20Votes.json).
Docker / volumes
examples/CRISP/docker-compose.yaml
Updated volume mounts to point out and node_modules into packages/crisp-contracts and added crisp-contracts-node-modules volume.
IDE & docs
examples/CRISP/.vscode/settings.json, examples/CRISP/CHANGELOG.md, examples/CRISP/Readme.md
Removed rust-analyzer linkedProjects and env setting; cleared CHANGELOG contents; updated README to reflect new package layout, addresses, and commands.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev
  participant Repo
  participant Scripts
  participant Submodule
  rect rgba(135,206,250,0.08)
    Dev->>Repo: Run deploy/start/dev script
    Repo->>Scripts: execute script (was: examples/CRISP)
    Note right of Scripts: Updated working dir
  end
  rect rgba(144,238,144,0.08)
    Scripts->>Scripts: cd examples/CRISP/packages/crisp-contracts && run forge/hardhat/copy
    Scripts->>Submodule: access `lib/risc0-ethereum` at new path
  end
  Scripts->>Dev: return logs/status
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

documentation

Suggested reviewers

  • 0xjei
  • ryardley
  • ctrlc03

Poem

🐰 Hop, hop — a tidy change I bring,
Folders nested, scripts now sing,
Submodules moved, paths set right,
Contracts compile into the night,
Cheers from a rabbit, soft and bright.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "chore: new crisp folder structure" directly aligns with the primary purpose of the changeset. The modifications consistently demonstrate a comprehensive reorganization of the CRISP project from a flat structure to a packages-based layout, including the creation of examples/CRISP/packages/crisp-contracts/ and examples/CRISP/packages/crisp-sdk/, relocation of the risc0-ethereum submodule, and updates to all related configuration files, deployment scripts, and documentation. The title is concise, clear, and appropriately uses the chore: prefix for this non-feature structural change.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/crisp-folders

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

❤️ Share

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

@cedoor cedoor force-pushed the chore/crisp-folders branch from 69cc468 to 4b1bde7 Compare October 24, 2025 15:56
@cedoor cedoor changed the title chore: new crisp folder structure [skip-line-limit] chore: new crisp folder structure Oct 24, 2025
@cedoor cedoor marked this pull request as ready for review October 24, 2025 16:20
@cedoor cedoor requested a review from ctrlc03 October 24, 2025 16:20

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 82c09ea and 4b1bde7.

⛔ Files ignored due to path filters (2)
  • examples/CRISP/packages/crisp-sdk/tests/fixtures/pubkey.bin is excluded by !**/*.bin
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (20)
  • .gitmodules (1 hunks)
  • deploy/local/contracts.sh (1 hunks)
  • deploy/local/start.sh (1 hunks)
  • examples/CRISP/.vscode/settings.json (0 hunks)
  • examples/CRISP/CHANGELOG.md (0 hunks)
  • examples/CRISP/Readme.md (8 hunks)
  • examples/CRISP/docker-compose.yaml (2 hunks)
  • examples/CRISP/lib/risc0-ethereum (0 hunks)
  • examples/CRISP/package.json (1 hunks)
  • examples/CRISP/packages/crisp-contracts/contracts/CRISPProgram.sol (1 hunks)
  • examples/CRISP/packages/crisp-contracts/deployed_contracts.json (1 hunks)
  • examples/CRISP/packages/crisp-contracts/lib/risc0-ethereum (1 hunks)
  • examples/CRISP/packages/crisp-contracts/package.json (1 hunks)
  • examples/CRISP/packages/crisp-sdk/package.json (2 hunks)
  • examples/CRISP/packages/crisp-sdk/src/token.ts (1 hunks)
  • examples/CRISP/scripts/compile_circuits.sh (1 hunks)
  • examples/CRISP/scripts/crisp_deploy.sh (1 hunks)
  • examples/CRISP/scripts/dev.sh (1 hunks)
  • examples/CRISP/scripts/dev_cipher.sh (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
💤 Files with no reviewable changes (3)
  • examples/CRISP/CHANGELOG.md
  • examples/CRISP/.vscode/settings.json
  • examples/CRISP/lib/risc0-ethereum
🧰 Additional context used
🧠 Learnings (1)
📚 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:

  • pnpm-workspace.yaml
  • examples/CRISP/Readme.md
🪛 Gitleaks (8.28.0)
deploy/local/start.sh

[high] 75-75: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

deploy/local/contracts.sh

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

(generic-api-key)

⏰ 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). (1)
  • GitHub Check: build_e3_support_risc0
🔇 Additional comments (19)
examples/CRISP/packages/crisp-contracts/deployed_contracts.json (1)

85-85: Trailing newline added; formatting improvement approved.

The addition of a trailing newline aligns with POSIX text file conventions and ensures proper file formatting when relocated to the new package structure.

examples/CRISP/packages/crisp-contracts/contracts/CRISPProgram.sol (1)

108-110: Line formatting improved; logic and functionality unchanged.

The INPUT_VALIDATOR_FACTORY.deploy() call is consolidated to a single line for better readability, with no change to arguments or return handling.

examples/CRISP/packages/crisp-contracts/lib/risc0-ethereum (1)

1-1: Submodule relocation verified as complete and consistent.

All configuration files have been correctly updated:

  • .gitmodules references the new path with the correct URL
  • pnpm-workspace.yaml includes the relocated package
  • Deployment scripts use the new path without orphaned references to the old location

No further action required.

deploy/local/contracts.sh (1)

10-10: LGTM! Path update aligns with the new structure.

The deployment path has been correctly updated to examples/CRISP/packages/crisp-contracts. The private key used here is Anvil's well-known first test account, which is appropriate for local development.

Note: The static analysis warning about the private key is a false positive—this is Anvil's public test key (address 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266), intended for local testing only.

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

40-40: LGTM! Path correctly updated.

The Solidity Verifier destination path has been properly updated to reflect the new packages/crisp-contracts structure.

pnpm-workspace.yaml (1)

6-7: LGTM! Workspace correctly updated for the new structure.

The workspace configuration has been properly updated to include both the crisp-sdk and crisp-contracts packages under the new packages/ subdirectory, replacing the previous single examples/CRISP/sdk entry.

deploy/local/start.sh (1)

75-75: LGTM! Deployment path correctly updated.

The CRISP contract deployment step now correctly targets the new examples/CRISP/packages/crisp-contracts directory. The private key is Anvil's standard test account, appropriate for local development.

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

9-10: LGTM! Directory change aligns with the new structure.

The script now correctly changes to the packages/crisp-contracts directory before executing deployment commands. This assumes the script is invoked from the examples/CRISP directory, which appears consistent with usage in other scripts (e.g., dev.sh line 37).

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

36-36: LGTM! Hardhat node command correctly updated.

The command now properly changes to the packages/crisp-contracts directory before starting the Hardhat node, ensuring it runs in the correct context with the relocated contract files and configuration.

.gitmodules (1)

1-3: Submodule relocation is properly executed.

The verification confirms the relocation was completed correctly using proper Git mechanisms:

  • .gitmodules and git config are correctly updated to the new path
  • Git index shows the submodule marker (160000) with proper commit reference
  • The commit history (0f5a1fc) documents the relocation as an intentional tracked change

The "-" status indicating the submodule is uninitialized is expected and normal—users will initialize it via git submodule update --init --recursive as needed.

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

9-9: Import path change verified and correct.

Both concerns are confirmed:

  1. ERC20Votes.json exists at the new location (src/ERC20Votes.json)
  2. ✓ Build process is properly configured: tsconfig.json includes "src/**/*.json", so the TypeScript compiler will copy the JSON file to the dist/ directory during the tsc build

The path change from ./artifacts/ERC20Votes.json to ./ERC20Votes.json is correct since there is no artifacts/ subdirectory in the project.

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

22-27: Verify the script runs from the expected directory context.

The relative path cd packages/crisp-contracts at line 22 assumes the script is executed from the examples/CRISP/ directory. Ensure documentation and calling conventions make this clear, and that all callers (CI/CD, dev setup scripts, documentation) invoke this script from the correct context.

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

5-8: Metadata alignment with new package structure.

The addition of top-level author metadata aligns with the new package structure. Ensure this is consistent with the crisp-contracts package metadata for a uniform developer experience.

examples/CRISP/Readme.md (2)

76-108: Verify that environment address values match actual deployments.

The documentation references specific contract addresses (e.g., CRISPProgram: 0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1). These addresses should be verified to match the output of the actual deployment process described in this guide, especially after the directory structure reorganization. Stale addresses could break user onboarding.


5-21: Documentation structure update is well organized.

The folder structure tree clearly reflects the new packages and crates directories, improving clarity for developers navigating the new layout.

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

1-56: New crisp-contracts package is well-structured.

The package manifest properly defines scripts, dependencies, and metadata for the Solidity contracts package. The workspace:* reference for @enclave-e3/contracts correctly participates in monorepo coordination.

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

20-21: Docker compose volumes updated for new package structure.

Volume mappings correctly reflect the new examples/CRISP/packages/crisp-contracts/ directory layout. The new crisp-contracts-node-modules volume is properly declared.

Also applies to: 47-47

examples/CRISP/package.json (2)

3-3: Workspace root package appropriately marked as private.

The "private": true flag correctly identifies this as a workspace root package not intended for publishing, aligning with the new monorepo structure.


23-34: DevDependencies appropriately reflect workspace orchestration role.

The retained devDependencies (@playwright/test, @synthetixio/synpress, concurrently, wait-on, ethers) are appropriate for workspace orchestration and E2E testing. The removal of contract-specific tooling (hardhat, forge dependencies) aligns with the new package structure.

Comment thread examples/CRISP/package.json
Comment thread examples/CRISP/package.json
Comment thread examples/CRISP/package.json
@vercel vercel Bot temporarily deployed to Preview – enclave-docs October 24, 2025 16:40 Inactive
@cedoor cedoor enabled auto-merge (squash) October 24, 2025 16:41
@vercel vercel Bot temporarily deployed to Preview – enclave-docs October 24, 2025 16:44 Inactive
@vercel vercel Bot temporarily deployed to Preview – crisp October 24, 2025 16:44 Inactive
@cedoor cedoor requested a review from ctrlc03 October 24, 2025 16:45

@ctrlc03 ctrlc03 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b9f6301 and cc2e5eb.

📒 Files selected for processing (1)
  • examples/CRISP/package.json (1 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). (7)
  • GitHub Check: integration_prebuild
  • GitHub Check: build_sdk
  • GitHub Check: build_enclave_cli
  • GitHub Check: test_net
  • GitHub Check: test_contracts
  • GitHub Check: rust_integration
  • GitHub Check: rust_unit
🔇 Additional comments (2)
examples/CRISP/package.json (2)

3-35: Root-level changes align well with folder restructuring.

The addition of "private": true, delegation scripts (compile:contracts, ciphernode:add), and reorganization of devDependencies (wait-on, concurrently) all support the new nested packages layout. The report script provides good test observability.


19-19: Verified: test/governanceCircuit.test.ts exists and is compatible with node --test runner.

The file uses Node's native test API (import { describe, it } from "node:test") and the test structure is compatible with the node --test runner as configured in the script.

Comment thread examples/CRISP/package.json
@cedoor cedoor linked an issue Oct 24, 2025 that may be closed by this pull request
@cedoor cedoor merged commit 091d6d3 into dev Oct 24, 2025
23 checks passed
@ctrlc03 ctrlc03 deleted the chore/crisp-folders branch October 24, 2025 16:53
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.

Restructure CRISP folder layout for consistency with Enclave

2 participants