Skip to content

Refactor IVC circuit error handling from Midnight library #3592

In progress

Description

@jpraynaud

Why

Typed IvcCircuitError guard failures raised in the Halo2 IVC Relation::circuit implementation are flattened into plonk::Error::Synthesis(String) (via to_synthesis_error), which loses the error type and forces callers and tests to fall back on string matching, whereas this has already been fixed for the non-recursive circuit in #3382.

What

Refactor the IVC circuit error handling to preserve typed IvcCircuitError across the Relation::circuit boundary, and update the tests to assert on typed errors.

How

  • Set IvcCircuit::Error to IvcCircuitError and implement From<plonk::Error> for it (adding a backend catch-all variant)
  • Remove to_synthesis_error for the IVC circuit and return typed IvcCircuitError directly from witness_assignments.rs and the gadget layer (byte_combination)
  • Preserve IvcCircuitError as a typed source so callers can downcast it
  • Update the negative test cases to assert on typed IvcCircuitError variants

Activity

  1. added
    optimization 🛠️
    to-groom 🤔
    cryptography 🔐
    and removed
    to-groom 🤔
    on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cryptography 🔐optimization 🛠️

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions