Repository navigation
Retire raw.ak and test the common.ak helpers the verifiers use - #22
Merged
Merged
Conversation
raw.ak had no callers, and its projective fixtures in plonk_tests were not used by any test, so both are removed. The PLONK implementation report recommended revalidating or retiring it; it now has a dated note. The verifiers use five definitions from common.ak: the two BLS12-381 constants, concat_and_keccak_256, scalar_sum and g1_sum. The new tests/common_tests.ak covers them with 8 unit and 3 property tests: p against the spec value, (p - 1) / 2, p = 3 mod 4, the G1 generator on the curve, Keccak (not SHA3) of the empty input, join order, split invariance, and both sums against integer arithmetic. 64 tests pass with aiken check -D; fmt and build are clean. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for the helper-test additions and retirement of the unused projective conversion module.
No open issues 🎉
What changed in this PR
Builds on #21’s property tests by adding coverage for the common.ak helpers used by the verifiers and retiring the unused PLONK projective conversion module.
Changes:
- Adds 8 unit tests and 3 property tests for BLS12-381 constants, Keccak concatenation, scalar sums, and G1 sums.
- Removes
raw.akand its unused projective test vectors. - Documents the retirement and directs integrations to
raw_affine.akor compressed bytes.
| File | Description |
|---|---|
zkp/lib/tests/plonk_tests.ak |
Removes unused projective fixtures and their imports. |
zkp/lib/tests/common_tests.ak |
Adds unit and property coverage for shared verifier helpers. |
zkp/lib/plonk/raw.ak |
Deletes the legacy projective conversion module. |
zkp/docs/plonk-implementation-report.md |
Records the retirement while preserving historical report context. |
Review effort: Balanced
The PLONK implementation report now describes the module as it is: raw_affine.ak is the one point-type front door, and the raw.ak passages and limitation are gone. The README and the three implementation reports give the current test counts (64 across the package, including the property-test files); the Bulletproofs report said 13 where the module has 10. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Stacked on #21. This PR targets
sam/property-tests, so its diff shows only the change below. Merge #21 first; this PR then retargets tomain(automatically if #21's branch is deleted on merge, otherwise by editing the base).Catalyst completion roadmap task 1.3: fill the unit-test gaps in
common.akand retireraw.ak.What changes
raw.akremoved. Nothing in the package called it, and its projective test vectors inplonk_tests(test_plonk_proof,test_plonk_vkey) weren't used by any test, so they're removed too. The PLONK implementation report had recommended revalidatingraw.akor retiring it; it now describes the module without it, withraw_affine.ak(or compressed bytes) as the way in.Test counts refreshed. The README and the three implementation reports now give the current counts (64 across the package, including the property-test files). The Bulletproofs report said 13 where the module has 10.
Tests for what the verifiers actually take from
common.ak. Of its ~70 definitions, the verifiers use five:bls12_381_base_prime,bls12_381_half_primeblst_affine(compression sort bit)concat_and_keccak_256proofs,verifier)scalar_sum,g1_sumThe new
tests/common_tests.akhas 8 unit and 3 property tests for them:scalar_sumandg1_sumof an empty list are zero, and both agree with integer arithmetic mod r (properties).Mutation check: reversing the join order in
concat_and_keccak_256makes two of these fail.Not in this PR
The rest of
common.ak(~950 lines: hand-rolled field arithmetic, compression, placeholder pairing) has no callers now thatraw.akis gone. The README and the implementation reports describe it as kept for reference, so deleting it is left as a separate decision.Checks
aiken check -D: 64 tests pass (53 from #21 plus 11 new).aiken fmt --checkandaiken buildare clean, andplutus.jsonis unchanged.