Caches Dory test setups (PublicParameters, VerifierSetup, ProverSetup) via LazyLock so they’re initialized once per test binary instead of once per test function.
The test suite was calling PublicParameters::test_rand with the same deterministic seed ~53 times and VerifierSetup::from ~47 times. Each call does BLS12-381 pairing operations and produces identical output every time. This gets rid of that.
New module test_dory_setup_cache.rs provides cached_public_parameters(nu), cached_verifier_setup(nu), and cached_prover_setup(nu) for nu values 2-6. Uses Box::leak to get &'static PublicParameters so ProverSetup<'static> can live in a LazyLock.
17 files changed across the dory module and e2e planner tests. Tests that intentionally use mismatched setups (e.g. we_fail_to_verify_*_when_the_setups_differ) are left as-is.
A few things I left alone:
[profile.test] optimization level changes (#610 already did that)PublicParameters::test_rand still call it as a no-op so subsequent random vector generation stays deterministicfold_scalars_test.rs uses nu=0 which isn’t worth cachingAll 171 dory tests pass, all 13 e2e planner tests pass, no new clippy warnings.
Closes #557
/claim #557
Nenad Ilic
@nenadilic84
Space and Time
@spaceandtimelabs