Skip to content

chore: remove semaphore and cleanup crisp#833

Merged
ctrlc03 merged 5 commits into
devfrom
chore/update-crisp
Oct 13, 2025
Merged

chore: remove semaphore and cleanup crisp#833
ctrlc03 merged 5 commits into
devfrom
chore/update-crisp

Conversation

@ctrlc03

@ctrlc03 ctrlc03 commented Oct 10, 2025

Copy link
Copy Markdown
Collaborator

fix #758 and fix #757

Summary by CodeRabbit

  • New Features

    • Faster, simpler voting: no identity registration or Semaphore proofs required.
    • Admins can configure round data (token, balance threshold, snapshot block, census root).
  • Refactor

    • Removed Semaphore-based flows across client, server, and contracts; updated input encoding and deployment logic.
  • Chores

    • Dropped related dependencies and hooks; removed Registration UI.
    • Updated example environment addresses.
    • Adjusted client/server payloads and models (removed proof_sem).
  • Documentation

    • Updated wording to remove Semaphore references.

@vercel

vercel Bot commented Oct 10, 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 12, 2025 3:24pm
enclave-docs Skipped Skipped Oct 12, 2025 3:24pm

@ctrlc03 ctrlc03 requested a review from cedoor October 10, 2025 18:26
@ctrlc03 ctrlc03 self-assigned this Oct 10, 2025
@coderabbitai

coderabbitai Bot commented Oct 10, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This PR removes Semaphore-based registration and group logic across client, server, and contracts, introduces ownership-gated round data in CRISPInputValidator, updates factories and program constructor, adjusts vote payloads to exclude semaphore proofs, updates env addresses, and deletes related contracts, hooks, components, and dependencies.

Changes

Cohort / File(s) Summary
Ignore and config
examples/CRISP/.gitignore
Keep cache_hardhat/ ignored and add a negation to include sdk/src/artifacts/ERC20Votes.json.
Env updates
examples/CRISP/client/.env.example, examples/CRISP/server/.env.example
Update CRISPProgram address; remove client VITE_SEMAPHORE_ADDRESS.
Client deps cleanup
examples/CRISP/client/package.json, examples/CRISP/package.json, examples/CRISP/remappings.txt
Remove Semaphore-related JS and Solidity deps and remapping.
Client UI removal
examples/CRISP/client/src/components/RegistrationModal.tsx, examples/CRISP/client/src/pages/Landing/components/DailyPoll.tsx
Delete RegistrationModal; remove registration flow and related button/label states in DailyPoll.
Client context/types
examples/CRISP/client/src/context/voteManagement/VoteManagement.context.tsx, .../VoteManagement.types.ts
Remove semaphore identity, group management fields, registration state, and registration method from context/types.
Client hooks
examples/CRISP/client/src/hooks/semaphore/useSemaphoreGroupManagement.ts, examples/CRISP/client/src/hooks/voting/useVoteCasting.ts
Delete semaphore group management hook; simplify vote casting by removing noir/semaphore proof-generation and registration checks.
Client models/encoding
examples/CRISP/client/src/model/vote.model.ts, examples/CRISP/client/src/utils/proof-encoding.ts
Remove proof_sem from BroadcastVoteRequest; drop encodeSemaphoreProof; change encodeCrispInputs to accept (noirProof, noirPublicInputs, encryptedVote) and return ABI-encoded string.
Server models/routes
examples/CRISP/server/src/server/models.rs, .../routes/voting.rs
Remove proof_sem from EncryptedVote; omit it from on-chain broadcast encoding.
Contracts removed
examples/CRISP/contracts/CRISPChecker.sol, .../CRISPCheckerFactory.sol, .../CRISPPolicy.sol, .../CRISPPolicyFactory.sol
Delete checker/policy contracts and factories tied to Semaphore/group enforcement.
Input validator changes
examples/CRISP/contracts/CRISPInputValidator.sol, .../CRISPInputValidatorFactory.sol
Add Ownable; add setRoundData(root, token, balanceThreshold, snapshotBlock) and related state; change factory deploy(_verifierAddr, _owner) and initialization payload.
Program changes
examples/CRISP/contracts/CRISPProgram.sol
Remove Semaphore, checker/policy factories, group maps, and registerMember; add setImageId and setVerifier; adjust constructor to use only validator factory and owner-based validator deployment.
Docs
examples/CRISP/contracts/README.md
Update description to remove default Semaphore gating mention.
Deploy script
examples/CRISP/deploy/Deploy.s.sol
Remove deployment of Semaphore verifier, checker/policy factories; update CRISPProgram construction args accordingly.
Tests
examples/CRISP/test/crisp.spec.ts
Remove identity registration flow; proceed directly to waiting and navigation steps.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Client as Client (Web)
  participant Server as Server (API)
  participant Program as CRISPProgram
  participant Validator as CRISPInputValidator
  participant Verifier as NoirVerifier

  rect rgba(200,230,255,0.25)
  note over Program,Validator: One-time setup (owner)
  actor Owner
  Owner->>Program: setImageId(bytes32)
  Owner->>Program: setVerifier(address)
  Owner->>Validator: setRoundData(root, token, threshold, snapshotBlock)
  end

  User->>Client: Select option and cast vote
  Client->>Server: POST /vote { encryptedVote, noirProof, publicInputs }
  Server->>Program: broadcastVote(encodeCrispInputs(noirProof, publicInputs, encryptedVote))
  Program->>Validator: validate(evidence)
  Validator->>Verifier: verify(noirProof, publicInputs)
  Verifier-->>Validator: ok/err
  Validator-->>Program: valid/invalid
  Program-->>Server: tx success/failure
  Server-->>Client: result
Loading
sequenceDiagram
  autonumber
  actor Owner
  participant Validator as CRISPInputValidator (Ownable)

  Owner->>Validator: setRoundData(root, token, threshold, snapshotBlock)
  alt already set
    Validator-->>Owner: revert RoundDataAlreadySet
  else success
    Validator-->>Owner: Round data committed
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60–90 minutes

Possibly related PRs

Suggested reviewers

  • cedoor
  • ryardley
  • 0xjei

Poem

I nibbled the wires, trimmed the vine,
Out went the hoops, the groups, the line.
A root was planted, crisp and neat—
Owner sets the path, voters meet.
Proofs hop light, the payload slim;
On-chain we dance—flip, hop, and grin. 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Linked Issues Check ⚠️ Warning The PR successfully removes all Semaphore-based components as required by #757 and adds a setRoundData entrypoint to store a Merkle root for #758, but it does not enforce publication of the root in validate nor implement on-chain balance threshold checks or placement between Enclave.request and Enclave.activate to prevent voting before root submission. Ensure InputValidator.validate includes a modifier or revert logic to block voting until setRoundData has been called and add on-chain logic to verify voter token balances or Merkle proof membership as specified in #757 and #758.
Out of Scope Changes Check ⚠️ Warning Most removals target Semaphore integration and Merkle-tree preparations per the linked issues, but unrelated updates to the examples/CRISP/.gitignore (modifying cache_hardhat entries and an ignore negation for sdk/src/artifacts/ERC20Votes.json) appear outside the PR’s objectives. Remove or isolate the .gitignore changes into a separate housekeeping PR if they are not directly tied to the semaphore removal or Merkle-tree support story.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title concisely describes the main work of removing semaphore integration and cleaning up CRISP, which aligns with the PR’s primary focus of replacing Semaphore with a standard Merkle-tree approach.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

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

❤️ Share

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

@coderabbitai

coderabbitai Bot commented Oct 10, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@ctrlc03

ctrlc03 commented Oct 10, 2025

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@ctrlc03 ctrlc03 enabled auto-merge (squash) October 10, 2025 18:36
@coderabbitai

coderabbitai Bot commented Oct 10, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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

🧹 Nitpick comments (4)
examples/CRISP/client/src/hooks/voting/useVoteCasting.ts (1)

70-70: Consider making the block explorer URL configurable.

The Sepolia Etherscan URL is hardcoded. If the application needs to support multiple chains (mainnet, other testnets, or custom networks), this will break or show incorrect links.

Consider adding a helper function that constructs the explorer URL based on the chain ID:

const getExplorerUrl = (chainId: number, txHash: string): string => {
  const explorers: Record<number, string> = {
    // Add other chains as needed
  };
  const baseUrl = explorers[chainId] || 'https://etherscan.io';
  return `${baseUrl}/tx/${txHash}`;
};

Then use it in the success case:

 case 'success': {
-  const url = `https://sepolia.etherscan.io/tx/${broadcastVoteResponse.tx_hash}`;
+  const url = getExplorerUrl(CHAIN_ID, broadcastVoteResponse.tx_hash);
   setTxUrl(url);

Alternatively, if the chain configuration is already available via context or environment, use that directly.

examples/CRISP/client/.env.example (1)

4-4: LGTM! Consider adding quotes for consistency.

The updated E3_PROGRAM_ADDRESS correctly matches the server configuration and reflects the new CRISPProgram deployment. The removal of VITE_SEMAPHORE_ADDRESS aligns with the PR objectives.

For consistency with environment file best practices, consider wrapping the address value in quotes:

-VITE_E3_PROGRAM_ADDRESS=0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1 # Default E3 program address from anvil
+VITE_E3_PROGRAM_ADDRESS="0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1" # Default E3 program address from anvil

This prevents potential parsing issues with certain environment variable processors.

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

109-114: Remove trailing whitespace on line 114.

Line 114 contains trailing whitespace that should be removed.

Apply this diff:

         inputValidator = IInputValidator(
             INPUT_VALIDATOR_FACTORY.deploy(
                 address(HONK_VERIFIER),
                 owner()
             )
         );
-       
+
         return (ENCRYPTION_SCHEME_ID, inputValidator);
examples/CRISP/contracts/CRISPInputValidator.sol (1)

71-72: Name the unused address parameter for clarity.

The first parameter in the validate function is unnamed, which reduces code readability. Consider naming it even if it's unused (e.g., address /* sender */ or address _sender).

Apply this diff:

-    function validate(
-        address,
+    function validate(
+        address /* sender */,
         bytes memory data
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d471fa5 and 02ef1c7.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (26)
  • examples/CRISP/.gitignore (1 hunks)
  • examples/CRISP/client/.env.example (1 hunks)
  • examples/CRISP/client/package.json (0 hunks)
  • examples/CRISP/client/src/components/RegistrationModal.tsx (0 hunks)
  • examples/CRISP/client/src/context/voteManagement/VoteManagement.context.tsx (0 hunks)
  • examples/CRISP/client/src/context/voteManagement/VoteManagement.types.ts (0 hunks)
  • examples/CRISP/client/src/hooks/semaphore/useSemaphoreGroupManagement.ts (0 hunks)
  • examples/CRISP/client/src/hooks/voting/useVoteCasting.ts (1 hunks)
  • examples/CRISP/client/src/model/vote.model.ts (0 hunks)
  • examples/CRISP/client/src/pages/Landing/components/DailyPoll.tsx (2 hunks)
  • examples/CRISP/client/src/utils/proof-encoding.ts (1 hunks)
  • examples/CRISP/contracts/CRISPChecker.sol (0 hunks)
  • examples/CRISP/contracts/CRISPCheckerFactory.sol (0 hunks)
  • examples/CRISP/contracts/CRISPInputValidator.sol (1 hunks)
  • examples/CRISP/contracts/CRISPInputValidatorFactory.sol (1 hunks)
  • examples/CRISP/contracts/CRISPPolicy.sol (0 hunks)
  • examples/CRISP/contracts/CRISPPolicyFactory.sol (0 hunks)
  • examples/CRISP/contracts/CRISPProgram.sol (1 hunks)
  • examples/CRISP/contracts/README.md (1 hunks)
  • examples/CRISP/deploy/Deploy.s.sol (0 hunks)
  • examples/CRISP/package.json (0 hunks)
  • examples/CRISP/remappings.txt (0 hunks)
  • examples/CRISP/server/.env.example (1 hunks)
  • examples/CRISP/server/src/server/models.rs (0 hunks)
  • examples/CRISP/server/src/server/routes/voting.rs (0 hunks)
  • examples/CRISP/test/crisp.spec.ts (0 hunks)
💤 Files with no reviewable changes (16)
  • examples/CRISP/client/src/model/vote.model.ts
  • examples/CRISP/package.json
  • examples/CRISP/server/src/server/routes/voting.rs
  • examples/CRISP/contracts/CRISPCheckerFactory.sol
  • examples/CRISP/server/src/server/models.rs
  • examples/CRISP/client/src/context/voteManagement/VoteManagement.types.ts
  • examples/CRISP/remappings.txt
  • examples/CRISP/test/crisp.spec.ts
  • examples/CRISP/client/package.json
  • examples/CRISP/client/src/hooks/semaphore/useSemaphoreGroupManagement.ts
  • examples/CRISP/contracts/CRISPPolicyFactory.sol
  • examples/CRISP/client/src/context/voteManagement/VoteManagement.context.tsx
  • examples/CRISP/client/src/components/RegistrationModal.tsx
  • examples/CRISP/contracts/CRISPChecker.sol
  • examples/CRISP/contracts/CRISPPolicy.sol
  • examples/CRISP/deploy/Deploy.s.sol
🧰 Additional context used
🪛 dotenv-linter (3.3.0)
examples/CRISP/client/.env.example

[warning] 4-4: [UnorderedKey] The VITE_E3_PROGRAM_ADDRESS key should go before the VITE_ENCLAVE_API key

(UnorderedKey)


[warning] 4-4: [ValueWithoutQuotes] This value needs to be surrounded in quotes

(ValueWithoutQuotes)

examples/CRISP/server/.env.example

[warning] 19-19: [UnorderedKey] The E3_PROGRAM_ADDRESS key should go before the ENCLAVE_ADDRESS key

(UnorderedKey)

⏰ 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). (5)
  • GitHub Check: ciphernode_integration_test (persist)
  • GitHub Check: ciphernode_integration_test (base)
  • GitHub Check: template_integration
  • GitHub Check: crisp_e2e
  • GitHub Check: Build & Push Image
🔇 Additional comments (13)
examples/CRISP/server/.env.example (1)

19-19: LGTM!

The updated E3_PROGRAM_ADDRESS aligns with the new CRISPProgram deployment that no longer depends on Semaphore. The address format and context (Default Anvil Deployments) are appropriate for local testing.

examples/CRISP/.gitignore (1)

50-52: LGTM!

Explicitly tracking ERC20Votes.json is appropriate given the shift to token-based voter eligibility. This ensures the SDK artifact remains version-controlled while other build outputs are ignored.

examples/CRISP/client/src/hooks/voting/useVoteCasting.ts (1)

42-46: LGTM!

The simplified validation correctly reflects the removal of Semaphore-based registration. Checking only user and roundState is appropriate for the new Merkle tree-based voting flow.

examples/CRISP/client/src/pages/Landing/components/DailyPoll.tsx (2)

7-7: LGTM!

The removal of Identity and RegistrationModal imports correctly reflects the elimination of Semaphore-based registration from the voting flow.


120-126: LGTM!

The simplified button state logic and updated label correctly reflect the streamlined voting flow. The disabled condition now appropriately checks only for poll selection, loading states, round availability, and vote casting in progress—without unnecessary registration checks.

examples/CRISP/client/src/utils/proof-encoding.ts (3)

7-7: LGTM!

The updated imports correctly reflect the removal of Semaphore-specific functionality. The retained imports (encodeAbiParameters, parseAbiParameters, bytesToHex) are sufficient for the simplified encoding logic.


9-11: LGTM!

The simplified ABI structure (bytes, bytes32[], bytes) correctly reflects the removal of Semaphore proof encoding and aligns with the updated CRISP input validation flow.


13-25: LGTM!

The function rename from encodeSemaphoreProof to encodeCrispInputs clearly communicates the updated purpose. The removal of the semaphoreProof parameter and the simplified encoding logic align perfectly with the PR objectives to eliminate Semaphore-based proofs.

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

49-70: LGTM! Constructor simplification aligns with Semaphore removal.

The constructor signature has been correctly updated to remove Semaphore and factory dependencies. The validation of input parameters is appropriate and the initialization logic is sound.

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

19-27: LGTM! Factory signature updated correctly.

The deploy function signature and encoding have been correctly updated to match the new InputValidator initialization requirements. The parameter order (verifier, owner) aligns with the changes in CRISPInputValidator._initialize().

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

10-16: LGTM! Ownable integration is correct.

The addition of Ownable inheritance and the initialization in the constructor is properly implemented.


81-92: LGTM! Input decoding and proof verification simplified correctly.

The removal of Semaphore proof handling and the updated decoding to (bytes, bytes32[], bytes) aligns with the PR objectives to remove Semaphore-based validation. The Noir proof verification logic is correctly implemented.

examples/CRISP/contracts/README.md (1)

19-23: Document Merkle-based gating and preconditions in README

The README no longer mentions Semaphore (good) but still omits the new Merkle workflow and guard logic. Update it to:

  • Admin must call setRoundData(uint256 root, address token, uint256 balanceThreshold, uint256 snapshotBlock) once before any votes.
  • validate(...) should revert if the Merkle root isn’t set—ensure the isDataSet guard is active (currently commented out).
  • Each vote input must include a Merkle proof against censusMerkleRoot.
  • Token-balance gating uses the supplied threshold and snapshot block when building the tree.
  • Refer explicitly to Enclave.publishInput for vote submission and Greco for proof verification.

Confirm that setRoundData is the correct root-publication function and whether the “no voting before root” guard is enforced (or still pending) so the steps above can reference the exact behavior.

Comment thread examples/CRISP/contracts/CRISPInputValidator.sol
Comment thread examples/CRISP/contracts/CRISPInputValidator.sol Outdated
Comment thread examples/CRISP/contracts/CRISPInputValidator.sol
Comment thread examples/CRISP/contracts/CRISPInputValidator.sol Outdated

@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

🧹 Nitpick comments (4)
examples/CRISP/client/.env.example (1)

4-4: Quote value to satisfy dotenv-linter.

dotenv-linter flags this line for ValueWithoutQuotes; wrapping the address in quotes keeps the inline comment while avoiding warnings.

-VITE_E3_PROGRAM_ADDRESS=0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1 # Default E3 program address from anvil
+VITE_E3_PROGRAM_ADDRESS="0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1" # Default E3 program address from anvil
examples/CRISP/client/src/hooks/voting/useVoteCasting.ts (1)

42-44: Good preflight guard; also check votingRound/pk_bytes upfront for clearer UX.

Currently, missing votingRound triggers an exception later. Add an early check to show a friendlier message.

         if (!user || !roundState) {
           console.error("Cannot cast vote: Missing user or round state.");
           showToast({ type: 'danger', message: 'Cannot cast vote. Ensure you are connected, and the round is active.' });
           return;
         }
+        if (!votingRound || !votingRound.pk_bytes?.length) {
+            console.error("Cannot cast vote: Missing voting round public key.");
+            showToast({ type: 'danger', message: 'Round is not ready yet. Please try again shortly.' });
+            return;
+        }
examples/CRISP/client/src/pages/Landing/components/DailyPoll.tsx (1)

120-120: Remove redundant condition in disabled prop.

Button renders only when roundState exists, so !roundState is unnecessary.

-                disabled={noPollSelected || loading || !roundState || isEnded || isCastingVote}
+                disabled={noPollSelected || loading || isEnded || isCastingVote}
examples/CRISP/client/src/utils/proof-encoding.ts (1)

13-25: Strengthen types and validate inputs to prevent runtime ABI encoding errors.

  • Return type should be 0x${string} (viem returns hex).
  • Validate each public input is a 32‑byte hex; current cast can mask errors.
-export const encodeCrispInputs = (
-    noirProof: Uint8Array,
-    noirPublicInputs: string[],
-    encryptedVote: Uint8Array
-): string => {
-    return encodeAbiParameters(crispAbi, [
-        [
-            bytesToHex(noirProof),
-            noirPublicInputs.map(input => input as `0x${string}`),
-            bytesToHex(encryptedVote)
-        ]
-    ])
-}
+export const encodeCrispInputs = (
+  noirProof: Uint8Array,
+  noirPublicInputs: readonly `0x${string}`[],
+  encryptedVote: Uint8Array
+): `0x${string}` => {
+  const isBytes32 = (x: string) => /^0x[0-9a-fA-F]{64}$/.test(x);
+  if (!noirPublicInputs.every(isBytes32)) {
+    throw new Error('noirPublicInputs must be 0x-prefixed 32-byte hex strings (bytes32).');
+  }
+  return encodeAbiParameters(crispAbi, [
+    [
+      bytesToHex(noirProof),
+      noirPublicInputs,
+      bytesToHex(encryptedVote),
+    ],
+  ]) as `0x${string}`;
+}

Based on learnings

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d471fa5 and 02ef1c7.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (26)
  • examples/CRISP/.gitignore (1 hunks)
  • examples/CRISP/client/.env.example (1 hunks)
  • examples/CRISP/client/package.json (0 hunks)
  • examples/CRISP/client/src/components/RegistrationModal.tsx (0 hunks)
  • examples/CRISP/client/src/context/voteManagement/VoteManagement.context.tsx (0 hunks)
  • examples/CRISP/client/src/context/voteManagement/VoteManagement.types.ts (0 hunks)
  • examples/CRISP/client/src/hooks/semaphore/useSemaphoreGroupManagement.ts (0 hunks)
  • examples/CRISP/client/src/hooks/voting/useVoteCasting.ts (1 hunks)
  • examples/CRISP/client/src/model/vote.model.ts (0 hunks)
  • examples/CRISP/client/src/pages/Landing/components/DailyPoll.tsx (2 hunks)
  • examples/CRISP/client/src/utils/proof-encoding.ts (1 hunks)
  • examples/CRISP/contracts/CRISPChecker.sol (0 hunks)
  • examples/CRISP/contracts/CRISPCheckerFactory.sol (0 hunks)
  • examples/CRISP/contracts/CRISPInputValidator.sol (1 hunks)
  • examples/CRISP/contracts/CRISPInputValidatorFactory.sol (1 hunks)
  • examples/CRISP/contracts/CRISPPolicy.sol (0 hunks)
  • examples/CRISP/contracts/CRISPPolicyFactory.sol (0 hunks)
  • examples/CRISP/contracts/CRISPProgram.sol (1 hunks)
  • examples/CRISP/contracts/README.md (1 hunks)
  • examples/CRISP/deploy/Deploy.s.sol (0 hunks)
  • examples/CRISP/package.json (0 hunks)
  • examples/CRISP/remappings.txt (0 hunks)
  • examples/CRISP/server/.env.example (1 hunks)
  • examples/CRISP/server/src/server/models.rs (0 hunks)
  • examples/CRISP/server/src/server/routes/voting.rs (0 hunks)
  • examples/CRISP/test/crisp.spec.ts (0 hunks)
💤 Files with no reviewable changes (16)
  • examples/CRISP/contracts/CRISPPolicyFactory.sol
  • examples/CRISP/client/src/model/vote.model.ts
  • examples/CRISP/server/src/server/models.rs
  • examples/CRISP/remappings.txt
  • examples/CRISP/client/package.json
  • examples/CRISP/client/src/components/RegistrationModal.tsx
  • examples/CRISP/server/src/server/routes/voting.rs
  • examples/CRISP/client/src/context/voteManagement/VoteManagement.types.ts
  • examples/CRISP/client/src/hooks/semaphore/useSemaphoreGroupManagement.ts
  • examples/CRISP/contracts/CRISPPolicy.sol
  • examples/CRISP/client/src/context/voteManagement/VoteManagement.context.tsx
  • examples/CRISP/package.json
  • examples/CRISP/contracts/CRISPCheckerFactory.sol
  • examples/CRISP/contracts/CRISPChecker.sol
  • examples/CRISP/test/crisp.spec.ts
  • examples/CRISP/deploy/Deploy.s.sol
🧰 Additional context used
🪛 dotenv-linter (3.3.0)
examples/CRISP/server/.env.example

[warning] 19-19: [UnorderedKey] The E3_PROGRAM_ADDRESS key should go before the ENCLAVE_ADDRESS key

(UnorderedKey)

examples/CRISP/client/.env.example

[warning] 4-4: [UnorderedKey] The VITE_E3_PROGRAM_ADDRESS key should go before the VITE_ENCLAVE_API key

(UnorderedKey)


[warning] 4-4: [ValueWithoutQuotes] This value needs to be surrounded in quotes

(ValueWithoutQuotes)

⏰ 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). (6)
  • GitHub Check: ciphernode_integration_test (persist)
  • GitHub Check: ciphernode_integration_test (base)
  • GitHub Check: template_integration
  • GitHub Check: crisp_e2e
  • GitHub Check: rust_unit
  • GitHub Check: Build & Push Image
🔇 Additional comments (2)
examples/CRISP/client/src/pages/Landing/components/DailyPoll.tsx (1)

123-125: Button label update looks good.

Clear, consistent with isCastingVote state.

examples/CRISP/client/src/utils/proof-encoding.ts (1)

9-11: Confirm tuple shape matches nested args to encodeAbiParameters.

You pass values as [[...]], which implies a single tuple parameter. Ensure the parsed ABI represents one tuple param. If you intended three top‑level params, pass a flat array instead.

Would you confirm that parseAbiParameters('(bytes, bytes32[], bytes)') yields a single tuple param in your viem version? If not, either:

  • Use a flat args array: [bytesHex, inputs, encHex], or
  • Make the tuple explicit (e.g., 'tuple(bytes, bytes32[], bytes)').

Based on learnings

Comment thread examples/CRISP/.gitignore Outdated
Comment thread examples/CRISP/contracts/CRISPInputValidator.sol

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

  • server is not working due to .env configs (expect them at root level)
  • client not showing up the current round

@ctrlc03

ctrlc03 commented Oct 11, 2025

Copy link
Copy Markdown
Collaborator Author

@coderabbitai configuration

@coderabbitai

coderabbitai Bot commented Oct 11, 2025

Copy link
Copy Markdown
Contributor
CodeRabbit configuration
language: en-US
tone_instructions: ''
early_access: false
enable_free_tier: true
reviews:
  profile: chill
  request_changes_workflow: false
  high_level_summary: true
  high_level_summary_placeholder: '@coderabbitai summary'
  high_level_summary_in_walkthrough: false
  auto_title_placeholder: '@coderabbitai'
  auto_title_instructions: ''
  review_status: true
  commit_status: true
  fail_commit_status: false
  collapse_walkthrough: false
  changed_files_summary: true
  sequence_diagrams: true
  estimate_code_review_effort: true
  assess_linked_issues: true
  related_issues: true
  related_prs: true
  suggested_labels: true
  auto_apply_labels: false
  suggested_reviewers: true
  auto_assign_reviewers: false
  in_progress_fortune: true
  poem: true
  labeling_instructions: []
  path_filters: []
  path_instructions: []
  abort_on_close: true
  disable_cache: false
  auto_review:
    enabled: true
    auto_incremental_review: true
    ignore_title_keywords: []
    labels: []
    drafts: false
    base_branches: []
    ignore_usernames: []
  finishing_touches:
    docstrings:
      enabled: true
    unit_tests:
      enabled: true
  pre_merge_checks:
    docstrings:
      mode: warning
      threshold: 80
    title:
      mode: warning
      requirements: ''
    description:
      mode: warning
    issue_assessment:
      mode: warning
    custom_checks: []
  tools:
    ast-grep:
      rule_dirs: []
      util_dirs: []
      essential_rules: true
      packages: []
    shellcheck:
      enabled: true
    ruff:
      enabled: true
    markdownlint:
      enabled: true
    github-checks:
      enabled: true
      timeout_ms: 90000
    languagetool:
      enabled: true
      enabled_rules: []
      disabled_rules: []
      enabled_categories: []
      disabled_categories: []
      enabled_only: false
      level: default
    biome:
      enabled: true
    hadolint:
      enabled: true
    swiftlint:
      enabled: true
    phpstan:
      enabled: true
      level: default
    phpmd:
      enabled: true
    phpcs:
      enabled: true
    golangci-lint:
      enabled: true
    yamllint:
      enabled: true
    gitleaks:
      enabled: true
    checkov:
      enabled: true
    detekt:
      enabled: true
    eslint:
      enabled: true
    flake8:
      enabled: true
    rubocop:
      enabled: true
    buf:
      enabled: true
    regal:
      enabled: true
    actionlint:
      enabled: true
    pmd:
      enabled: true
    cppcheck:
      enabled: true
    semgrep:
      enabled: true
    circleci:
      enabled: true
    clippy:
      enabled: true
    sqlfluff:
      enabled: true
    prismaLint:
      enabled: true
    pylint:
      enabled: true
    oxc:
      enabled: true
    shopifyThemeCheck:
      enabled: true
    luacheck:
      enabled: true
    brakeman:
      enabled: true
    dotenvLint:
      enabled: true
    htmlhint:
      enabled: true
    checkmake:
      enabled: true
    osvScanner:
      enabled: true
chat:
  art: true
  auto_reply: true
  integrations:
    jira:
      usage: auto
    linear:
      usage: auto
knowledge_base:
  opt_out: false
  web_search:
    enabled: true
  code_guidelines:
    enabled: true
    filePatterns: []
  learnings:
    scope: auto
  issues:
    scope: auto
  jira:
    usage: auto
    project_keys: []
  linear:
    usage: auto
    team_keys: []
  pull_requests:
    scope: auto
  mcp:
    usage: auto
    disabled_servers: []
code_generation:
  docstrings:
    language: en-US
    path_instructions: []
  unit_tests:
    path_instructions: []

@cedoor cedoor 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.

Should we get rid of the commented code in crisp.contracts.test.ts file? It's using Semaphore.

@ctrlc03 ctrlc03 force-pushed the chore/update-crisp branch from 5e1484e to 09e1262 Compare October 12, 2025 13:37
@vercel vercel Bot temporarily deployed to Preview – enclave-docs October 12, 2025 13:37 Inactive
@vercel vercel Bot temporarily deployed to Preview – crisp October 12, 2025 13:37 Inactive
@github-actions

Copy link
Copy Markdown
Contributor

License Header Check Failed

Some files are missing the required SPDX license header. Please add the following header to the beginning of all .js, .jsx, .nr, .rs, .sol, .ts, and .tsx files:

// SPDX-License-Identifier: LGPL-3.0-only
//
// This file is provided WITHOUT ANY WARRANTY;
// without even the implied warranty of MERCHANTABILITY
// or FITNESS FOR A PARTICULAR PURPOSE.

You can run ./scripts/check-license-headers.sh --fix locally to automatically add missing headers, then commit the changes.

Or run ./scripts/check-license-headers.sh to see which files need headers.

@ctrlc03

ctrlc03 commented Oct 12, 2025

Copy link
Copy Markdown
Collaborator Author
  • server is not working due to .env configs (expect them at root level)
  • client not showing up the current round

@0xjei server fix #837
for client check your .env and ensure it has the correct program address

@ctrlc03 ctrlc03 force-pushed the chore/update-crisp branch from 09e1262 to 23fff2f Compare October 12, 2025 13:38
@vercel vercel Bot temporarily deployed to Preview – crisp October 12, 2025 13:38 Inactive
@vercel vercel Bot temporarily deployed to Preview – enclave-docs October 12, 2025 13:38 Inactive
@ctrlc03 ctrlc03 requested review from 0xjei and cedoor October 12, 2025 13:38
@vercel vercel Bot temporarily deployed to Preview – crisp October 12, 2025 15:24 Inactive
@vercel vercel Bot temporarily deployed to Preview – enclave-docs October 12, 2025 15:24 Inactive
@ctrlc03 ctrlc03 mentioned this pull request Oct 13, 2025
@ctrlc03 ctrlc03 merged commit dc2e962 into dev Oct 13, 2025
21 checks passed
@ctrlc03 ctrlc03 deleted the chore/update-crisp branch October 13, 2025 10:59
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.

Crisp input validator add function to submit voters merkle tree root Crisp remove semaphore in favour of normal merkle tree

3 participants