chore: add crisp sdk and circuits tests to ci#980
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughConsolidates CRISP CI and scripts, adds SDK workspace build/test commands, renames circuit compilation script, hardens end-to-end orchestration, and changes the CRISP SDK API/type surface (adds Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20–30 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
examples/CRISP/package.json(1 hunks)examples/CRISP/packages/crisp-sdk/tests/vote.test.ts(1 hunks)examples/CRISP/scripts/run-playwright-tests.sh(1 hunks)examples/CRISP/scripts/run-sdk-tests.sh(1 hunks)examples/CRISP/scripts/test_e2e.sh(1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2024-10-08T19:45:18.209Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 107
File: tests/basic_integration/test.sh:81-83
Timestamp: 2024-10-08T19:45:18.209Z
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/run-sdk-tests.shexamples/CRISP/scripts/test_e2e.sh
📚 Learning: 2025-10-29T23:35:30.146Z
Learnt from: ryardley
Repo: gnosisguild/enclave PR: 936
File: scripts/run-crisp-test.sh:1-3
Timestamp: 2025-10-29T23:35:30.146Z
Learning: In the scripts/run-crisp-test.sh file, the use of `rm -rf *` is acceptable as it's intentionally designed as a definitive reset-and-test script for clean checkouts.
Applied to files:
examples/CRISP/scripts/run-playwright-tests.sh
📚 Learning: 2025-11-05T14:12:57.814Z
Learnt from: ctrlc03
Repo: gnosisguild/enclave PR: 963
File: examples/CRISP/client/package.json:25-25
Timestamp: 2025-11-05T14:12:57.814Z
Learning: In the Enclave/CRISP codebase, `enclave-e3/sdk` and `crisp-e3/sdk` are different packages: `enclave-e3/sdk` is the general Enclave SDK, while `crisp-e3/sdk` is the CRISP-specific SDK. The CRISP client (`examples/CRISP/client`) intentionally depends on `enclave-e3/sdk`, not `crisp-e3/sdk`.
Applied to files:
examples/CRISP/package.json
📚 Learning: 2025-10-03T08:38:36.786Z
Learnt from: ctrlc03
Repo: gnosisguild/enclave PR: 781
File: examples/CRISP/test/governanceCircuit.test.ts:15-50
Timestamp: 2025-10-03T08:38:36.786Z
Learning: Hardhat v3 supports Node.js's native test runner (node:test) including importing describe and it from 'node:test'. Tests using this interface are compatible with Hardhat v3's test task.
Applied to files:
examples/CRISP/scripts/test_e2e.sh
🧬 Code graph analysis (1)
examples/CRISP/scripts/run-sdk-tests.sh (1)
examples/CRISP/scripts/run-playwright-tests.sh (1)
cleanup(4-7)
🪛 Shellcheck (0.11.0)
examples/CRISP/scripts/run-sdk-tests.sh
[error] 9-9: SIGKILL/SIGSTOP can not be trapped.
(SC2173)
examples/CRISP/scripts/run-playwright-tests.sh
[error] 9-9: SIGKILL/SIGSTOP can not be trapped.
(SC2173)
[warning] 12-12: Remove "exec " if script should continue after this command.
(SC2093)
⏰ 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_sdk
- GitHub Check: build_enclave_cli
- GitHub Check: test_contracts
- GitHub Check: test_net
- GitHub Check: build_e3_support_dev
- GitHub Check: rust_integration
- GitHub Check: integration_prebuild
- GitHub Check: rust_unit
🔇 Additional comments (3)
examples/CRISP/packages/crisp-sdk/tests/vote.test.ts (1)
316-316: LGTM! Timeout increase is appropriate for CI environments.The timeout increase from 180s to 240s provides additional headroom for this computationally intensive masking operation, which is reasonable given that CI environments can be slower than local development machines.
examples/CRISP/package.json (1)
23-23: LGTM! Workspace-relative path is clearer.Using
pnpm -C packages/crisp-sdk testis more explicit than the previouscdapproach and aligns better with pnpm workspace conventions.examples/CRISP/scripts/test_e2e.sh (1)
17-23: LGTM! Improved test orchestration with better error handling.The updated concurrently invocation provides better control and observability:
--kill-othersensures all processes terminate when one fails--fail-faststops execution on first failure for faster feedback- Named process labels (
-n "SERVER,SDK,PLAYWRIGHT") improve debugging- Multi-line format enhances readability
a656384 to
846024f
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
examples/CRISP/packages/crisp-sdk/src/vote.ts (1)
129-138: Consider making bytecode access consistent.Line 131 accesses
circuit.bytecodedirectly without casting toCompiledCircuit, while Line 181 inverifyProofstill uses(circuit as CompiledCircuit).bytecode. For consistency and clarity, consider applying the same pattern in both places.Apply this diff to make Line 181 consistent:
export const verifyProof = async (proof: ProofData): Promise<boolean> => { - const backend = new UltraHonkBackend((circuit as CompiledCircuit).bytecode, { threads: optimalThreadCount }) + const backend = new UltraHonkBackend(circuit.bytecode, { threads: optimalThreadCount }) const isValid = await backend.verifyProof(proof, { keccakZK: true })
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
examples/CRISP/packages/crisp-sdk/src/types.ts(1 hunks)examples/CRISP/packages/crisp-sdk/src/vote.ts(2 hunks)examples/CRISP/packages/crisp-sdk/tests/vote.test.ts(3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: ctrlc03
Repo: gnosisguild/enclave PR: 963
File: examples/CRISP/client/package.json:25-25
Timestamp: 2025-11-05T14:12:57.814Z
Learning: In the Enclave/CRISP codebase, `enclave-e3/sdk` and `crisp-e3/sdk` are different packages: `enclave-e3/sdk` is the general Enclave SDK, while `crisp-e3/sdk` is the CRISP-specific SDK. The CRISP client (`examples/CRISP/client`) intentionally depends on `enclave-e3/sdk`, not `crisp-e3/sdk`.
🧬 Code graph analysis (1)
examples/CRISP/packages/crisp-sdk/src/vote.ts (2)
examples/CRISP/packages/crisp-sdk/src/types.ts (2)
CircuitInputs(124-164)ExecuteCircuitResult(166-169)packages/enclave-sdk/src/greco.ts (2)
CircuitInputs(23-37)generateProof(122-159)
⏰ 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). (10)
- GitHub Check: crisp_unit
- GitHub Check: build_sdk
- GitHub Check: integration_prebuild
- GitHub Check: test_net
- GitHub Check: build_e3_support_dev
- GitHub Check: test_contracts
- GitHub Check: build_ciphernode_image
- GitHub Check: build_enclave_cli
- GitHub Check: rust_integration
- GitHub Check: rust_unit
🔇 Additional comments (7)
examples/CRISP/packages/crisp-sdk/src/types.ts (1)
166-169: LGTM! Clean type definition.The new
ExecuteCircuitResulttype clearly represents the circuit execution output with both the witness and return value. The structure aligns well with the refactored API.examples/CRISP/packages/crisp-sdk/tests/vote.test.ts (3)
20-20: LGTM! Import updated to match new API.The import change correctly reflects the API refactoring from
generateProoftoexecuteCircuit.
144-172: LGTM! Test correctly validates circuit output.The test properly validates that the circuit output ciphertext matches the input ciphertext for a regular vote scenario.
174-233: LGTM! Comprehensive test coverage for mask vote scenarios.The two new test cases properly cover:
- Mask vote with previous ciphertext (validates ciphertext addition)
- Mask vote without previous ciphertext (validates zero-vote ciphertext)
Both tests correctly validate the
returnValuestructure fromexecuteCircuit.examples/CRISP/packages/crisp-sdk/src/vote.ts (3)
8-8: LGTM! Import updated for new return type.The
ExecuteCircuitResultimport is correctly added to support the newexecuteCircuitfunction signature.
123-127: LGTM! Clean refactoring of circuit execution.The new
executeCircuitfunction properly exposes both the witness and return value from the circuit execution. The type assertion on Line 126 assumesnoir.execute()returns the expected structure—this appears safe based on passing tests.
140-178: LGTM! Proof generation functions properly use refactored API.Both
generateVoteProofandgenerateMaskVoteProofcorrectly delegate to the updatedgenerateProoffunction, which now internally usesexecuteCircuit. The validation logic and error handling remain sound.
Closes #959
Summary by CodeRabbit
Chores
Refactor
✏️ Tip: You can customize this high-level summary in your review settings.