Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Important Review skippedMore than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review. 113 files out of 295 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits. You can disable this status message by setting the WalkthroughThis update introduces a new "enclave-sdk" and "enclave-sdk-isomorphic" package architecture, replacing the former "commons" crate throughout the codebase. Numerous workflows and configurations are updated to support a new "hacknet" branch. The server and contract interaction logic is refactored to use more explicit configuration parameters. Documentation and new minimal Rust app modules are added. Changes
Sequence Diagram(s)sequenceDiagram
participant Server
participant Config
participant EnclaveContract
Server->>Config: Retrieve HTTP RPC URL, Private Key, Enclave Address
Server->>EnclaveContract: new(http_rpc_url, private_key, contract_address)
EnclaveContract-->>Server: Instance ready for blockchain interaction
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
* Add hacknet branch to actions and fix scoping * Run tests no matter what
… library (#414) * Add app entrypoint to program * Add architectural explanation * Extract EnclaveContract from CRISP into enclave-sdk * Differentiate between isomorphic libs and non-isomorphic libs * Add isomorphic package to Dockerfile
* Fix a couple of small bugs * Update examples/CRISP/apps/client/src/providers/Web3Provider.tsx Co-authored-by: гλ <contact@rudiyardley.com> * fix: emit correct timestamp * Update EVM Test * Formatting --------- Co-authored-by: гλ <contact@rudiyardley.com>
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (8)
.github/workflows/rust-ci.yml (1)
6-8: Consider centralizing branch triggers.To reduce duplication across multiple workflow files, use YAML anchors or a reusable workflow to define the
brancheslist (e.g.,mainandhacknet) in one place. This makes future additions or removals simpler and less error-prone..github/workflows/crisp-e2e.yaml (1)
6-9: Push trigger expanded tomainandhacknet
Broadening the push event to include bothmainand the newhacknetbranch aligns perfectly with the Phase 0 workflow.Once the hackathon stabilizes, you may consider adding path filters (e.g.,
examples/CRISP/**) or branch patterns to avoid unnecessary runs and speed up CI.examples/CRISP/apps/program/host/README.md (1)
3-3: Nit: Clarify Description Sentence.Consider rephrasing for readability:
- Exposes a function to run the computation found in `voting-core::fhe_processor` whilst also generating a risc0 proof assuming `risc0_dev_mode` is _not_ set. + Exposes a function to run the computation in `voting-core::fhe_processor` and generates a RISC0 proof when the `risc0_dev_mode` flag is not set.examples/CRISP/apps/server/src/server/blockchain/handlers.rs (2)
26-32: Avoid repeatedEnclaveContract::newinstantiation – extract a helperThe three-argument constructor is now invoked in almost every handler and CLI command. Building a new provider + signer stack for each call incurs network I/O (chain-ID discovery, nonce query, etc.) and allocates fresh objects that can’t benefit from connection pooling.
Consider adding a small factory/helper in
server::blockchain:pub async fn enclave_contract() -> Result<EnclaveContract> { EnclaveContract::new( &CONFIG.http_rpc_url, &CONFIG.private_key, &CONFIG.enclave_address, ) .await }Then call
let contract = enclave_contract().await?;.This keeps the call-sites concise, centralises error handling, and allows you later to add caching or retry logic in one place.
38-39: Shadowing two differentexpirationvariables is error-prone
expirationis first au64Unix timestamp, then re-declared as anInstant.
While legal, it hurts readability and invites bugs if the wrong one is used.- let expiration = e3_activated.expiration.to::<u64>(); + let expiration_ts = e3_activated.expiration.to::<u64>(); … - let expiration = Instant::now() - + (UNIX_EPOCH + Duration::from_secs(expiration)) + let expiration_instant = Instant::now() + + (UNIX_EPOCH + Duration::from_secs(expiration_ts)) … - sleep_until(expiration).await; + sleep_until(expiration_instant).await;Clear names (
*_ts,*_instant) make the intent unambiguous.Also applies to: 82-85, 90-91
packages/enclave-sdk-isomorphic/Cargo.toml (1)
16-19: Feature matrix clarification
default = ["host"]pulls inalloy/full, which in turn re-enables most of Alloy’s default features and dependencies (tokio, reqwest, etc.). If the WASM guest side is intended to compile with the default feature set turned off, consider:[features] default = [] host = ["alloy/full"] guest = ["alloy/dyn-abi", "alloy/rlp", "alloy/serde"]Downstream crates can then opt-in explicitly (
features=["host"]).
Otherwise, building for the guest without--no-default-featureswill fail.examples/CRISP/apps/server/src/cli/commands.rs (2)
9-13: TODO still present – consolidate configuration before GA
CONFIG(CLI) andSERVER_CONFIG(server) hold overlapping fields; this duplication has already caused an incorrect URL indecrypt_and_publish_result(usesCONFIG.enclave_address).
Before the hackathon ends, merge them into a single source of truth (e.g.,crisp::config) or introduce a trait/struct that both CLI and server load.
50-56: Contract-creation boilerplate repeated 4×Same recommendation as for
handlers.rs: wrap the three-parameter call in a small async helper to DRY up the CLI code.async fn contract() -> anyhow::Result<EnclaveContract> { EnclaveContract::new( &SERVER_CONFIG.http_rpc_url, &SERVER_CONFIG.private_key, &SERVER_CONFIG.enclave_address, ) .await }Besides readability, this will make it trivial to inject mocks in unit tests.
Also applies to: 111-117, 161-167, 208-214
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
⛔ Files ignored due to path filters (9)
examples/CRISP/apps/program/Cargo.lockis excluded by!**/*.lockexamples/CRISP/apps/program/core/Cargo.lockis excluded by!**/*.lockexamples/CRISP/apps/program/host/Cargo.lockis excluded by!**/*.lockexamples/CRISP/apps/program/methods/guest/Cargo.lockis excluded by!**/*.lockexamples/CRISP/apps/server/Cargo.lockis excluded by!**/*.lockexamples/CRISP/apps/wasm-crypto/Cargo.lockis excluded by!**/*.lockpackages/ciphernode/Cargo.lockis excluded by!**/*.lockpackages/enclave-sdk-isomorphic/Cargo.lockis excluded by!**/*.lockpackages/enclave-sdk/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (41)
.deleteme(1 hunks).github/workflows/ci.yml(1 hunks).github/workflows/crisp-e2e.yaml(1 hunks).github/workflows/ec2-deployment.yml(1 hunks).github/workflows/integration.yml(1 hunks).github/workflows/rust-ci.yml(1 hunks)examples/CRISP/apps/client/src/providers/Web3Provider.tsx(1 hunks)examples/CRISP/apps/program/Cargo.toml(1 hunks)examples/CRISP/apps/program/README.md(1 hunks)examples/CRISP/apps/program/app/Cargo.toml(1 hunks)examples/CRISP/apps/program/app/src/main.rs(1 hunks)examples/CRISP/apps/program/core/Cargo.toml(1 hunks)examples/CRISP/apps/program/core/src/lib.rs(1 hunks)examples/CRISP/apps/program/host/README.md(1 hunks)examples/CRISP/apps/server/Cargo.toml(2 hunks)examples/CRISP/apps/server/src/cli/commands.rs(5 hunks)examples/CRISP/apps/server/src/server/blockchain/handlers.rs(7 hunks)examples/CRISP/apps/server/src/server/blockchain/mod.rs(0 hunks)examples/CRISP/apps/server/src/server/blockchain/sync.rs(2 hunks)examples/CRISP/apps/server/src/server/mod.rs(1 hunks)examples/CRISP/apps/server/src/server/routes/rounds.rs(2 hunks)examples/CRISP/apps/server/src/server/routes/voting.rs(2 hunks)examples/CRISP/apps/wasm-crypto/Cargo.toml(2 hunks)examples/CRISP/apps/wasm-crypto/src/lib.rs(1 hunks)packages/ciphernode/Cargo.toml(1 hunks)packages/ciphernode/Dockerfile(1 hunks)packages/ciphernode/fhe/Cargo.toml(1 hunks)packages/ciphernode/fhe/src/utils.rs(1 hunks)packages/ciphernode/test_helpers/Cargo.toml(1 hunks)packages/ciphernode/test_helpers/src/bin/fake_encrypt.rs(1 hunks)packages/ciphernode/test_helpers/src/bin/pack_e3_params.rs(1 hunks)packages/ciphernode/tests/Cargo.toml(1 hunks)packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs(1 hunks)packages/enclave-sdk-isomorphic/Cargo.toml(1 hunks)packages/enclave-sdk/Cargo.toml(1 hunks)packages/enclave-sdk/src/evm/contracts.rs(2 hunks)packages/enclave-sdk/src/evm/mod.rs(1 hunks)packages/enclave-sdk/src/lib.rs(1 hunks)packages/evm/contracts/Enclave.sol(1 hunks)packages/evm/deployments/sepolia/NaiveRegistryFilter.json(2 hunks)packages/evm/test/Enclave.spec.ts(2 hunks)
💤 Files with no reviewable changes (1)
- examples/CRISP/apps/server/src/server/blockchain/mod.rs
🧰 Additional context used
🧬 Code Graph Analysis (5)
packages/ciphernode/test_helpers/src/bin/fake_encrypt.rs (1)
packages/enclave-sdk-isomorphic/src/bfv/mod.rs (1)
build_bfv_params_arc(68-82)
examples/CRISP/apps/program/core/src/lib.rs (1)
packages/enclave-sdk-isomorphic/src/bfv/mod.rs (1)
deserialize_bfv_params_arc(120-122)
packages/ciphernode/test_helpers/src/bin/pack_e3_params.rs (1)
packages/enclave-sdk-isomorphic/src/bfv/mod.rs (2)
build_bfv_params_arc(68-82)encode_bfv_params(152-154)
packages/ciphernode/fhe/src/utils.rs (1)
packages/enclave-sdk-isomorphic/src/bfv/mod.rs (1)
build_bfv_params_arc(68-82)
examples/CRISP/apps/wasm-crypto/src/lib.rs (1)
packages/enclave-sdk-isomorphic/src/bfv/mod.rs (1)
build_bfv_params_arc(68-82)
🔇 Additional comments (42)
.github/workflows/rust-ci.yml (1)
7-8: Branch trigger updated to includehacknet.The CI workflow will now run on pushes to the
hacknetbranch alongsidemain, satisfying the hackathon integration objective..github/workflows/ci.yml (1)
22-23: Includehacknetin push triggers.The CI workflow will now run on
pushevents to thehacknetbranch as well asmain, ensuring EVM CI coverage for hacknet development..github/workflows/integration.yml (1)
12-13: Trigger integration workflow onhacknet.Adding
hacknetunderbranchesfor thepushevent aligns integration testing with the hackathon branch..github/workflows/ec2-deployment.yml (2)
5-7: Addhacknetto deployment push triggers.Including the
hacknetbranch here ensures Docker images are built and pushed whenever hacknet code under the specified paths changes.
13-15: Addhacknetto deployment PR triggers.By adding
hacknetunderpull_requestbranches, pull requests against hacknet will also validate the build and deployment pipeline..github/workflows/crisp-e2e.yaml (1)
4-4: Good addition of manual trigger
Includingworkflow_dispatchenables on-demand runs of the E2E suite, which is especially useful during a hackathon for quick validations without needing new commits.examples/CRISP/apps/program/core/src/lib.rs (1)
2-2:Details
✅ Verification successful
Ensure dependency alignment with new import
Thedeserialize_bfv_params_arcimport now points toenclave_sdk_isomorphic::bfv. Confirm that theenclave-sdk-isomorphiccrate is declared inexamples/CRISP/apps/program/core/Cargo.toml(with correct version/features) to avoid build errors.
🏁 Script executed:
#!/bin/bash # Verify that enclave-sdk-isomorphic is added as a dependency grep -R "^enclave-sdk-isomorphic" -n examples/CRISP/apps/program/core/Cargo.tomlLength of output: 218
Dependency Verified
Theenclave-sdk-isomorphiccrate is declared inexamples/CRISP/apps/program/core/Cargo.toml(line 10) withdefault-features = false features = ["guest"]This satisfies the
deserialize_bfv_params_arcimport—no further changes required.packages/ciphernode/test_helpers/src/bin/pack_e3_params.rs (1)
2-2: Import paths updated correctly
Switching toenclave_sdk_isomorphic::bfv::{build_bfv_params_arc, encode_bfv_params}aligns with the new SDK package and matches the updated crate dependencies.packages/ciphernode/test_helpers/src/bin/fake_encrypt.rs (1)
3-3: Import path adjustment is correct
Replacingcommons::bfvwithenclave_sdk_isomorphic::bfv(including theparams::SET_2048_1032193_1constant) is consistent with the refactoring.examples/CRISP/apps/program/Cargo.toml (1)
3-3: Workspace members updated
Adding"app"to thememberslist correctly includes the newappcrate underexamples/CRISP/apps/program/app.packages/ciphernode/test_helpers/Cargo.toml (1)
17-17: Dependency switched to enclave-sdk-isomorphic
Thecommonspath dependency has been replaced withenclave-sdk-isomorphic = { path = "../../enclave-sdk-isomorphic" }, aligning the test helper crate with the new SDK.packages/ciphernode/fhe/Cargo.toml (1)
21-21: Dependency Addition: Addenclave-sdk-isomorphic.You’ve introduced a new path dependency on
enclave-sdk-isomorphicfor BFV utilities. The relative path (../../enclave-sdk-isomorphic) looks correct frompackages/ciphernode/fhe. Verify that this crate is part of the root workspace (if you want unified versioning) and that itsCargo.tomlnamefield matches the import (enclave_sdk_isomorphic).packages/ciphernode/fhe/src/utils.rs (1)
2-2: Import Path Updated for BFV Parameters Builder.The import of
build_bfv_params_arcnow correctly referencesenclave_sdk_isomorphic::bfvinstead of the oldcommonscrate. This change preserves the existing API surface and should be low-risk.examples/CRISP/apps/wasm-crypto/src/lib.rs (1)
5-5:Details
✅ Verification successful
Align BFV Imports with New Crate.
You’ve updated the imports for
build_bfv_params_arcandSET_2048_1032193_1to point atenclave_sdk_isomorphic::bfv. Ensure that theparamssubmodule publicly re-exportsSET_2048_1032193_1as expected.Run this to confirm:
🏁 Script executed:
#!/bin/bash grep -R "pub const SET_2048_1032193_1" -n packages/enclave-sdk-isomorphic/src/bfv/params.rsLength of output: 176
🏁 Script executed:
#!/bin/bash set -e # Search for the definition of SET_2048_1032193_1 across the repository rg -n "pub const SET_2048_1032193_1"Length of output: 158
🏁 Script executed:
#!/bin/bash set -e echo "=== Files and directories in bfv module ===" find packages/enclave-sdk-isomorphic/src/bfv -maxdepth 1 -printf "%f\n" echo -e "\n=== Top of bfv/mod.rs ===" head -n 200 packages/enclave-sdk-isomorphic/src/bfv/mod.rsLength of output: 6324
🏁 Script executed:
#!/bin/bash set -e echo "=== Root files in packages/enclave-sdk-isomorphic/src ===" find packages/enclave-sdk-isomorphic/src -maxdepth 1 -type f -printf "%f\n" echo -e "\n=== Checking for 'pub mod bfv' in lib.rs ===" grep -n "pub mod bfv" -n packages/enclave-sdk-isomorphic/src/lib.rs || echo "No 'pub mod bfv' found in lib.rs"Length of output: 414
✅ BFV Imports Are Correct
The
enclave_sdk_isomorphic::bfv::paramsmodule publicly definesSET_2048_1032193_1, andbuild_bfv_params_arcis exposed in thebfvmodule. Your import inexamples/CRISP/apps/wasm-crypto/src/lib.rsis valid—no further changes required.examples/CRISP/apps/program/host/README.md (1)
1-1: Header Looks Good.The section title
# Risc0 Hostis clear and consistent with other READMEs.packages/ciphernode/Cargo.toml (1)
47-47:Details
❓ Verification inconclusive
Crate Version Bump:
alloy = "0.8.3".The update to
alloy = "0.8.3"(withnode-bindingsandfull) matches related packages. Please run the ciphernode integration tests to catch any regressions from this version bump.
🏁 Script executed:
#!/bin/bash # Verify ciphernode builds and tests pass after bump cargo test -p ciphernode -- --nocaptureLength of output: 137
ACTION REQUIRED: Manually run ciphernode tests after bumping
alloyto 0.8.3The
alloydependency inpackages/ciphernode/Cargo.toml(line 47) was updated to:alloy = { version = "0.8.3", features = ["node-bindings", "full"] }Please verify there are no regressions by running the integration tests locally:
cd packages/ciphernode cargo test -p ciphernode -- --nocapturepackages/ciphernode/tests/Cargo.toml (1)
33-33:Details
❌ Incorrect review comment
Ensure workspace includes the new crate
Confirm thatenclave-sdk-isomorphicis declared in the root Cargo workspace (members) so that this path dependency is recognized during builds.
🏁 Script executed:
#!/bin/bash # Check if the root workspace contains enclave-sdk-isomorphic grep -R "enclave-sdk-isomorphic" Cargo.tomlLength of output: 87
🏁 Script executed:
#!/bin/bash # List all Cargo.toml manifests in the repo (up to depth 3) echo "=== Found Cargo.toml files ===" find . -maxdepth 3 -type f -name Cargo.toml # Identify which one defines the workspace echo -e "\n=== Workspace declarations ===" grep -R "\[workspace\]" -n . # If a workspace file is found, show its members block for inspection WS_FILE=$(grep -R "\[workspace\]" -l . | head -n1) if [ -n "$WS_FILE" ]; then echo -e "\n=== members in $WS_FILE ===" sed -n '/members = \[/,/\]/p' "$WS_FILE" else echo -e "\nNo workspace manifest detected." fiLength of output: 973
#!/bin/bash # Inspect workspace members in packages/ciphernode/Cargo.toml echo "=== packages/ciphernode/Cargo.toml ===" sed -n '1,200p' packages/ciphernode/Cargo.toml echo -e "\n=== members block ===" grep -n 'members' -n packages/ciphernode/Cargo.toml -A 20 | sed -n '/members = \[/,/\]/p'
No root Cargo workspace detected
I didn’t find aCargo.tomlat the repository root declaring a[workspace], so there’s no workspace to update. The explicit path dependency inpackages/ciphernode/tests/Cargo.tomlwill still be resolved by Cargo without needing to list it as a workspace member. If you do want a unified workspace, you’ll need to add a rootCargo.tomlwith a[workspace] members = […]block; otherwise, this review comment can be ignored.Likely an incorrect or invalid review comment.
packages/ciphernode/tests/tests/test_aggregation_and_decryption.rs (1)
9-9: Approve import path update
The import ofSET_2048_1032193_1fromenclave_sdk_isomorphic::bfv::paramscorrectly reflects the new crate structure and naming conventions.examples/CRISP/apps/program/app/Cargo.toml (1)
1-7: Initial Cargo.toml forapppackage looks correct
Definingname,version.workspace, andedition.workspacewithout external dependencies is acceptable for a minimal example.packages/enclave-sdk/src/lib.rs (1)
1-1: Exposeevmmodule in public API
Addingpub mod evm;correctly integrates the new EVM submodule into the SDK's public interface.packages/ciphernode/Dockerfile (1)
46-48:Details
❌ Incorrect review comment
Verify Docker COPY paths for new SDK crates
Ensure that theseCOPYinstructions placeenclave-sdkandenclave-sdk-isomorphicat the exact relative paths expected by the ciphernode crate’sCargo.toml. Otherwise, the build may fail due to missing dependencies.
🏁 Script executed:
#!/bin/bash # Verify that ciphernode’s path dependencies match the copied directories grep -R 'path *= *"../enclave-sdk"' packages/ciphernode/Cargo.toml grep -R 'path *= *"../enclave-sdk-isomorphic"' packages/ciphernode/Cargo.tomlLength of output: 148
🏁 Script executed:
#!/bin/bash # Show any enclave-related dependencies and path entries in ciphernode's Cargo.toml grep -n 'enclave' -n packages/ciphernode/Cargo.toml || true grep -n 'path' -n packages/ciphernode/Cargo.toml || trueLength of output: 839
No path dependencies for enclave-sdk in ciphernode crate
Thepackages/ciphernode/Cargo.tomldoes not referenceenclave-sdkorenclave-sdk-isomorphic, so these COPY steps appear redundant. Please confirm whether you actually need to bundle those packages in this image; if not, remove lines 46–48 frompackages/ciphernode/Dockerfile:- COPY ./packages/enclave-sdk ../enclave-sdk - COPY ./packages/enclave-sdk-isomorphic ../enclave-sdk-isomorphicLikely an incorrect or invalid review comment.
packages/enclave-sdk/src/evm/mod.rs (1)
1-1: Well-structured module organizationAdding a public contracts module aligns with good software architecture principles. This change helps organize contract-related code and makes the interface more explicit by moving away from global configuration to parameter-based initialization.
examples/CRISP/apps/wasm-crypto/Cargo.toml (2)
19-19: Appropriate dependency replacementReplacing the
commonspackage withenclave-sdk-isomorphicaligns with the broader refactoring effort across the codebase for better modularization.
33-33: LGTM: Proper crate type configuration for WASMThe
cdylibandrlibcrate types are appropriate for a WASM library, allowing both dynamic linking (for web use) and static linking (for testing and integration).examples/CRISP/apps/server/src/server/mod.rs (1)
2-2: Good modularization by exposing the config moduleMaking the config module public is appropriate as it supports the architectural changes where configuration is centralized and accessed throughout the server codebase. This enables more consistent configuration management for blockchain contract interactions and other server functionalities.
examples/CRISP/apps/program/core/Cargo.toml (1)
10-10: Dependency migration to new SDK structure - LGTMThis change replaces the previous
commonsdependency with the newenclave-sdk-isomorphicpackage, aligning with the broader refactoring initiative. The path looks correct and the feature selection (disabling defaults, enabling only "guest") is appropriate for this module.examples/CRISP/apps/server/Cargo.toml (2)
29-29: Minor version bump for alloy - LGTMUpdating from 0.8 to 0.8.3 is a patch version upgrade that likely includes bug fixes or minor improvements while maintaining API compatibility.
40-41: SDK structure reorganization - LGTMReplacing the
commonsdependency with separateenclave-sdkandenclave-sdk-isomorphicpackages aligns with the broader architectural refactoring to improve modularity. The paths are correct for the new package structure.packages/evm/contracts/Enclave.sol (1)
202-206: Improved code clarity with local variable - LGTMThis refactoring introduces a local variable
expiresAtto store the expiration timestamp before assigning it to state and using it in the event emission. This improves readability and reduces the risk of inconsistencies if future modifications are needed.examples/CRISP/apps/server/src/server/routes/voting.rs (1)
1-14: Updated imports for centralized contract interactions - LGTMReorganizing imports to use
enclave_sdk::evm::contracts::EnclaveContractinstead of a local module aligns with the broader refactoring initiative to centralize contract interactions.examples/CRISP/apps/server/src/server/blockchain/sync.rs (1)
14-14: Import path updated as part of SDK restructuringThe import path for
EnclaveContractandE3 as ContractE3has been updated from the localsuper::relayermodule to the externalenclave_sdk::evm::contractscrate path. This is consistent with the codebase-wide migration from the local commons crate to the new enclave-sdk structure.examples/CRISP/apps/client/src/providers/Web3Provider.tsx (1)
26-32: Improved network configuration for different environmentsThe updated options configuration now explicitly sets the initial chain ID for different environments:
- Development:
initialChainId: 0to prevent automatic network switching during testing- Production:
initialChainId: sepolia.idto ensure connection to the Sepolia networkThis change improves the consistency of network connections across environments.
packages/enclave-sdk/Cargo.toml (2)
8-12:Details
✅ Verification successful
Dependencies updated and expanded
The dependencies have been reorganized and expanded with:
- Explicit versioning for
anyhow(1.0.86)- Addition of
alloywith features for EVM interaction- Addition of
eyrefor error handlingThese changes support the new SDK structure and blockchain interaction capabilities.
🏁 Script executed:
#!/bin/bash # Check for version consistency of the alloy package across the project rg "alloy = \{" --type tomlLength of output: 741
Approve dependency updates – versions are consistent across the workspace
The dependency block in
packages/enclave-sdk/Cargo.tomlhas been updated as follows:
anyhow = "1.0.86"(explicit pin)fhe-traitsandfhe_rspulled from thefeature/greco-integrationbranchalloy = "0.8.3"with["full", "rpc-types-eth"]eyre = "0.6.12"Verification confirms that
alloy = "0.8.3"is used uniformly in all relevantCargo.tomlfiles (enclave-sdk, ciphernode, examples), and other crates either refer to it via the workspace. No inconsistencies found. Ready to merge.
2-2:Details
✅ Verification successful
Package renamed from "commons" to "enclave-sdk"
This rename is part of the broader architectural restructuring of the SDK components. Ensure that all imports across the codebase have been updated to use the new package name.
🏁 Script executed:
#!/bin/bash # Check if there are any remaining references to the old "commons" package rg "use commons" --type rustLength of output: 30
I’ll perform a broader search for any lingering “commons” references across all files to be certain.
#!/bin/bash # Search for any references to "commons" in the entire codebase rg "commons" -n
I’ll perform a comprehensive search for any remaining “commons” references across all files.
🏁 Script executed:
#!/bin/bash # Search for any occurrences of "commons" in code and manifests rg "commons" -nLength of output: 15
All references to
commonshave been removed
No occurrences of “commons” were found across the codebase. The rename toenclave-sdkis complete and all imports have been updated.examples/CRISP/apps/server/src/server/routes/rounds.rs (2)
10-11: Updated import paths for SDK restructuringThe imports have been updated to use the new package structure:
commons::bfv→enclave_sdk_isomorphic::bfv- Local module →
enclave_sdk::evm::contractsforEnclaveContractThis change is consistent with the codebase-wide migration to the new enclave-sdk architecture.
118-123: Contract initialization updated to use explicit configurationSimilar to the changes in the sync.rs file, the
EnclaveContractinitialization has been updated to use the new three-parameter async constructor that takes explicit HTTP RPC URL, private key, and enclave address from the server configuration. This makes the contract configuration more explicit and maintainable.packages/evm/test/Enclave.spec.ts (1)
830-830: Test updated to accommodate contract implementation changesThe test for E3Activated event has been relaxed to use
anyValuefor the second argument instead of asserting a specific value for expiration. This aligns with the refactoring in the Enclave contract where expiration timestamp handling was modified.packages/evm/deployments/sepolia/NaiveRegistryFilter.json (1)
2-2: Updated deployment metadata for NaiveRegistryFilter contractThis reflects a new deployment of the NaiveRegistryFilter contract on Sepolia (increasing deployment count from 2 to 3). The contract address, transaction hash, block details, and registry address have all been updated accordingly.
Also applies to: 300-304, 307-309, 312-315, 322-323, 326-328, 334-335, 338-339, 345-345, 347-347
examples/CRISP/apps/program/README.md (1)
1-31: Clear documentation of the Program component architectureThe README provides a succinct overview of the Program component's responsibilities and includes a helpful Mermaid diagram illustrating its role in the system architecture. This documentation clearly explains how this component interacts with the blockchain, RISC-0 computations, and event persistence - making it easier for developers to understand the system design.
packages/enclave-sdk/src/evm/contracts.rs (2)
54-54: Improved API design with explicit configuration parametersThe
EnclaveContract::newconstructor has been refactored to accept explicit parameters (http_rpc_url,private_key, andcontract_address) instead of relying on a global configuration object. This change:
- Makes the contract initialization more explicit and customizable
- Removes global state dependencies
- Allows multiple contract instances to connect to different chains or with different credentials
The
CRISPProvidertype alias is now public to support this improved interface.Also applies to: 73-84
73-90:Details
✅ Verification successful
Verify that error handling is sufficient for the new constructor
While the refactoring improves the API design, ensure that consumer code properly handles potential errors from parsing the private key or contract address strings.
🏁 Script executed:
#!/bin/bash # Check how the EnclaveContract is instantiated and error handling in consumer code # Look for instances of EnclaveContract::new being called rg -A 5 "EnclaveContract::new" --type rustLength of output: 5094
Error handling for
EnclaveContract::newis already in place
All usages in the examples (e.g.,commands.rs,routes/*.rs,blockchain/*.rs) invokeEnclaveContract::new(...).await?;which propagates any parse errors for the private key or contract address. No additional error‐handling changes are needed.
examples/CRISP/apps/server/src/server/blockchain/handlers.rs (1)
132-133: Possible lost status update whenvote_count == 0
e3.statusis set to"Finished"and the updated object is re-inserted, but the earlier call toupdate_e3_statusalready wrote"Expired".
At high concurrency another task might have modified the record between these two operations, and this blind overwrite would silently drop those changes.If the only field changing here is
status, prefer calling the dedicated helper again (update_e3_status(e3_id, "Finished").await?) or usingGLOBAL_DB.update_if/GLOBAL_DB.cas(compare-and-swap) if available to avoid a race.
* Fix version * Update lockfile
* Fix submodules * Add gitignore * Update gitignore * Update support build * Update control scripts to use enclave rev * revertme * Coordinate github build * Add comment * Add support build * Add feature to avoid risc0 compilation * Update scripts and caches * Add support ctl * Add simple test to program * Update dockerignore * Try alter dockerignore * Add shell functionality * Add fixtures * Update curl test * Move to root support curl_test * Use correct fixtures path * Update risc0 in Dockerfile * Fix wrong version * Update docker build script * Update pnpm lock * Add ImageID to workspace template gitignore * Update gitignore * Ensure we are running in dev mode
Attempt to use the branch commit
* attempts to fix docker support image tags * attempts to fix docker support image tags pt2
* Clean up when things go wrong * Update deps * Accommodate macOs * Remove bail * Detect bsd sed * Add comments * Add logging
* Copy and mkdirp passes * File filtering works * Incorporate fs copy * Fix sed issue * Update Dockerfiles * Unnecessary clone
* Use host-gateway to enable cross platform callback networking * Listen on ipv4 * Add comment
* Add enclave purge * Remove redundant file * Make it explicit which package we are calling * Update cli structure
* Rollback metamask version * Fix Computation Flow * Start Script * Tutorial * Crisp Updates * Remove takeaways * fix lockfile merge --------- Co-authored-by: гλ <contact@rudiyardley.com>
Update Dockerfile Add Missing Packages Use Correct Addresses
* Build sdk package so that hardhat uses a separate tsconfig * Linting * Linting * Update moduleResolution * Update packages * Ensure that LSP can respect the correct tsconfig * Tidy up eslint * Tidy up eslint * Add package to Dockerfile * Fix up issues with docker build for ciphernodes * Update Dockerfile * Fix up warnings * Linting * Fix warnings * Update viem dependency * Get test to pass * Add rust to workflow * Add compiling sdk and lwasm to be part of the build process * Add wasm-pack * Install with wasm * Rename * Fix pnpm version * Test template integration * update names * Lowercase * Actually fail when failing * Use lines * Build sdk before testing * linting * linting * Add submodules to template * Add submodules recursive to template * Add permissions to folders * Ensure ImageID.sol is writable * Attempt to open up permissions on ImageID.sol * Attempt to open up permissions on ImageID.sol
* Add e3-program-server * Add package to Dockerfiles * Provide strategy * Tidy up support code * Create cargo project * Fix bad cargo toml * Update * Use json feature * Update ref * Update ref * update to rev * Update script * udpate dependency * update script * Fix script * Fix script * Update all commits * Update e3 program server * Update e3 program server * Update rev pin * Dont need scriptdir * Get init to copy dev folder * Update scripts * Update config * update rev * Fix test * Fix config parsing * Fix up script * Remove redundant CI steps * Add signal file to get correct script ordering * Update scripts * Ensure no callback_url_rewrite * Add debugging * Update support rev * Remove logging * Update revs * Update actions * Update actions * add target to cache * Disable all actions * Attempt at paralellization * Remove compilation from test * Tidy up caching * Use 1.85.1 * Use installed enclave for integration test * Refactor to include integration * Ensure folders are downloaded * Use whole target folder * Update fns * Add target folder * Update caches * Fix waitons * Incorporate other tests into ci yaml * use ci name so it is rquired
* Replace old references * Update lock * Fix up build * Fix import issues * --wip-- [skip ci] * Fix filter ethers naming conflict * linting * use tsx instead of ts-node * Update bundle settings * Use universal wasm * Update client * Remove from cargo workspace * Remove wasm build stage from client * Fix bad path * Use tsup to solve bundling issues * Add packages to Dockerfile * Use build instead of just evm:build * Remove redundant stage and add enclave-sdk dist folder * Build SDK instead of everything * update dependencies * make config a module * Add script to prebuild * Incorporate tsup into @gnosis-guild/enclave * Update linting * Remove redundant comments * Tidy up scripts * Remove redundant file * Fix bad task name * Ensure types are created first * update external list * Remove redundant file * Add documentation * Add docs for wasm usage * Readme formatting * Fix spacing
* Add test for enclave init * Name tasks appropriately * Exit with code 1 * Add sdk package to init * Add pnpm * Add version * Wrong position * Add version to all packages * Update release * Update version * Make packages public * Add typechain as dependency to compiling ts * Remove incorrect dependency * Remove pnpm lock * Add current branch in init test * Use the sha * Calculate branch
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
Whats the point of this
Working with hacknet
@coderabbit reviewSummary by CodeRabbit
New Features
enclave-sdk-isomorphic, and added supporting configuration and documentation files.Bug Fixes
Refactor
commonspackage withenclave-sdkandenclave-sdk-isomorphicacross multiple components.Documentation
Chores