Skip to content

bch(kat): coinbase DGB<->BCH byte-vector pairing (slice 2) -- p2poolBCH oracle ground-truth - #195

Merged
frstrtr merged 2 commits into
masterfrom
bch/coinbase-kat-bytevector
Jun 19, 2026
Merged

bch(kat): coinbase DGB<->BCH byte-vector pairing (slice 2) -- p2poolBCH oracle ground-truth#195
frstrtr merged 2 commits into
masterfrom
bch/coinbase-kat-bytevector

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 19, 2026

Copy link
Copy Markdown
Owner

BCH coinbase KAT — byte-vector pairing (slice 2)

Standalone BCH-lane PR for the DGB<->BCH coinbase-byte KAT pairing. Separate PR by design (per-coin isolation): does NOT fold into DGB #171; #171 stays DGB-tree only.

What this adds

  • src/impl/bch/test/coinbase_kat_bytevector_test.cpp — full-coinbase serialize byte-vector asserted against p2poolBCH util/pack + data.py oracle ground-truth (gentx_before_refhash: DONATION_SCRIPT || int64(0) || OP_RETURN refhash stub). Vectors are oracle-derived, not self-generated.
  • Registers a bch_-prefixed ctest target via src/impl/bch/test/CMakeLists.txt — runs on the COIN_BCH Linux Release + ASan legs.

Relationship to slice 1

Slice 1 (coinbase_kat_segwit_predicate_test.cpp, pins the gated-segwit-OFF predicate = the one real DGB<->BCH divergence) already landed in master via #156. This PR is slice 2 only, rebased onto master.

Conformance

Builder under test = coinbase_commitment.hpp, already verified conformant vs p2poolBCH @6603b79. This is KAT-vector pinning, not a re-author. Zero p2pool-v36 surface change.

Merge operator-gated.

frstrtr added 2 commits June 19, 2026 07:34
…ctor vs p2poolBCH util/pack ground-truth

Serializes a full BCH legacy (no-SegWit) coinbase via coin/transaction.hpp and
pins the bytes against ground-truth emitted by the p2poolBCH reference packer
(p2pool/util/pack.py tx_id_type, the same oracle the share/PPLNS sweep used).
Catches any drift in field order, CompactSize/VarStr length-prefixing, int
endianness, or an accidental SegWit marker/flag byte. Completes the byte-vector
half promised by slice 1 (coinbase_kat_segwit_predicate_test). Wired as a
dedicated executable (links transaction.cpp for the out-of-line MutableTransaction
ctor), same link set as block_connector_test. p2pool-merged-v36 surface: none.
Slice 2 of the DGB<->BCH coinbase KAT pairing added
bch_coinbase_kat_bytevector_test (CMake add_executable + add_test) but
did not wire it into the explicit --target list the COIN_BCH build legs
enumerate, so the executable never compiled. ctest still saw the
add_test registration and reported it ***Not Run -> 1/20 failed on both
the Linux Release and ASan+UBSan legs.

Add the target alongside its slice-1 sibling
bch_coinbase_kat_segwit_predicate_test in both legs. Test-only, mirrors
the existing enumeration; no source or consensus change.
@frstrtr
frstrtr merged commit 9188d9e into master Jun 19, 2026
19 checks passed
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