chore: new crisp folder structure#895
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
WalkthroughThis PR reorganizes the CRISP example into a nested packages layout under Changes
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
c901b47 to
589ac72
Compare
944fe09 to
3d5d781
Compare
3d5d781 to
69cc468
Compare
69cc468 to
4b1bde7
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
examples/CRISP/packages/crisp-sdk/tests/fixtures/pubkey.binis excluded by!**/*.binpnpm-lock.yamlis 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.yamlexamples/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:
.gitmodulesreferences the new path with the correct URLpnpm-workspace.yamlincludes 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-contractsstructure.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-sdkandcrisp-contractspackages under the newpackages/subdirectory, replacing the previous singleexamples/CRISP/sdkentry.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-contractsdirectory. 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-contractsdirectory before executing deployment commands. This assumes the script is invoked from theexamples/CRISPdirectory, which appears consistent with usage in other scripts (e.g.,dev.shline 37).examples/CRISP/scripts/dev.sh (1)
36-36: LGTM! Hardhat node command correctly updated.The command now properly changes to the
packages/crisp-contractsdirectory 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 --recursiveas needed.examples/CRISP/packages/crisp-sdk/src/token.ts (1)
9-9: Import path change verified and correct.Both concerns are confirmed:
- ✓
ERC20Votes.jsonexists at the new location (src/ERC20Votes.json)- ✓ Build process is properly configured:
tsconfig.jsonincludes"src/**/*.json", so the TypeScript compiler will copy the JSON file to thedist/directory during thetscbuildThe path change from
./artifacts/ERC20Votes.jsonto./ERC20Votes.jsonis correct since there is noartifacts/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-contractsat line 22 assumes the script is executed from theexamples/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/contractscorrectly 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 newcrisp-contracts-node-modulesvolume is properly declared.Also applies to: 47-47
examples/CRISP/package.json (2)
3-3: Workspace root package appropriately marked as private.The
"private": trueflag 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.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 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. Thereportscript provides good test observability.
19-19: Verified:test/governanceCircuit.test.tsexists and is compatible withnode --testrunner.The file uses Node's native test API (
import { describe, it } from "node:test") and the test structure is compatible with thenode --testrunner as configured in the script.
Summary by CodeRabbit
Chores
Documentation
Refactor