Skip to content

chore: update support crate#1572

Merged
hmzakhalid merged 6 commits into
mainfrom
chore/zkvm-update
Jun 3, 2026
Merged

chore: update support crate#1572
hmzakhalid merged 6 commits into
mainfrom
chore/zkvm-update

Conversation

@hmzakhalid

@hmzakhalid hmzakhalid commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Added configurable Boundless offer parameters (pricing, timeouts, ramp-up, collateral) via config, CLI, and environment.
  • Documentation

    • Expanded E3 support guide with setup, workflow, webhook payload format, and Boundless parameter examples.
  • Bug Fixes / Improvements

    • Refined webhook delivery flow; improved logging, diagnostics, and request submission handling; BFV preset selection from env.
  • Chores

    • Updated container setup for zkVM tooling and adjusted build/test/config artifacts and constants.

@vercel

vercel Bot commented Jun 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
crisp Ready Ready Preview, Comment Jun 3, 2026 2:31pm
enclave-docs Ready Ready Preview, Comment Jun 3, 2026 2:31pm
enclave-enclave-dashboard Ready Ready Preview, Comment Jun 3, 2026 2:31pm

Request Review

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds optional Boundless offer parameters to config and startup, threads them into the host OfferParams builder and runtime submissions, refactors webhook delivery to use WebhookPayload, updates BFV/preset and dependency pins, adjusts container wiring, and expands E3 support documentation.

Changes

Boundless Offer Parameters & Webhook Payload Refactoring

Layer / File(s) Summary
Configuration schema and startup script integration
crates/config/src/program_config.rs, crates/support/scripts/container/start.sh, examples/CRISP/enclave.config.yaml, templates/default/enclave.config.yaml
BoundlessConfig extended with six optional offer param fields; startup script unsets and parses --boundless-* CLI flags and exports corresponding BOUNDLESS_* env vars; examples/templates document the new options.
Script argument construction and Docker setup
crates/support-scripts/src/program_risc0.rs, crates/support/Dockerfile
Program RISC0 start now builds owned String args and appends new boundless offer flags when present; Dockerfile creates /usr/local/bin/r0vm symlink and sets RISC0_SERVER_PATH.
Webhook payload enum refactoring
crates/support/app/src/main.rs
Webhook delivery API refactored to accept WebhookPayload enum; call_webhook POSTs the enum as JSON and returns response-body-backed errors on non-success.
Boundless host offer building and request submission
crates/support/host/src/lib.rs
Added env_opt_f64, env_opt_secs, and build_offer() to construct OfferParams from env; applied to pre-uploaded and runtime submission flows; expanded diagnostics and switched journal decoding to risc0_zkvm::serde::from_slice.
FHE parameter preset and dependency updates
crates/support/host/Cargo.toml, crates/support/program/Cargo.toml, crates/support/host/src/bin/profile_risc0.rs
e3-fhe-params dependency updated (new revs, abi-encoding feature); profile_risc0 now selects BfvPreset from BFV_PRESET env and constructs params accordingly.
Program library BFV decoding
crates/support/program/src/lib.rs
BFV parameter decoding now uses .expect("Failed to decode BFV params").
Runtime artifacts and test constants
crates/support/contracts/ImageID.sol, crates/support/tests/Elf.sol, examples/CRISP/packages/crisp-contracts/deployed_contracts.json
PROGRAM_ID, ELF program path constant, and deployed imageId updated to match new artifacts.
E3 support documentation expansion
crates/support/README.md
README rewritten with architecture diagram, webhook payload format, full E3 flow, Boundless offer parameters reference, and expanded build/development/testing instructions.

Sequence Diagram

sequenceDiagram
  participant Instigator
  participant SupportApp
  participant BoundlessHost
  participant StorageProvider
  participant Blockchain
  Instigator->>SupportApp: POST /run_compute (encrypted inputs, callback_url, env)
  SupportApp->>BoundlessHost: build_offer() + submit_request_onchain/submit_offchain (program_url, offer params)
  BoundlessHost->>StorageProvider: include program_url (when present)
  BoundlessHost->>Blockchain: submit_request_onchain (if onchain)
  BoundlessHost-->>SupportApp: request accepted / proof pending
  BoundlessHost->>SupportApp: webhook POST (WebhookPayload::Completed/Failed)
  SupportApp->>Blockchain: publish outputs on-chain (callback handling)
Loading

Estimated Code Review Effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly Related PRs

Suggested Reviewers

  • cedor
  • 0xjei
  • ryardley

Poem

🐰 I nibbled configs, flags, and logs tonight;

I tucked six tiny offers into env so tight;
Webhooks now hop with enums and cheer,
BFV presets hum when the moon is near,
Boundless bids, r0vm boots — a carrot-coded delight.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.71% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'chore: update support crate' is vague and generic, using non-descriptive language that does not convey meaningful information about the specific changes in the changeset. Consider a more specific title that captures the primary changes, such as 'chore: add boundless offer parameters and E3 support infrastructure' or 'chore: extend BoundlessConfig with auction parameters and update E3 documentation'.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/zkvm-update

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

🤖 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/support/app/src/main.rs`:
- Around line 36-39: The code is printing the entire webhook body (json_payload)
which for WebhookPayload::Completed contains hex-encoded ciphertext and proof;
instead stop printing the full payload and log only safe metadata: e3_id,
status, callback_url and byte/hex lengths (or presence) of ciphertext/proof.
Change the block around serde_json::to_string_pretty, json_payload and println!
calls to remove the full payload print and replace it with concise logs using
the WebhookPayload fields (e.g., payload.e3_id, payload.status and length
checks) so no raw ciphertext/proof is emitted to stdout.

In `@crates/support/host/src/lib.rs`:
- Around line 105-140: The build_offer() defaults in
crates/support/host/src/lib.rs must be updated to match the documented/example
defaults: change min_price to 0.001 ETH, max_price to 0.03 ETH, timeout to 1200
seconds, lock_timeout to 600 seconds, ramp_up to 120 seconds, and zkc to 5.0;
update the corresponding unwrap_or()/parse_ether() and unwrap_or() calls that
set min_price, max_price, timeout, lock_timeout, ramp_up, and zkc, and ensure
collateral is still computed from the updated zkc via parse_units(...) into
alloy_primitives::U256 before building OfferParams with OfferParams::builder().
- Around line 115-131: The build_offer() path currently unwraps many
environment-derived values (min_price, max_price, timeout, lock_timeout,
ramp_up, zkc, collateral) using parse_ether/parse_units/env_opt_f64/env_opt_secs
which can panic on bad input; change build_offer() to return Result<OfferParams,
ConfigError> (or appropriate error type), replace all unwraps with fallible
parsing that maps parse_ether/parse_units and env_opt_* errors into a clear
ConfigError, validate ranges (e.g. non-negative, not NaN, sensible bounds for
min_price/max_price and timeouts) and return Err when validation fails, and only
construct OfferParams from the validated parsed values so no panic can occur at
runtime.

In `@examples/CRISP/packages/crisp-contracts/deployed_contracts.json`:
- Line 290: The deployed_contracts.json imageId is out of sync with the contract
constant PROGRAM_ID; update the "imageId" value (currently "0x0ad904c...") to
match the PROGRAM_ID declared in ImageID.sol
(0xc36e34f0b40876593adc519e4cccf8795ec90e9bfef0a44f20be865e7cb7f0a2) so
localhost tooling points at the same guest image.
🪄 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: a65557e7-7399-44c8-97b8-46e70e350861

📥 Commits

Reviewing files that changed from the base of the PR and between a9ed545 and a9cbcb4.

⛔ Files ignored due to path filters (3)
  • crates/support/Cargo.lock is excluded by !**/*.lock
  • crates/support/methods/guest/Cargo.lock is excluded by !**/*.lock
  • examples/CRISP/.enclave/generated/contracts/ImageID.sol is excluded by !**/generated/**
📒 Files selected for processing (16)
  • crates/config/src/program_config.rs
  • crates/support-scripts/src/program_risc0.rs
  • crates/support/Dockerfile
  • crates/support/README.md
  • crates/support/app/src/main.rs
  • crates/support/contracts/ImageID.sol
  • crates/support/host/Cargo.toml
  • crates/support/host/src/bin/profile_risc0.rs
  • crates/support/host/src/lib.rs
  • crates/support/program/Cargo.toml
  • crates/support/program/src/lib.rs
  • crates/support/scripts/container/start.sh
  • crates/support/types/Cargo.toml
  • crates/support/types/src/lib.rs
  • examples/CRISP/enclave.config.yaml
  • examples/CRISP/packages/crisp-contracts/deployed_contracts.json

Comment thread crates/support/app/src/main.rs Outdated
Comment thread crates/support/host/src/lib.rs Outdated
Comment thread crates/support/host/src/lib.rs Outdated
Comment thread examples/CRISP/packages/crisp-contracts/deployed_contracts.json
Comment thread crates/support/host/src/bin/profile_risc0.rs Outdated
Comment thread crates/support/host/src/lib.rs

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

🤖 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/support/host/src/bin/profile_risc0.rs`:
- Around line 21-33: The BFV_PRESET parsing uses mismatched env string literals
and enum variant names; update the match on std::env::var("BFV_PRESET") to use
the canonical names expected by BfvPreset (e.g. "INSECURE_THRESHOLD_512" and
"SECURE_THRESHOLD_8192") and return the correct enum variants defined in
BfvPreset (e.g. BfvPreset::InsecureThreshold512 and
BfvPreset::SecureThreshold8192) or, simpler, call BfvPreset::from_name(&value) /
BfvPreset::from_name_opt(...) when Some(value) to delegate parsing to the preset
implementation; ensure the default branch also uses the correct default variant
(BfvPreset::InsecureThreshold512) and update the warning message to reflect the
canonical env name.
🪄 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: e7486c34-1858-4fed-bbf6-b35b95843455

📥 Commits

Reviewing files that changed from the base of the PR and between d758f85 and 353f5a2.

📒 Files selected for processing (6)
  • crates/config/src/program_config.rs
  • crates/support/README.md
  • crates/support/host/src/bin/profile_risc0.rs
  • examples/CRISP/enclave.config.yaml
  • templates/default/enclave.config.yaml
  • tests/integration/enclave.config.yaml
✅ Files skipped from review due to trivial changes (2)
  • tests/integration/enclave.config.yaml
  • crates/support/README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/config/src/program_config.rs

Comment thread crates/support/host/src/bin/profile_risc0.rs
@hmzakhalid hmzakhalid merged commit ed36927 into main Jun 3, 2026
34 checks passed
@github-actions github-actions Bot deleted the chore/zkvm-update branch June 11, 2026 03:24
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.

2 participants