fix(shielded-pq): re-pin drifted PQ-v2 regression guards (PQV2-08) - #24
Merged
Conversation
The pool-v2 security/performance regression checks had drifted off the parameters actually shipped, and several security-critical surfaces had no regression pin at all — a silent parameter change could regress proven security (128 -> 75 bits) or the proof size / weight derivation with no failing test while the pool is dormant. Guards only; no consensus behavior, gas, digest, or activation-state change. Bit 2 stays UNARMED. - security_level.rs: relabel the security report from the stale "42 queries, blowup 8, quadratic" to the shipped 64/16/cubic set (the code measured the new set under the old label); add a >=128 FLOOR assertion on conjectured AND proven(ldr) bits (the test previously asserted nothing). - prover.rs: extract FRI_NUM_QUERIES/BLOWUP/GRINDING/EXTENSION_DEGREE consts with `const _: () = assert!(..)` build-time guards, so a silent param edit fails the BUILD (proven: flipping to 42 -> "FRI query count moved off 64"). Correct the stale 94.3 KB doc figure to the real 96.2 KB / 98494 B. - kat.rs: add kat_proof_size_pinned (98494 bytes) — verify_cost.rs claimed the size was "pinned by the KAT suite" but no such pin existed. - carrier.rs: add carrier_sighash_byte_kat_pinned + scheme-byte pin (PQV2-06); the existing carrier tests were mutually self-consistent and could not catch a silent preimage/scheme/domain change. - notes: PQV2-08 resolution appended.
cloudzombie
force-pushed
the
fix/pqv2-08-regression-guards
branch
from
July 28, 2026 20:26
192e9d8 to
009aac8
Compare
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.
Closes audit Medium PQV2-08 — "security/performance regression checks have drifted" — on the DORMANT PQ shielded pool v2 (
chain/crates/shielded-pq, BIP-9 bit 2, unarmed).Fixes the guards, not the code they guard: no consensus behavior, gas, digest, or activation-state change;
unsafestays forbidden; bit 2 remains UNARMED.Drift found + fixed (each measured, not guessed)
security_level.rs) — line said42 queries, blowup 8, quadraticwhile the code measured the shippedproof_options()(64/16/cubic). Measuredconjectured 128 / proven(ldr) 128is the cubic/16/64 row (quadratic/8/42 = 127/75). Relabeled.>= 128floor on conjectured AND proven(ldr) bits (measured 128/128). A floor only catches a regression, never blesses a change.prover.rs) — extractedFRI_NUM_QUERIES/BLOWUP/GRINDING/EXTENSION_DEGREEconsts withconst _: () = assert!(..)guards, so a silent edit fails the BUILD (verified:42->evaluation panicked: FRI query count moved off 64). Same discipline as the PQV2-03 anchor-ring floor.verify_cost.rssaid the size was "pinned by the KAT suite"; no such pin existed. Addedkat_proof_size_pinned= 98494 bytes (deterministic STARK proof). Corrected the staleprover.rsdoc figure 94.3 KB -> 96.2 KB.carrier.rs, PQV2-06) — carrier tests were mutually self-consistent, blind to a silent preimage/scheme/domain change. Addedcarrier_sighash_byte_kat_pinned+SCHEME_DOMAIN_SIGNER_NONCE == 2pin.No KAT/security constant re-blessed to force green: only the corrected report label changed; every added pin is a freshly measured deterministic value.
Coordination
Comment churn in
security_level.rs/decode_hardening.rskept minimal to merge cleanly with the concurrent PQV2-05 (claims-accuracy) PR — this touches values/assertions, not classical-vs-PQ wording.Verification (real output)
cargo fmt --check— cleancargo build --workspace— cleancargo clippy --all-targets -- -D warnings— cleancargo test -p sov-shielded-pq -p sov-runtime— sov-runtime 97/0, shielded-pq lib 71/0 (+1 justified ignore), kat 24/0, decode_hardening 18/0 (+1 justified ignore), security_level 2/0, verify_cost 2/0The two
#[ignore]d tests are a ~2-min full-tree capacity soak and a fuzz-corpus generator — neither a regression check; both correctly gated.🤖 Generated with Claude Code