fix: fail pk and plaintext ag err path [skip-line-limit]#1537
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThis PR adds correlation-tracked async compute error handling and explicit E3Failed terminal failures for DKG/public-key aggregation and threshold plaintext decryption aggregation, updates flow-trace docs, adds tests, and adds a dev test helper dependency. ChangesAggregation Explicit Failure Paths
Sequence DiagramsequenceDiagram
participant Agg as PublicKeyAggregator/ThresholdPlaintextAggregator
participant Worker as ComputeWorker
participant Event as E3 Event System
Agg->>Agg: Create ComputeRequest with CorrelationId
Agg->>Worker: Dispatch DkgAggregation or CalculateDecryption
Note over Worker: Compute step fails
Worker-->>Agg: ComputeRequestError
rect rgba(255, 100, 100, 0.5)
Agg->>Agg: handle_compute_request_error / fail_decryption_round (match correlation)
Agg->>Agg: Clear in-flight state (correlation, proofs, pending flags)
Agg->>Event: Emit E3Failed with failure reason
end
Event-->>Agg: Event published
Agg->>Agg: Round halted explicitly with clear failure signal
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly Related PRs
Suggested Reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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: 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 `@agent/flow-trace/04_DKG_AND_COMPUTATION.md`:
- Around line 47-52: The doc claims computation-stage failures from
ThresholdKeyshare (GenPkShareAndSkSss, GenEsiSss, CalculateDecryptionKey,
CalculateDecryptionShare) emit E3Failed, but the code currently propagates
errors via the ? operator into trap() producing EnclaveError and
ThresholdKeyshare also doesn't subscribe to ComputeRequestError; fix by wiring
these computation-response handlers to explicitly emit E3Failed events instead
of using ? into trap() and ensure ThresholdKeyshare subscribes to
ComputeRequestError; update the four handler implementations (functions handling
GenPkShareAndSkSss, GenEsiSss, CalculateDecryptionKey, CalculateDecryptionShare)
to convert errors into the E3Failed emission path, and add subscription for
ComputeRequestError in the ThresholdKeyshare setup so computation failures
trigger the E3Failed path rather than EnclaveError.
🪄 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: 0f300a69-6c5f-4e64-960b-0ce6f2acb056
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (5)
agent/flow-trace/00_INDEX.mdagent/flow-trace/04_DKG_AND_COMPUTATION.mdcrates/aggregator/Cargo.tomlcrates/aggregator/src/publickey_aggregator.rscrates/aggregator/src/threshold_plaintext_aggregator.rs
1e5d70d to
5767c25
Compare
close #1536
Summary by CodeRabbit
New Features
Bug Fixes
Documentation