chore: update support crate#1572
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughAdds optional Boundless offer parameters to config and startup, threads them into the host OfferParams builder and runtime submissions, refactors webhook delivery to use ChangesBoundless Offer Parameters & Webhook Payload Refactoring
Sequence DiagramsequenceDiagram
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)
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly Related PRs
Suggested Reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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: 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
⛔ Files ignored due to path filters (3)
crates/support/Cargo.lockis excluded by!**/*.lockcrates/support/methods/guest/Cargo.lockis excluded by!**/*.lockexamples/CRISP/.enclave/generated/contracts/ImageID.solis excluded by!**/generated/**
📒 Files selected for processing (16)
crates/config/src/program_config.rscrates/support-scripts/src/program_risc0.rscrates/support/Dockerfilecrates/support/README.mdcrates/support/app/src/main.rscrates/support/contracts/ImageID.solcrates/support/host/Cargo.tomlcrates/support/host/src/bin/profile_risc0.rscrates/support/host/src/lib.rscrates/support/program/Cargo.tomlcrates/support/program/src/lib.rscrates/support/scripts/container/start.shcrates/support/types/Cargo.tomlcrates/support/types/src/lib.rsexamples/CRISP/enclave.config.yamlexamples/CRISP/packages/crisp-contracts/deployed_contracts.json
There was a problem hiding this comment.
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
📒 Files selected for processing (6)
crates/config/src/program_config.rscrates/support/README.mdcrates/support/host/src/bin/profile_risc0.rsexamples/CRISP/enclave.config.yamltemplates/default/enclave.config.yamltests/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
Summary by CodeRabbit
New Features
Documentation
Bug Fixes / Improvements
Chores