Skip to content

fix(zk-tls): drop the prover's error text from proveReq's errors - #291

Merged
lolaaimar merged 1 commit into
mainfrom
fix/zk-tls-prover-error-text
Nov 25, 2026
Merged

lolaaimar merged 1 commit into
mainfrom
fix/zk-tls-prover-error-text

Conversation

@nicolasLuduena

@nicolasLuduena nicolasLuduena commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Part of #211, split out of #248. Stack: #291 → #292 → #293 → #294; merge in that order.

proveReq passed a prover's error to the caller unchanged, so text from the witness or the source reached the dApp. collect already dropped it. The check now lives in proveWith, which both use:

 proveWith(provers, attestor, request)
-  evidence = parse(await prover.prove(copyRequest(request)))
+  try
+    proved = await prover.prove(copyRequest(request))
+  catch error
+    if error is a ZkFetchProverError with reason transport or no-match
+      throw new ZkFetchProverError(reason)        # no message text, no cause
+    throw Error("zkFetch prover for attestor <id> failed")
+  evidence = parse(proved)

collect's own known-reason check goes away, since proveWith already does it. The README and the proveReq JSDoc state the guarantee.

Evidence

  • Before: proveReq rejected with the prover's own error object, cause and message included (the old test asserted rejects.toBe(failing)).
    After: these pass in pipeline.test.ts:

    reports a prover transport failure under its own reason     # now also: proveReq keeps the reason, drops the cause
    reports a prover no-match failure under its own reason
    rethrows a witness error from proveReq without the remote text
    rethrows an unknown prover reason from proveReq without the remote text
    rethrows a non-Error value from proveReq without the remote text
    

Build, types, Biome and the full suite pass on this branch: 768 passed, 4 skipped (the opt-in live checks).

No verification skill in this repo.

Merge Danger

Door: two-way

Blast Radius: zk-tls consumers

Code that reads the message or cause of a proveReq error gets only the reason, or the id of the attestor whose prover failed.

@nicolasLuduena nicolasLuduena left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

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

lgtm

@lolaaimar
lolaaimar merged commit 93e8679 into main Nov 25, 2026
2 checks passed
@lolaaimar
lolaaimar deleted the fix/zk-tls-prover-error-text branch November 25, 2026 19:49
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