Investigating: chunked (num_chunks > 1) proofs don't survive Pickles proof serialization
Chunked proofs should round-trip through serialization, but in our experiments an `nc>1` proof no longer re-verifies after `to_repr → of_repr`. Trying to pin down where the chunk data is lost.
**What I'm seeing** (`develop` @ `3daebf47`, `src/lib/crypto/pickles/proof.ml`):
```ocaml
(* to_repr ~L260 *) let x1, x2 = prev_evals.evals.public_input in (x1.(0), x2.(0))
(* of_repr ~L294 *) let x1, x2 = prev_evals.evals.public_input in ([| x1 |], [| x2 |])
```
Only chunk 0 of the public-input eval is kept (`All_evals.Stable.V1.public_input` is `('f * 'f)`, vs the in-memory `('f array * 'f array)`). But `Wrap.combined_inner_product` feeds the full `fst e.public_input` array into `combine_split_evaluations` — so after the round-trip, chunks `1..n-1` are gone and CIP no longer matches.
**Repro** — for a `num_chunks = 2` proof `b`:
```ocaml
let b' = Proof.of_base64 (Proof.to_base64 b) |> Or_error.ok_exn in
Proof.verify [ (statement, b') ] (* (Pickles.verify dlog_check) *)
```
An `nc = 1` proof round-trips fine — consistent with this being invisible in production (always nc=1, where chunk 0 is the whole eval).
**Questions:**
- Is the `Stable.V1` `public_input : ('f * 'f)` collapse the actual source of loss, or is there a chunk-recovery path on deserialization I'm missing?
- If the type is the cause, is widening it to `('f array * 'f array)` (new versioned type) the intended fix?
0 条评论