test(stm): consolidate the certificate proof tests around the golden proof - #3483
Merged
hjeljeli32 merged 4 commits intoAug 20, 2026
Merged
Conversation
hjeljeli32
requested review from
curiecrypt,
damrobi and
jpraynaud
as code owners
August 19, 2026 00:12
21 tasks
damrobi
approved these changes
Aug 19, 2026
damrobi
left a comment
Collaborator
There was a problem hiding this comment.
LGTM 👍
I just think that you can probably move some of those test function outside of the slow module, maybe in a golden module outside of slow?
hjeljeli32
force-pushed
the
hjeljeli32/3463-consolidate-halo2-snark-slow-proof-tests
branch
from
August 20, 2026 01:40
d6a35c1 to
7d066b7
Compare
hjeljeli32
deleted the
hjeljeli32/3463-consolidate-halo2-snark-slow-proof-tests
branch
August 20, 2026 03:27
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.
Content
This PR routes the verify-only tests in
proof_system::halo2_snark::proofto the committed golden proof. Each of them previously built a full prover setup and generated its own proof, even though the assertion only ever needed proof bytes — a valid proof to tamper with, or any valid proof at all. Verification needs neither an SRS nor a proving key:SnarkProof::verifyreads only the proof bytes plus the aggregate verification key, message and verifying key it is handed, and the verifier parameters are a 192-byte embedded constant.Measured locally,
--test-threads 1: the slow tier goes from 33.9 s to 15.3 s warm (-55 %) and from 65.8 s to 47.1 s cold (-28 %), 16 tests becoming 15. Fast tier unchanged at 511 passing. Per-item numbers are in #3463.Changes
proof.rs):verify_fails_with_random_bytes_or_wrong_number_bytes,verify_fails_with_wrong_messageandverify_fails_with_wrong_circuit_verification_keymove intomod goldenand run againstgolden_proof(). Four of the routed tests previously ran at m=100, k=5;verifyandprepare_and_checknever read the proof's ownparamsormerkle_tree_depth, so the golden proof's configuration serves them without changing what they assert.valid_proof_verifiesdeleted: once routed its body is identical togolden_conversion, which is itself unmodified.NON_RECURSIVE_CIRCUIT_VERIFICATION_KEY_FOR_PRODUCTIONinstead of building a second prover.MidnightVKis self-describing, so this needs no SRS and no keygen, and the assertion strengthens to "a test proof must not verify under the key that ships".prepare_and_checktests andsnark_proof_to_from_bytesrouted the same way, every assertion kept.produces_valid_snark_proofgains aprepare_and_checkassertion on the proof it already generates, so that method still runs against a freshly produced proof rather than only committed bytes. Costs 0.03 s.valid_snark_proof_with_different_path_lengthandnon_deterministic_proofs_verify, the two tests that fail during aggregation before proving,different_parameters_prove_and_verify_fails, and the two pre-existing golden tests are byte-identical tomain.produces_valid_snark_proofis the only surviving test that changed, by the assertion above.halo2_snarkslow proof tests around shared and golden proofs #3463.Pre-submit checklist
Issue(s)
Closes #3463