chore: update template#1604
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 11 minutes and 54 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughAdds a ChangesLocalhost Deployment and Template Infrastructure Setup
Rust Directory Utility and VK Path Resolution Refactoring
SDK Circuit Validation Environment Split
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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: 1
🧹 Nitpick comments (1)
templates/default/scripts/setup.sh (1)
15-16: ⚡ Quick winUse
--lockedfor deterministic Cargo resolution in setup.This keeps template bootstrap reproducible and consistent with the later CLI build command.
Suggested patch
echo "Installing Cargo dependencies..." -cargo build +cargo build --locked🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@templates/default/scripts/setup.sh` around lines 15 - 16, The cargo build command in the setup script needs to include the --locked flag to ensure deterministic dependency resolution and keep template bootstrap reproducible and consistent with other build commands in the project. Modify the cargo build command to add the --locked flag so that it uses the exact versions specified in Cargo.lock.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@templates/default/package.json`:
- Around line 48-55: The chai dependency version 5.1.2 creates a major version
mismatch with `@types/chai` version 4.2.0 and is ESM-only, making it incompatible
with Hardhat's plugin ecosystem including `@nomicfoundation/hardhat-chai-matchers`
which requires Chai v4. Either downgrade the chai dependency from ^5.1.2 to ^4.x
to align with the `@types/chai` version and Hardhat's testing setup, or if full
ESM support is explicitly configured for this template, upgrade `@types/chai` to
^5.x to match the Chai v5 version. The preferred solution is to downgrade chai
to v4 unless the template has dedicated ESM configuration.
---
Nitpick comments:
In `@templates/default/scripts/setup.sh`:
- Around line 15-16: The cargo build command in the setup script needs to
include the --locked flag to ensure deterministic dependency resolution and keep
template bootstrap reproducible and consistent with other build commands in the
project. Modify the cargo build command to add the --locked flag so that it uses
the exact versions specified in Cargo.lock.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f3ecb404-7a17-47e4-b113-270beaa0ef01
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
packages/interfold-contracts/deployed_contracts.jsontemplates/default/package.jsontemplates/default/rust-toolchain.tomltemplates/default/scripts/setup.shtests/integration/interfold.config.yaml
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/interfold-sdk/src/circuits/assert-minimum-circuits.ts (1)
37-60:⚠️ Potential issue | 🔴 Critical | ⚡ Quick winDead code left over from previous implementation causes syntax errors.
Lines 37-60 contain orphaned code from the old implementation that should have been removed:
- Lines 37-38 have unmatched closing delimiters (
)and})- Lines 40-60 reference variables (
raw,committee,SDKError,ACTIVE_PRESET_PATH,SDK_CIRCUIT_COMMITTEE) that are no longer defined or imported in this fileThis will cause compilation/syntax errors.
🐛 Proposed fix: Remove leftover dead code
import('./assert-minimum-circuits-node').then( (m) => m.checkSdkMinimumCircuits(), (err) => { throw err }, ) } - ) - } - - let committee: string | undefined - try { - committee = JSON.parse(raw)?.committee as string | undefined - } catch { - throw new SDKError( - `Invalid JSON in ${ACTIVE_PRESET_PATH}. Rebuild with \`pnpm -C packages/interfold-sdk compile:circuits\`.`, - 'SDK_CIRCUIT_STAMP_INVALID', - ) - } - - if (committee !== SDK_CIRCUIT_COMMITTEE) { - throw new SDKError( - `SDK requires circuits built for committee "${SDK_CIRCUIT_COMMITTEE}" ` + - `(active preset is "${committee ?? 'unknown'}"). ` + - `Run: pnpm -C packages/interfold-sdk compile:circuits`, - 'SDK_CIRCUIT_COMMITTEE_MISMATCH', - ) - } - - checked = true -}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/interfold-sdk/src/circuits/assert-minimum-circuits.ts` around lines 37 - 60, Remove the entire dead code block that contains orphaned implementation from a previous version. This block includes the try-catch statement that attempts to parse JSON and assign to the committee variable, the if statement that checks committee against SDK_CIRCUIT_COMMITTEE, and the checked assignment at the end. These lines reference undefined variables (raw, SDKError, ACTIVE_PRESET_PATH, SDK_CIRCUIT_COMMITTEE) and contain unmatched closing delimiters at the beginning, all of which cause syntax errors. Delete all of this orphaned code entirely, ensuring the file is clean and only contains the current active implementation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@crates/init/src/file_utils.rs`:
- Around line 82-85: The remove_dir_except function returns Ok(()) when the path
exists but is not a directory, which masks an invalid state rather than failing
fast. Modify the guard clause to distinguish between these cases: when dir does
not exist, return Ok(()), but when dir exists and is not a directory, return an
error immediately so that invalid .interfold states are caught and reported at
the source rather than causing confusing failures downstream. This ensures
deterministic reset behavior.
In `@examples/CRISP/interfold.config.yaml`:
- Around line 16-21: Remove the duplicate bonding_registry key from the
configuration file. The YAML mapping contains two identical bonding_registry
entries with the same address and deploy_block values at lines 16-21. Delete one
of these duplicate key-value pairs to ensure the YAML structure is valid, as
YAML does not permit duplicate keys in mappings. Keep only a single
bonding_registry entry with its address and deploy_block configuration.
In `@packages/interfold-sdk/src/circuits/assert-minimum-circuits.ts`:
- Around line 29-35: The function assertSdkMinimumCircuits() is declared
synchronous but performs an async dynamic import via .then() callbacks, causing
errors in the promise callbacks to become unhandled rejections instead of
propagating to the caller. Fix this by either converting the async dynamic
import to a synchronous require() call (if CJS compatibility is acceptable) to
maintain the synchronous contract, or make the function async, update its return
type to return a Promise, and update all downstream callers in
user-data-encryption.ts and other locations to await the result.
---
Outside diff comments:
In `@packages/interfold-sdk/src/circuits/assert-minimum-circuits.ts`:
- Around line 37-60: Remove the entire dead code block that contains orphaned
implementation from a previous version. This block includes the try-catch
statement that attempts to parse JSON and assign to the committee variable, the
if statement that checks committee against SDK_CIRCUIT_COMMITTEE, and the
checked assignment at the end. These lines reference undefined variables (raw,
SDKError, ACTIVE_PRESET_PATH, SDK_CIRCUIT_COMMITTEE) and contain unmatched
closing delimiters at the beginning, all of which cause syntax errors. Delete
all of this orphaned code entirely, ensuring the file is clean and only contains
the current active implementation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 9f3b6370-7e19-4416-9941-279ddfd34c31
📒 Files selected for processing (12)
crates/init/src/file_utils.rscrates/init/src/lib.rsexamples/CRISP/interfold.config.yamlexamples/CRISP/packages/crisp-contracts/deployed_contracts.jsonpackages/interfold-contracts/ignition/modules/bfvDecryptionVerifier.tspackages/interfold-contracts/ignition/modules/bfvPkVerifier.tspackages/interfold-contracts/scripts/benchmarkGasFromRaw.tspackages/interfold-contracts/scripts/deployAndSave/bfvDecryptionVerifier.tspackages/interfold-contracts/scripts/deployAndSave/bfvPkVerifier.tspackages/interfold-contracts/scripts/utils.tspackages/interfold-sdk/src/circuits/assert-minimum-circuits-node.tspackages/interfold-sdk/src/circuits/assert-minimum-circuits.ts
Summary by CodeRabbit