Skip to content

test(stm): consolidate the certificate proof tests around the golden proof - #3483

Merged
hjeljeli32 merged 4 commits into
mainfrom
hjeljeli32/3463-consolidate-halo2-snark-slow-proof-tests
Aug 20, 2026
Merged

test(stm): consolidate the certificate proof tests around the golden proof#3483
hjeljeli32 merged 4 commits into
mainfrom
hjeljeli32/3463-consolidate-halo2-snark-slow-proof-tests

Conversation

@hjeljeli32

@hjeljeli32 hjeljeli32 commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Content

This PR routes the verify-only tests in proof_system::halo2_snark::proof to 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::verify reads 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

  • Verify negatives (proof.rs): verify_fails_with_random_bytes_or_wrong_number_bytes, verify_fails_with_wrong_message and verify_fails_with_wrong_circuit_verification_key move into mod golden and run against golden_proof(). Four of the routed tests previously ran at m=100, k=5; verify and prepare_and_check never read the proof's own params or merkle_tree_depth, so the golden proof's configuration serves them without changing what they assert.
  • valid_proof_verifies deleted: once routed its body is identical to golden_conversion, which is itself unmodified.
  • Wrong verifying key: obtained by decoding NON_RECURSIVE_CIRCUIT_VERIFICATION_KEY_FOR_PRODUCTION instead of building a second prover. MidnightVK is 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-check and codec tests: the three prepare_and_check tests and snark_proof_to_from_bytes routed the same way, every assertion kept.
  • Fresh-proof coverage: produces_valid_snark_proof gains a prepare_and_check assertion 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.
  • Untouched: valid_snark_proof_with_different_path_length and non_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 to main. produces_valid_snark_proof is the only surviving test that changed, by the assertion above.
  • Not done, the cached forged proof: implemented and measured, then reverted. Locally it measures +0.65 s on a cold cache against -0.47 s on a warm one, and the content-keyed cache directory is empty on every CI run, so the cold path is the one CI takes. Left for @jpraynaud's decision, with the numbers in a comment on Consolidate the halo2_snark slow proof tests around shared and golden proofs #3463.

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • CHANGELOG file is updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • All check jobs of the CI have succeeded
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested
  • Documentation
    • No new TODOs introduced

Issue(s)

Closes #3463

@hjeljeli32 hjeljeli32 self-assigned this Aug 19, 2026
@hjeljeli32 hjeljeli32 added the run-slow-tests Technical label to run slow tests tiers in the CI. label Aug 19, 2026
@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown

Test Results

     5 files  ± 0     209 suites  ±0   1h 59m 29s ⏱️ + 36m 59s
 3 449 tests +51   3 449 ✅ +51  0 💤 ±0  0 ❌ ±0 
11 312 runs  +54  11 312 ✅ +54  0 💤 ±0  0 ❌ ±0 

Results for commit 7d066b7. ± Comparison against base commit 4ec7b25.

♻️ This comment has been updated with latest results.

@damrobi damrobi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
hjeljeli32 force-pushed the hjeljeli32/3463-consolidate-halo2-snark-slow-proof-tests branch from d6a35c1 to 7d066b7 Compare August 20, 2026 01:40
@hjeljeli32
hjeljeli32 deployed to testing-2-preview August 20, 2026 02:43 — with GitHub Actions Active
@hjeljeli32
hjeljeli32 deployed to testing-preview August 20, 2026 02:43 — with GitHub Actions Active
@hjeljeli32
hjeljeli32 merged commit e5f094c into main Aug 20, 2026
91 of 92 checks passed
@hjeljeli32
hjeljeli32 deleted the hjeljeli32/3463-consolidate-halo2-snark-slow-proof-tests branch August 20, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-slow-tests Technical label to run slow tests tiers in the CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consolidate the halo2_snark slow proof tests around shared and golden proofs

2 participants