Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.

feat(host): add v4 proposal proof API adapter - #704

Open
smtmfft wants to merge 2 commits into
hotfix/hotfix-based-on-1.16.1from
fix/v4-proposal-api-hotfix-1.16.1
Open

feat(host): add v4 proposal proof API adapter#704
smtmfft wants to merge 2 commits into
hotfix/hotfix-based-on-1.16.1from
fix/v4-proposal-api-hotfix-1.16.1

Conversation

@smtmfft

@smtmfft smtmfft commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add /v4/proof/proposal as a thin adapter over the existing v3 Shasta batch proof path
  • convert v4 l2_block_number_start/end ranges into legacy l2_block_numbers
  • map legacy v3 proof/status responses into the raiko2-style v4 response envelope
  • add --proof-api-version v4 to script/stress_shasta_proposal.py while keeping v3 as the default path

Regression

  • mainnet v4 native regression completed for proposal 19716
  • requested L2 seed range: 8407605,8407605
  • resolved proposal range: L2 8407588..8407779, L1 inclusion 25477944, last_anchor_block_number 25477875
  • request payload used /v4/proof/proposal shape with l2_block_number_start=8407588 and l2_block_number_end=8407779

Tests

  • python3 script/test_stress_shasta_proposal.py
  • python3 -m py_compile script/stress_shasta_proposal.py script/test_stress_shasta_proposal.py
  • cargo test -p raiko-host v4_proposal
  • cargo check -p raiko-host
  • cargo fmt --all -- --check
  • git diff --check

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread host/src/server/api/v4.rs
let error = task_status_error(&status);
(task_status_to_v4(&status), None, error)
}
ProofResponse::Proof { proof } => ("completed".to_string(), proof.proof, None),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment thread host/src/server/api/v4.rs
Comment on lines +161 to +164
let task_id = format!(
"legacy-shasta-{}-{}-{}",
conversion.proposal_id_start, conversion.proposal_id_end, proof_type
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant