mirror of
https://github.com/luxfi/chains.git
synced 2026-09-24 00:26:00 +00:00
The accelerated batch path re-implemented two things the sequential path already did, and got both wrong. 1. It re-listed the block-correspondence fields itself and omitted ReceiptsRoot, which verifyStampSync checks. A stamp carrying a forged receipts root was therefore accepted whenever accel was available and the batch cleared DilithiumBatchThreshold, and refused otherwise — acceptance decided by host hardware. Both paths now call stampMatchesBlock, the one definition. 2. The hybrid post-quantum leg read signDataSlice[0] for every stamp: signDataSlice is indexed by BATCH POSITION while indices maps position to stamp index, and the loop discarded the position. Every hybrid stamp's SLH-DSA signature was verified against the FIRST batch entry's signing bytes. That both false-rejects honest stamps and, since a batch submitter chooses what entry zero contains, accepts a signature made over data the stamp does not commit to. Proven against the pre-fix logic: a correctly signed hybrid stamp at batch position 1 failed; a stamp carrying a signature over another stamp's bytes passed; a forged ReceiptsRoot passed the batch field list. Tests: TestHybridBatchVerifiesEachStampAgainstItsOwnData, TestHybridBatchRejectsSignatureOverAnotherStampsData, TestStampMatchesBlockCoversReceiptsRoot. Co-authored-by: Hanzo Dev <[email protected]>