Skip to content

fix(zk-prover): proof request failure bridges#1532

Merged
0xjei merged 6 commits into
mainfrom
fix/e3-halt-hlt-004
May 18, 2026
Merged

fix(zk-prover): proof request failure bridges#1532
0xjei merged 6 commits into
mainfrom
fix/e3-halt-hlt-004

Conversation

@hmzakhalid

@hmzakhalid hmzakhalid commented May 6, 2026

Copy link
Copy Markdown
Collaborator

closes #1533

Summary by CodeRabbit

  • Bug Fixes

    • Proof-generation and local proof-signing failures are now surfaced as terminal failure events (no longer silently suppressed), with distinct failure signals for DKG-path and decryption-path proofs.
  • Documentation

    • Flow-trace docs updated to reflect the corrected failure notification behavior and mapping across proof paths.
  • Tests

    • Added unit tests verifying correct failure events are emitted and pending state is cleared.

Review Change Stack

@vercel

vercel Bot commented May 6, 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 May 18, 2026 0:32am
enclave-docs Ready Ready Preview, Comment May 18, 2026 0:32am

Request Review

@coderabbitai

coderabbitai Bot commented May 6, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e4485a28-269f-4791-bb10-89104943bf6f

📥 Commits

Reviewing files that changed from the base of the PR and between 12c4715 and ad9145f.

📒 Files selected for processing (2)
  • agent/flow-trace/00_INDEX.md
  • agent/flow-trace/04_DKG_AND_COMPUTATION.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • agent/flow-trace/04_DKG_AND_COMPUTATION.md

📝 Walkthrough

Walkthrough

ProofRequestActor now publishes terminal E3Failed events when proof signing or compute-request failures occur, using centralized helpers that emit CommitteeFinalized+DKGInvalidShares for DKG-path proofs (C0–C5) and CiphertextReady+DecryptionInvalidShares for decryption-path proofs (C6–C7). Docs and tests were updated accordingly.

Changes

Proof Failure Event Bridging

Layer / File(s) Summary
Failure bridging specification
agent/flow-trace/00_INDEX.md, agent/flow-trace/04_DKG_AND_COMPUTATION.md
Documentation specifies that ProofRequestActor failure bridging now emits terminal E3Failed events instead of suppressing publication, with distinct failed_at_stage/reason values for DKG-path (C0C5) and decryption-path (C6C7) failures.
Failure helpers and signing path refactoring
crates/zk-prover/src/actors/proof_request.rs
Added fail_dkg_round and fail_decryption_round helpers that publish E3Failed with appropriate stage/reason. Refactored signing-failure branches (C0–C7) to call these helpers and return early to prevent publishing on failure.
Compute request error handling and tests
crates/zk-prover/src/actors/proof_request.rs
Updated handle_compute_request_error to call the centralized helpers for C0, threshold (C1–C3), C4, C5, C6, and C7 compute-request failures. Added unit tests verifying emitted E3Failed events and pending-state clearing.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • gnosisguild/enclave#1429: Modifies crates/zk-prover/src/actors/proof_request.rs signing/publishing control flow; directly related to refactoring of proof-signing/compute-error failure branches.

Suggested reviewers

  • ctrlc03
  • 0xjei

Poem

🐰 In burrows where the proofs once slept,
Quiet logs no longer have to weep.
E3Failed sings its tidy tune,
DKG or Cipher — named by noon.
Rabbits hop, the round's complete, hooray!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(zk-prover): proof request failure bridges' directly reflects the core change—fixing how ProofRequestActor publishes E3Failed events on proof-generation/signing failures to prevent stalling.
Linked Issues check ✅ Passed The PR directly addresses issue #1533 by adding failure-bridge helpers that ensure proof-generation and proof-signing failures transition rounds to Failed state, preventing indefinite stalling.
Out of Scope Changes check ✅ Passed All changes are scoped to the failure-bridge fix: code refactoring in proof_request.rs, documentation updates, and tests—no unrelated modifications present.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/e3-halt-hlt-004

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.

@0xjei 0xjei self-requested a review May 13, 2026 14:38
0xjei
0xjei previously approved these changes May 13, 2026

@0xjei 0xjei 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.

utACK!

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

🧹 Nitpick comments (1)
crates/zk-prover/src/actors/proof_request.rs (1)

1505-1600: 💤 Low value

Tests correctly verify E3Failed emission for failure paths.

The two tests appropriately validate that the failure bridging emits the expected terminal events. The test coverage focuses on one compute error path and one helper, which provides a smoke test of the new behavior.

Optional test improvements

Minor: Test context construction

Line 1553's test_ctx(E3Failed{...}) creates a context wrapping E3Failed when handling a ComputeRequestError. While this doesn't affect correctness (the test validates the published event data, not the context), constructing the context with more representative data (e.g., the compute request itself) would improve test clarity.

Optional: Broader coverage

Consider adding tests for:

  • Signing failure paths (C1-C7)
  • fail_dkg_round helper directly (analogous to test 2's coverage of fail_decryption_round)
  • Other proof types (C1-C5, C7) compute errors

These are low priority given the helpers are simple wrappers and the call sites follow a consistent pattern.

🤖 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 `@crates/zk-prover/src/actors/proof_request.rs` around lines 1505 - 1600, Tests
correctly assert E3Failed events but the first test constructs the EventContext
with an E3Failed payload instead of a representative compute request; update
c0_compute_error_emits_e3_failed to call test_ctx with the actual ComputeRequest
(the Zk ComputeRequest used in the TypedEvent) rather than E3Failed so the
context matches the event being handled, i.e., locate the TypedEvent::new(...)
in c0_compute_error_emits_e3_failed and replace the test_ctx(E3Failed { ... })
argument with the ComputeRequest (or a wrapper that converts that ComputeRequest
into an Unsequenced EventContext) to produce a more realistic context;
optionally add analogous tests for fail_dkg_round and other compute error
variants (C1–C7) if you want broader coverage.
🤖 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.

Nitpick comments:
In `@crates/zk-prover/src/actors/proof_request.rs`:
- Around line 1505-1600: Tests correctly assert E3Failed events but the first
test constructs the EventContext with an E3Failed payload instead of a
representative compute request; update c0_compute_error_emits_e3_failed to call
test_ctx with the actual ComputeRequest (the Zk ComputeRequest used in the
TypedEvent) rather than E3Failed so the context matches the event being handled,
i.e., locate the TypedEvent::new(...) in c0_compute_error_emits_e3_failed and
replace the test_ctx(E3Failed { ... }) argument with the ComputeRequest (or a
wrapper that converts that ComputeRequest into an Unsequenced EventContext) to
produce a more realistic context; optionally add analogous tests for
fail_dkg_round and other compute error variants (C1–C7) if you want broader
coverage.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ac761325-5248-409c-b194-3dbe171bf02e

📥 Commits

Reviewing files that changed from the base of the PR and between f519ebf and 6adbb7f.

📒 Files selected for processing (3)
  • agent/flow-trace/00_INDEX.md
  • agent/flow-trace/04_DKG_AND_COMPUTATION.md
  • crates/zk-prover/src/actors/proof_request.rs

@vercel vercel Bot temporarily deployed to Preview – crisp May 18, 2026 11:00 Inactive
@vercel vercel Bot temporarily deployed to Preview – enclave-docs May 18, 2026 11:00 Inactive
@0xjei 0xjei enabled auto-merge (squash) May 18, 2026 12:29
0xjei
0xjei previously approved these changes May 18, 2026
@0xjei

0xjei commented May 18, 2026

Copy link
Copy Markdown
Contributor

@hmzakhalid

@0xjei 0xjei merged commit 26c846a into main May 18, 2026
39 of 55 checks passed
@github-actions github-actions Bot deleted the fix/e3-halt-hlt-004 branch May 26, 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.

HLT-004: Proof generation/signing failures can stall an E3 without marking it failed

3 participants