Skip to content

Make the complete qbit P2MR v1 corpus byte-reproducible across platforms #122

Closed

Description

@kiwidream

Summary

PR #113's final head presents a versioned 70-case qbit P2MR v1 corpus, but only the 14-case witness file has an independent generation path. The remaining 56 commitment, cross-profile, and script-boundary cases are checked-in inputs that the manifest updater merely re-hashes. The exact-byte JSON files are also not forced to LF line endings.

These are the root corpus defects inherited by PRs #114 and #115; they are intentionally not duplicated in those drafts.

PR #118 fixes both defects at its reviewed head. The new follow-up can cite #118 as its candidate resolution and should close only after that fix set lands unchanged and is reverified.

Current behavior at PR #113's final head

  • The documented generator chain regenerates only p2mr_pqc_witness_vectors.json.
  • p2mr_vectors.json, p2mr_cross_profile_vectors.json, and p2mr_script_boundary_vectors.json are copied/accepted as checked-in source data.
  • update-p2mr-v1-manifest.py hashes the current bytes, so edits to 56 cases can be blessed by refreshing the manifest.
  • .gitattributes does not pin src/test/data/p2mr*.json to LF, making byte-exact hashes checkout-dependent.

Expected behavior

All authoritative corpus artifacts should be generated independently into an empty output tree, normalized identically on every platform, and compared byte-for-byte with the checked-in corpus before the manifest is accepted.

Acceptance criteria

  • Generate all commitment, cross-profile, witness, and script-boundary artifacts from explicit deterministic inputs without qbit wallet, signing, or consensus helpers.
  • Start reproduction from an empty output directory; do not copy authoritative outputs before comparison.
  • Generate the manifest only after every corpus file is regenerated.
  • Byte-compare every generated artifact and the manifest against the checked-in files.
  • Add mutation tests proving that changing any of the four corpus files cannot be legalized by merely refreshing the manifest.
  • Add src/test/data/p2mr*.json text eol=lf or an equally strict platform-independent byte policy.
  • Validate reproduction from a Windows-style checkout or equivalent CRLF-conversion test.
  • Keep the corpus case count, manifest digest, documentation, and CI summary synchronized.

Consensus impact

Consensus-adjacent. The corpus is part of the release conformance controls for qbit-specific P2MR commitment, sighash, opcode, and resource-limit behavior; false reproducibility claims can mask interoperability defects.

References

Activity

  1. added
    bug
    on Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions