Conversation
BABE derives its authoring score and epoch-randomness contribution from SHA256(sr25519_pre_output || ml_dsa_signature). ML-DSA-44 is not unique per (key, message), so a block producer can re-sign the same binding message with randomness of their choosing until the score clears the primary threshold. The existing tests cannot catch this. They exercise only the honest signer, which calls sign_deterministic, so they pass on the grindable construction too. This test mints a second valid binding with signer-chosen randomness, asserts the verifier accepts it, then asserts the derived consensus bytes match. It is marked #[ignore] because it fails against the current derivation, which is the defect itself rather than a broken test. QUI-984 makes it pass by deriving make_bytes from the unique sr25519 pre-output alone. Remove #[ignore] as part of that change.
🤖 Augment PR SummarySummary: This PR records the BABE hybrid-VRF output uniqueness regression described in QUI-925. Changes:
Technical Notes: The test is intentionally ignored because the current derivation includes the non-unique PQ signature; QUI-984 is expected to make it pass unchanged. 🤖 Was this summary useful? React with 👍 or 👎 |
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.
Adds one
#[ignore]d test that pins the VRF uniqueness property BABE depends on, plus therand_coredev-dependency it needs.What the test does
hybrid_vrf_output_is_independent_of_the_pq_bindingsigns a BABE VRF input through the normal path, then re-signs the same binding message with signing randomness of its own choosing. It asserts three things in order:vrf_verifyaccepts the second one.make_bytesmatch for both.Assertion 3 fails today. Assertions 1 and 2 pass, which is the point. The verifier accepts a binding the signer chose, and the consensus-decisive bytes move with it.
Why it is ignored
The test fails against the current derivation. That failure is the defect, not a broken test.
VrfOutput::from_partscomputesSHA256(sr25519_pre_output || ml_dsa_signature), and ML-DSA-44 is not unique per (key, message), so a block producer can re-sign until the authoring score clears the primary threshold.Marking it
#[ignore]keeps the suite green while the property stays recorded in code. Default runs print the reason:QUI-984 makes it pass by deriving
make_bytesfrom the unique sr25519 pre-output alone. Remove#[ignore]as part of that change. The test must then pass unmodified.Why the existing tests do not cover this
hybrid_vrf_roundtrip_worksandhybrid_vrf_output_matches_signed_proof_outputexercise only the honest signer, which callssign_deterministic. They pass on the grindable construction.hybrid_vrf_rejects_tampered_pq_bindingchecks that a corrupted binding is rejected, which is a different property from uniqueness.Verification
Run with
--ignored, the test fails on assertion 3. The RNG is a deterministic counter, so the failure output is byte-stable across runs.Notes
rand_coremoved toquip-crypto-primitives-corein 64270a9, so this adds it back as a dev-dependency ofquip-crypto-primitives, pinned at 0.6 to match whatfips204expects.cargo fmt --checkreports diffs across the wholequip/tree, including files this PR does not touch. The tree uses four spaces while the repo rustfmt config selects tabs. That is pre-existing and left alone.Tracked by QUI-925. Blocked by QUI-984.