Skip to content

Conversation

@sidhujag
Copy link

Summary

Adds utilities and plumbing to dump, shrink, and verify recursion/R1CS constraints for SP1 programs, plus supporting updates across the recursion toolchain and gnark-ffi.

Changes

  • Add dump_shrink_verify_constraints prover binary and related helpers.
  • Extend recursion compiler/R1CS pipeline (BabyBear + Poseidon2 + LF backends) to support exporting constraint systems.
  • Update gnark-ffi assets + Go bindings for updated verifier/proving flow.
  • Add/adjust field + Poseidon2 constants plumbing (incl. BLS12-377-related field module).

Test plan

  • cargo test -p prover -p recursion-compiler -p recursion-circuit -p verifier
  • Run cargo run -p prover --bin dump_shrink_verify_constraints -- --help and a representative program config.
  • (Optional) run gnark-ffi Go tests under crates/recursion/gnark-ffi/go/.

Notes

  • This branch is large (129 commits / 48 files changed). Review is easiest commit-by-commit, focusing on the new dump/shrink binary and recursion compiler changes.

jagdeep sidhu added 30 commits January 17, 2026 11:55
Phase 0 explicitly exports only RecursionPublicValues.digest as public inputs (see phase0_collect_public_ids around lines 260–272), but CircuitV2CommitPublicValues asserts that sp1_vk_digest (and later committed_value_digest) must occupy the public-input prefix. In BabyBear recursion circuits those fields are not preallocated, so debug builds will panic when compiling the shrink verifier (e.g., dump_shrink_verify_constraints in debug), and release builds will silently accept a public-input layout that contradicts these checks. Consider validating the digest IDs here instead, or expand Phase 0 to include the other fields if they are meant to be public.
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