Skip to content

ci: gate qbit P2MR v1 conformance with an independent oracle - #114

Merged
kiwidream merged 1 commit into
p2mr-v1-conformance-suitefrom
p2mr-v1-oracle-ci
Jul 13, 2026
Merged

kiwidream merged 1 commit into
p2mr-v1-conformance-suitefrom
p2mr-v1-oracle-ci

Conversation

@kiwidream

@kiwidream kiwidream commented Jul 12, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add a standalone Rust qbit P2MR v1 oracle with independent transaction parsing, encoding, tagged hashes, commitments, sighash construction, witness parsing, covered script outcomes, and resource accounting.
  • Use qbit-libbitcoinpqc only at the SLH-DSA primitive-verification boundary; do not link or invoke qbit consensus, wallet, signing, descriptor, RPC, or test-framework helpers.
  • Strictly validate duplicate keys, schema, manifest purposes/digests/counts, fixture selectors, intermediate bytes, IDs, filesystem boundaries, and unsupported operations.
  • Add deterministic 70-row differential reports, exact corpus reproduction, and a visible required CI job.

This is PR 3 of 4 and is stacked on p2mr-v1-conformance-vectors.

Stack: parent #113 ← PR 3/4 → next #115.

Refs #105

Testing

  • Built locally.
  • Ran focused unit or functional tests for the changed area.
  • Ran lint or formatting checks relevant to this change.
  • Not run. Reason:

Validation included 27 Rust unit tests, all 70 oracle rows, corpus reproducibility, Rust formatting, clippy with warnings denied, the qbit P2MR suite, git diff --check, and Docker lint.

Target Branch

  • This PR targets main or a maintainer-requested release branch such as 0.1.x.

Stack review base: p2mr-v1-conformance-vectors. Final target after the parents merge: 1.0.0.

Risk / Review Notes

  • Consensus, script, crypto, wallet, P2P, release, CI, or security-sensitive behavior changed.
  • No consensus, script, crypto, wallet, P2P, release, CI, or security-sensitive behavior changed.

Notes: CI behavior changes and the oracle handles consensus-sensitive data, but node consensus behavior does not change. The focused evaluator fails unsupported rather than claiming to be a general-purpose node.

Docs / Process Impact

Choose exactly one:

  • I updated public docs because this PR changes user-visible behavior, integration guidance, release/process guidance, or expected validation.
  • No public docs update needed. Reason:

The oracle README documents its independence boundary, release binding, supported corpus surface, and limitations.

libbitcoinpqc Subtree Checklist (if src/libbitcoinpqc changed)

  • Source commit is reachable from an immutable release tag in Qbit-Org/qbit-libbitcoinpqc.
  • qbit imports the tagged upstream tree directly without pruning or a curated subtree branch.
  • Subtree import/update was performed with contrib/devtools/update-libbitcoinpqc-subtree.sh.
  • test/lint/libbitcoinpqc-subtree-check.sh passes locally.
  • Any default tag change in contrib/devtools/update-libbitcoinpqc-subtree.sh is intentional and matches doc/subtrees/libbitcoinpqc.md.

Not applicable; the subtree is unchanged.


Note

Medium Risk
No node consensus behavior changes, but the oracle encodes consensus-sensitive P2MR/PQC rules and becomes a required merge gate; incorrect oracle logic could block releases or give false confidence.

Overview
Adds a standalone Rust P2MR v1 conformance oracle (contrib/testgen/p2mr_v1_oracle) that validates the versioned test corpus without linking qbit consensus, wallet, or node code. It reimplements manifest loading, encodings, transaction parsing, commitments, sighash/witness handling, and a corpus-limited script evaluator; SLH-DSA verification is delegated only to qbit-libbitcoinpqc. Cases are checked against fixture expectations and written to a deterministic JSON report; release mode binds evidence to a clean checkout and --oracle-commit.

CI gains a required p2mr-v1-conformance job (fmt, unit tests, full verify with release binding, step summary, artifact upload) and wires it into Core Checks Gate. contrib/devtools/check-p2mr-v1-corpus-reproducible.sh regenerates witness vectors and the manifest in a temp tree and fails if committed corpus files differ.

Reviewed by Cursor Bugbot for commit 60ef8e1. Bugbot is set up for automated code reviews on this repo. Configure here.

@kiwidream
kiwidream force-pushed the p2mr-v1-oracle-ci branch 2 times, most recently from 63b8cb4 to b1f19eb Compare July 12, 2026 21:08

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 4 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit b1f19eb. Configure here.

@kiwidream
kiwidream force-pushed the p2mr-v1-oracle-ci branch from b1f19eb to 60ef8e1 Compare July 13, 2026 13:57
@kiwidream
kiwidream force-pushed the p2mr-v1-conformance-vectors branch from 72a9070 to d1948b7 Compare July 13, 2026 13:57
@kiwidream
kiwidream changed the base branch from p2mr-v1-conformance-vectors to p2mr-v1-conformance-suite July 13, 2026 14:48
@kiwidream
kiwidream merged commit 60ef8e1 into p2mr-v1-conformance-suite Jul 13, 2026
1 check passed
@kiwidream kiwidream mentioned this pull request Jul 13, 2026
6 of 14 tasks
@kiwidream

Copy link
Copy Markdown
Member Author

Merged into p2mr-v1-conformance-suite; final landing into 1.0.0 is tracked by #118.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant