test(lfm): the assembled epoch verifier executes under the PINNED permutation - #958
Merged
Merged
Conversation
…mutation `epoch_program` builds at `WrapHash::production()`, so by the classification rule the program emits `Instr::Hash` and must run under `BLOCK_HASHER`. Three call sites in this file passed a literal `TestPermutation` instead. Both tests stay non-ignored. - `the_assembled_epoch_verifier_runs` — the execution. - `the_assembled_verifier_rejects_tampered_leg_data` — the honest control, and the tamper loop. The middle one is the reason this is worth a PR rather than a tidy-up. The honest control is what a wrong socket permutation breaks first, and a tamper suite whose control is broken rejects every vector and reports a pass. Behaviour is unchanged at the current pin, and that is checkable rather than assumed: `impl LfmHasher for HasherKind` (hash.rs:299) dispatches `HasherKind::Test` to `TestPermutation` for `permute`, `compress_iv`, `transcript_iv`, `leaf_iv`, `compress`, `compress_out` and `transcript_out`, and the one defaulted method, `mode_iv`, composes three of those. So the two spellings agree across the whole trait surface while `BLOCK_HASHER` is `Test`, and diverge exactly when the pin moves — which is the point. Under a byte pin the naming is inert: `ByteWrapHash` lowers to the KECCAK / `LFM_BLAKE3` chips and emits no `Instr::Hash`, so the socket is never consulted. Under an algebraic pin the walks ARE `Instr::Hash`, and a toy permutation would rebuild roots the host never committed. No `hash_pin_enumeration` change: the gate scans for `DefaultStarkHash`, `DefaultStarkTranscript` and `HasherKind::default()`, this file names none of them, and its one `stark::config::` item is `Commitment`, which is allowed. Blessing the file would fire the gate's own `stale` assertion.
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.
Follow-up F1 from the #953 review, same class: a program built at
WrapHash::production()emitsInstr::Hashand must run underBLOCK_HASHER. Three sites inepoch_verify_tests.rspassed a literalTestPermutation. Both tests stay non-ignored.:510the_assembled_epoch_verifier_runs, the execution:1049the_assembled_verifier_rejects_tampered_leg_data, the honest control:1119The control is why this is worth a PR. A wrong socket permutation breaks the honest arm first, and a tamper suite whose control is broken rejects every vector and reports a pass.
Behaviour is unchanged at the current pin, and it is checkable.
impl LfmHasher for HasherKind(hash.rs:299) sendsHasherKind::TesttoTestPermutationforpermute,compress_iv,transcript_iv,leaf_iv,compress,compress_outandtranscript_out; the one defaulted method,mode_iv, composes three of those. The spellings agree whileBLOCK_HASHERisTestand diverge when the pin moves.No
hash_pin_enumerationchange. The gate scans forDefaultStarkHash,DefaultStarkTranscriptandHasherKind::default(); this file names none, and its onestark::config::item isCommitment, which is allowed. Blessing it would fire the gate's ownstaleassertion.Gate pending on box B:
cargo test --release -p lambda-vm-prover --lib -- lfm::epoch_verify_tests::the_assembled_epoch_verifier_runs lfm::epoch_verify_tests::the_assembled_verifier_rejects_tampered_leg_data --nocapture, plusmake lint.