feat(host): add v4 proposal proof API adapter - #704
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 682c167f0a
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| let error = task_status_error(&status); | ||
| (task_status_to_v4(&status), None, error) | ||
| } | ||
| ProofResponse::Proof { proof } => ("completed".to_string(), proof.proof, None), |
There was a problem hiding this comment.
Return the full proof payload for completed tasks
When /v4/proof/proposal receives a completed legacy Shasta proof, this mapping keeps only proof.proof and drops the rest of the Proof object. Several provers populate verifier/submission data outside that field (e.g. input, quote/receipt, uuid, and Shasta extra_data), so SGX/RISC0/SP1 or native callers can get status: "completed" with an incomplete or even null proof that is not equivalent to the v3 response.
Useful? React with 👍 / 👎.
| let task_id = format!( | ||
| "legacy-shasta-{}-{}-{}", | ||
| conversion.proposal_id_start, conversion.proposal_id_end, proof_type | ||
| ); |
There was a problem hiding this comment.
Include all task discriminators in task_id
The generated task_id only uses the first proposal id, last proposal id, and proof type, but the adapter accepts arbitrary proposal lists and an optional prover. Distinct requests such as aggregate proposals [10,12] versus [10,11,12] (or the same proposal range with a different prover) enqueue different Shasta tasks while returning the same v4 task_id, making the identifier unsafe for client-side correlation or de-duplication.
Useful? React with 👍 / 👎.
Summary
Regression
Tests