feat(verifier-ray): complete verifier - #3683
Draft
YaoJGalteland wants to merge 8 commits into
Draft
Conversation
Signed-off-by: Yao Galteland <yaoj.galteland@gmail.com>
Signed-off-by: Yao Galteland <yaoj.galteland@gmail.com>
Signed-off-by: Yao Galteland <yaoj.galteland@gmail.com>
Signed-off-by: Yao Galteland <yaoj.galteland@gmail.com>
Signed-off-by: Yao Galteland <yaoj.galteland@gmail.com>
…itment Signed-off-by: Yao Galteland <yaoj.galteland@gmail.com>
Signed-off-by: Yao Galteland <yaoj.galteland@gmail.com>
Signed-off-by: Yao Galteland <yaoj.galteland@gmail.com>
Contributor
There was a problem hiding this comment.
🟡 Human review recommended
It introduces a large, security-critical cryptographic verification stack (FRI/PCS) and rewires verifier trust/binding semantics, which warrants careful human review even with strong new fixtures/tests.
Pull request overview
Ports and integrates a FRI-based PCS verifier into verifier-ray, making PCS openings transcript-bound and making PCS-authenticated entry_claims the single source of truth for downstream query sub-verifiers (notably vanishing), with new codegen + fixtures to validate end-to-end parity against prover-ray.
Changes:
- Adds a full allocation-free FRI/PCS verifier under
verifier-ray/src/pcs/and wires it intoverifier-ray/src/verifier.zigso PCS runs first and routes authenticated claims into vanishing. - Refactors protocol replay to be transcript-continuing (
replayWithTranscript) and binds dynamic module sizes into Fiat–Shamir via a codegen-emitted absorb schedule. - Introduces Go-based fixture generators + new Zig integration tests (FRI opening cross-check, coexistence, real-protocol PCS, endpoint-cell binding), plus supporting codegen enhancements.
File summaries
| File | Description |
|---|---|
| verifier-ray/testdata/generated/realpcs.zig | New generated “real protocol” PCS+vanishing fixture used for end-to-end verifier tests. |
| verifier-ray/testdata/generated/frip.zig | New generated FRI/PCS opening-proof fixture emitted from prover-ray for byte-level cross-checking. |
| verifier-ray/testdata/generated/coexist.zig | New generated coexistence fixture proving PCS-authenticated claims feed vanishing. |
| verifier-ray/testdata/generate/realpcs.go | Generator for the “real protocol” PCS fixture (runs full arithmetization + pcs.Compile). |
| verifier-ray/testdata/generate/go.sum | Updates generator module sums after generator dependency changes. |
| verifier-ray/testdata/generate/go.mod | Adds deps/replace directives so generators build against local prover-ray APIs. |
| verifier-ray/testdata/generate/frip.go | Generator producing a real multi-round FRI/PCS opening proof via prover-ray/fri. |
| verifier-ray/testdata/generate/frip_emit.go | Serialization logic to emit frip.zig in the shapes verifier-ray consumes. |
| verifier-ray/test/verifier_test.zig | Removes minimal verifier smoke tests superseded by PCS-backed end-to-end tests. |
| verifier-ray/test/vanishing_test.zig | Updates replay API usage and adds OOB safety test for cell_value refs. |
| verifier-ray/test/transcript_test.zig | Removes transcript unit tests (coverage now comes via golden + PCS tests). |
| verifier-ray/test/pcs_realpcs_test.zig | New end-to-end test: PCS deployed on a real protocol fixture. |
| verifier-ray/test/pcs_frip_test.zig | New cross-check: verifier-ray PCS verifier accepts/rejects a real prover-ray opening proof. |
| verifier-ray/test/pcs_endpoint_binding_test.zig | New integration test proving endpoint-cell soundness via transcript + vanishing binding. |
| verifier-ray/test/pcs_coexist_test.zig | New end-to-end coexistence test proving PCS↔vanishing claim linkage. |
| verifier-ray/test/logderivativesum_test.zig | Adds OOB safety tests for cell refs via bounds-checked access. |
| verifier-ray/test/golden_test.zig | Comment update reflecting replay API naming. |
| verifier-ray/test/field_test.zig | Removes basic field unit tests (coverage now via PCS/FRI arithmetic + higher-level tests). |
| verifier-ray/test/all.zig | Updates the test suite entrypoint to include new PCS tests. |
| verifier-ray/src/verifier.zig | Wires PCS as mandatory, transcript-continuing phase; routes PCS-authenticated claims into vanishing. |
| verifier-ray/src/query/vanishing.zig | Uses bounds-checked ctx.cell(...) for cell_value and surfaces OOB as a clean error. |
| verifier-ray/src/query/logderivativesum.zig | Uses bounds-checked ctx.cell(...) and extends error set accordingly. |
| verifier-ray/src/protocol/root.zig | Adds transcript-continuing replay, dynamic-size absorption schedule, and bounds-checked cell accessor. |
| verifier-ray/src/pcs/tree.zig | New Merkle branch verification for running-layer trees. |
| verifier-ray/src/pcs/root.zig | New PCS barrel re-export module for public API convenience. |
| verifier-ray/src/pcs/reconstruct.zig | New DEEP-quotient reconstruction logic at query points. |
| verifier-ray/src/pcs/params.zig | New FRI parameter validation + domain-point arithmetic (bit-reversed addressing). |
| verifier-ray/src/pcs/paired_leaf.zig | New multi-size paired-leaf Merkle opening verification and hashing contract. |
| verifier-ray/src/pcs/layout.zig | New canonical layout builder from shapes/shifts, including shift validation rules. |
| verifier-ray/src/pcs/fold.zig | New fold-recurrence checker and octuplet decoding for FRI verification. |
| verifier-ray/src/pcs/verify.zig | New top-level PCS verification orchestration + transcript-derived challenges. |
| verifier-ray/src/lib.zig | Exposes PCS modules through the library’s public API surface. |
| verifier-ray/src/field/koalabear_ext.zig | Adds Ext.halve() support required by the FRI fold recurrence. |
| verifier-ray/src/crypto/fiat_shamir.zig | Adds transcript snapshot/restore + integer sampling used by PCS challenge derivation. |
| verifier-ray/docs/fri-pcs-plan.md | New design/implementation plan documenting constraints and module map. |
| verifier-ray/docs/fri-pcs-link-pr-split.md | New PR-splitting plan documenting how to slice the change safely. |
| verifier-ray/docs/binding-analysis.md | New binding/soundness analysis documenting trust anchors and enforced bindings. |
| verifier-ray/codegen/vanishing.go | Aligns dynamic-module indexing with FS absorb schedule; adds generation-time guardrails. |
| verifier-ray/codegen/system.go | Adds PCS system emission and combined verifier.Systems literal generation. |
| verifier-ray/codegen/spec_zig.go | Emits dynamic size absorb schedule into protocol.Spec. |
| verifier-ray/codegen/spec_zig_test.go | Tests for dynamic-size schedule emission in generated Spec. |
| verifier-ray/codegen/pcs.go | New PCS system extraction from compiled+proven prover-ray protocols (shapes/shifts/maps/roots). |
| verifier-ray/codegen/pcs_zig.go | New Zig emitter for pcs.verify.System literals (params/shapes/shifts/maps/root provenance). |
| verifier-ray/codegen/pcs_test.go | New tests validating PCS extraction and Zig emission invariants. |
| verifier-ray/codegen/go.mod | Builds codegen against local prover-ray APIs via replace directive. |
| verifier-ray/codegen/coin_routing.go | Emits FS dynamic-size absorb schedule and shared dynamic-module rank mapping. |
| verifier-ray/codegen/actions.go | New fail-closed guard ensuring all verifier actions are handled/emitted. |
| verifier-ray/codegen/actions_test.go | Tests that unhandled verifier actions (e.g., grandproduct) are rejected at codegen time. |
| verifier-ray/build.zig | Adds Zig build modules for new generated fixtures used by the new tests. |
| prover-ray/wiop/compilers/pcs/pcs.go | Exposes PCS compiler internals needed by verifier-ray codegen/fixtures (CommittedBatches, GetLayout, etc.). |
| .gitignore | Ignores generator build artifact under verifier-ray/testdata/generate/. |
Review details
- Files reviewed: 48/55 changed files
- Comments generated: 1
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
Comment on lines
+397
to
+400
| const round = system.params.log_plaintext_size - bundle.size_log2; | ||
| const card = @as(u64, 1) << @intCast(system.params.log_codeword_size - round); | ||
| if (pointInDomain(zeta, card)) return Error.ClaimPointInDomain; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the FRI-based polynomial commitment scheme (PCS) verifier from prover-ray into the Zig verifier-ray, and wires it into the top-level verifier.verify as a mandatory, transcript-bound opening layer. The verifier now authenticates committed claims via a real FRI opening instead of trusting proof-supplied values, and the PCS-authenticated entry_claims are the single source the vanishing sub-verifier re-slices — closing the gap where a prover could feed PCS and vanishing different values for the same column.
Key changes
Testing