ethereum / ethereum/sonobe

Nova verify fails with IVCVerificationFail when circuit uses thread-local data in generate_step_constraints

Open
#263 1 comment 0 reactions 1 assignee Claimed by @winderica View on GitHub
bug
Dominant language
Rust
Stars
285
Forks
97
PR merge metrics
No merged PRs in 30d

Description

**Repro:** Set thread-local data before `SonobeNova::preprocess()`, then prove and verify. Verify returns `IVCVerificationFail with expected_u_i_x != u_i.x[0] at folding-schemes/src/folding/nova/mod.rs:974`.

**Root cause:** The Poseidon pp_hash embedded in the verifier params loses consistency during the serialize/deserialize round-trip through `vp_deserialize_with_mode`. Verify recomputes `U_i.hash(&sponge, num_steps, &z_0, &z_i)` with a different `pp_hash` than prove used, producing a hash mismatch.

**Workaround:** Pre-seed thread-local data with a dummy entry before **preprocess()** so the R1CS shape stabilizes across serialization boundaries, then clear and set real data before proving.

**Affected:** Any circuit whose `generate_step_constraints` reads mutable state (thread-local, global, or self-mutating) with constraint shape depending on that state.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.