Skip to content

refactor(stm): update the ivc circuit errors - #3736

Draft
damrobi wants to merge 3 commits into
mainfrom
damrobi/msnark/3592-refactor-ivc-error
Draft

damrobi wants to merge 3 commits into
mainfrom
damrobi/msnark/3592-refactor-ivc-error

Conversation

@damrobi

@damrobi damrobi commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Content

This PR includes a refactor of the IVC circuit errors to match the error handling of the non-recursive circuit, using a conversion from midnight errors to our own error type IvcCircuitError.

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • CHANGELOG file is updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • All check jobs of the CI have succeeded
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

Comments

Issue(s)

Closes #3592

IvcCircuit::Error is now IvcCircuitError instead of plonk::Error, with a Backend(String) catch-all and a From<plonk::Error> conversion, like the certificate circuit.
… and gadgets

The witness assignments, the byte combination gadget and the protocol message hash gadget now return IvcCircuitError, so their guard errors are no longer flattened into a synthesis error string.
Removed the to_synthesis_error adapter.
The IVC prover now recovers the typed IvcCircuitError of a failed synthesis from the circuit, as zk::prove does for the certificate circuit, so callers can downcast it.
Removed IvcProofError::ProofGenerationFailed, replaced by IvcCircuitError::Backend.
@damrobi damrobi self-assigned this Nov 27, 2026
@jpraynaud jpraynaud added the refactoring 🛠️ Code refactoring and enhancements label Nov 27, 2026
@github-actions

Copy link
Copy Markdown

Test Results

     5 files  ± 0     211 suites  ±0   1h 40m 26s ⏱️ - 12m 7s
 4 699 tests  - 41   4 699 ✅  - 41  0 💤 ±0  0 ❌ ±0 
15 423 runs   - 39  15 423 ✅  - 39  0 💤 ±0  0 ❌ ±0 

Results for commit 82e27a5. ± Comparison against base commit 736297b.

This pull request removes 42 and adds 1 tests. Note that renamed tests count towards both.
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::index_out_of_bounds
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::index_too_large_for_circuit_range
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::indices_not_increasing
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::leaf_merkle_path_mismatch
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::leaf_swap_keep_merkle_path
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::leaf_wrong_verification_key
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_corrupt_sibling
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_flip_position
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_length_long
mithril-stm ‑ circuits::halo2::tests::golden::cases::negative::slow::merkle_path_length_short
…
mithril-stm ‑ circuits::halo2_ivc::errors::tests::plonk_error_converts_to_backend_variant

@damrobi
damrobi deployed to testing-preview November 27, 2026 17:47 — with GitHub Actions Active
@damrobi
damrobi deployed to testing-2-preview November 27, 2026 17:47 — with GitHub Actions Active

This branch was successfully deployed

2 active deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactoring 🛠️ Code refactoring and enhancements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor IVC circuit error handling from Midnight library

2 participants