Skip to content

starknet_transaction_prover: classify mod-builtin prover panics pending typed errors - #15131

Open
avi-starkware wants to merge 1 commit into
avi/prover/mod-builtin-circuit-entry-pointsfrom
codex/prover-mod-builtin-classification
Open

avi-starkware wants to merge 1 commit into
avi/prover/mod-builtin-circuit-entry-pointsfrom
codex/prover-mod-builtin-classification

Conversation

@avi-starkware

@avi-starkware avi-starkware commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Temporarily classify a prover-task panic as UnsupportedBuiltins when the PIE used add_mod or mul_mod components absent from the recursive verifier's component set. Map that error to JSON-RPC 1002 (Unsupported builtin).

The prover still runs normally. Successful proofs are unchanged; returned errors, cancellations, and panics without unsupported-builtin usage remain internal errors.

This is a heuristic: an unrelated panic in a transaction using an unsupported mod builtin will also produce 1002. A TODO at the classification branch calls for a typed unsupported-component error from privacy-prove, replacing this inference with direct error handling.

  • Use JoinError::is_panic() and positive PIE builtin counts. No panic capture module, thread-local storage, or source-location matching.
  • Leave the existing observability panic hook unchanged and preserve the original documentation in prover.rs.
  • Pin the spec to feat(proving-api): add UNSUPPORTED_BUILTIN error to starknet_proveTransaction starknet-specs#411 at 8c315cb2d3bde23379d92b415c2371ce68b51643, report spec version 0.10.4, and validate the new RPC error against the schema.
  • Test panic/cancellation classification with and without mod-builtin usage, display formatting, and RPC mapping.
  • Keep real-proving tests for mul-only and add-plus-mul transactions alongside the multicall success test. The tests assert builtin usage and the returned error, not a panic source location.

Stacked directly on #15124 over main-v0.14.4. This replaces the approach that depended on #15125's panic-capture machinery.

Verification

  • Proving-enabled library suite: 153 passed, 6 ignored.
  • Non-proving library suite: 140 passed, 5 ignored; one doc test passed.
  • Real-proving flows: 3 passed.
  • Clippy with -D warnings passed in both configurations, as did formatting.
  • Original prover.rs docstrings match the base verbatim. The observability hook and its tests also match the base.
cargo +nightly-2026-01-15 test --locked -p starknet_transaction_prover --features stwo_proving --release --lib --quiet
cargo +nightly-2026-01-15 test --locked --release -p starknet_os_flow_tests --features stwo_proving prove_ -- --ignored --test-threads=1
cargo +nightly-2026-01-15 clippy --locked --release -p starknet_transaction_prover -p starknet_os_flow_tests --features stwo_proving --all-targets -- -D warnings
cargo test --locked -p starknet_transaction_prover --quiet
cargo clippy --locked -p starknet_transaction_prover -p starknet_os_flow_tests --all-targets -- -D warnings
scripts/rust_fmt.sh --check

@avi-starkware
avi-starkware added this pull request to stack #15130 September 15, 2026 20:01
@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@avi-starkware
avi-starkware removed this pull request from stack #15130 September 15, 2026 20:42
@avi-starkware
avi-starkware force-pushed the codex/prover-mod-builtin-classification branch from 3293fe0 to c23cf02 Compare September 15, 2026 20:42
@avi-starkware
avi-starkware changed the base branch from avi/prover/unsupported-mod-builtins to avi/prover/mod-builtin-circuit-entry-points September 15, 2026 20:42
@avi-starkware
avi-starkware added this pull request to stack #15132 September 15, 2026 20:42
@avi-starkware avi-starkware changed the title starknet_transaction_prover: classify unsupported mod builtins and pin proving failures starknet_transaction_prover: classify mod-builtin prover panics pending typed errors Sep 15, 2026
@avi-starkware
avi-starkware marked this pull request as ready for review September 16, 2026 08:01
@cursor

cursor Bot commented Sep 16, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Changes proving error classification and public RPC semantics (new 1002) using a heuristic that may mislabel unrelated panics when mod builtins were used; successful proofs are unchanged.

Overview
When proving fails on a blocking task panic and the Cairo PIE used add_mod / mul_mod builtins that are absent from PRIVACY_TRANSACTION_COMPONENTS, the prover now surfaces ProvingError::UnsupportedBuiltins instead of a generic join failure. That maps to JSON-RPC 1002 (Unsupported builtin) with builtin names and instance counts in data; other proving failures stay internal errors.

The proving path scans the PIE before privacy_recursive_prove, wires privacy-circuit-verify-v2 under the stwo_proving feature, bumps the pinned proving API to 0.10.4, and documents the limitation. CI runs all ignored prove_* flow tests via a local stwo_proving feature on starknet_os_flow_tests; integration tests add try_prove and prove_tx_using_mod_builtins_fails to pin the failure mode.

Reviewed by Cursor Bugbot for commit c23cf02. Bugbot is set up for automated code reviews on this repo. Configure here.

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