dgb(#82): SSOT gentx coinbase assembler + oracle-pinned round-trip KAT - #171
Merged
Conversation
…-trip KAT Factor the p2pool non-witness coinbase (gentx) wire layout out of generate_share_transaction() (share_check.hpp:933, the verification SSOT) into coin/gentx_coinbase.hpp::assemble_gentx_coinbase() so emission and verification cannot diverge on a byte. Pure: takes already-built scripts/amounts (no tracker/share-template dependency) so it is directly KAT-able; this is the single builder that create_local_share() and the won-block reconstruction body will consume in follow-up slices. KAT vectors are GROUND-TRUTH from the canonical oracle frstrtr/p2pool-dgb-scrypt (util/pack.py byte logic + bitcoin/data.py tx_id_type; donation script 4104ffd0...ac), not self-generated, so a PASS proves build -> non-witness serialize -> double-SHA256 == oracle bytes/txid, not mere self-consistency. Covers the no-segwit and witness-commitment-first layouts; the only DGB<->BCH divergence is the gated segwit predicate at serialize time. dgb_gentx_coinbase_test 3/3 PASS, build EXIT=0; target wired into ctest + BOTH build.yml --target allowlists (#143 NOT_BUILT trap avoided). Scope: factor + KAT only. The won-block-reaches-network wiring (m_on_block_found and submit_block_hex) is fix #82 and stays separate.
frstrtr
force-pushed
the
dgb/gentx-coinbase-ssot
branch
from
June 18, 2026 21:26
5089c6e to
79d7a33
Compare
This was referenced Jun 18, 2026
frstrtr
added a commit
that referenced
this pull request
Jun 19, 2026
…coinbase generate_share_transaction (verification path) and create_local_share (emission path) each open-coded the coinbase wire layout (version|vin|vouts|locktime) and the txid double-SHA256. Two byte paths pinned to the same oracle vector = proven-equivalent, not unified: a third edit could still diverge them. Collapse both onto dgb::coin::assemble_gentx_coinbase() (coin/gentx_coinbase.hpp, the #171 SSOT) so emission == verification == one source. Each call site now only builds its per-share inputs (coinbase script, optional segwit witness-commitment script, PPLNS payout outputs, donation, OP_RETURN ref commitment) and hands them to the assembler; the assembler owns wire framing + txid. PackStream tx is reconstructed from the SSOT bytes so the downstream V36 hash_link diagnostics are byte-for-byte unchanged. No oracle vector regeneration. Single-coin scope: src/impl/dgb/ only. dgb build EXIT=0; dgb_share_test 5/5; dgb_gentx_coinbase_test 3/3.
frstrtr
added a commit
that referenced
this pull request
Jun 19, 2026
…coinbase generate_share_transaction (verification path) and create_local_share (emission path) each open-coded the coinbase wire layout (version|vin|vouts|locktime) and the txid double-SHA256. Two byte paths pinned to the same oracle vector = proven-equivalent, not unified: a third edit could still diverge them. Collapse both onto dgb::coin::assemble_gentx_coinbase() (coin/gentx_coinbase.hpp, the #171 SSOT) so emission == verification == one source. Each call site now only builds its per-share inputs (coinbase script, optional segwit witness-commitment script, PPLNS payout outputs, donation, OP_RETURN ref commitment) and hands them to the assembler; the assembler owns wire framing + txid. PackStream tx is reconstructed from the SSOT bytes so the downstream V36 hash_link diagnostics are byte-for-byte unchanged. No oracle vector regeneration. Single-coin scope: src/impl/dgb/ only. dgb build EXIT=0; dgb_share_test 5/5; dgb_gentx_coinbase_test 3/3.
frstrtr
added a commit
that referenced
this pull request
Jun 19, 2026
…icate pin Pins the one real DGB<->BCH coinbase divergence: BCH gates the SegWit commitment vout on is_segwit_activated(version), which the p2poolBCH oracle derives from getattr(net,"SEGWIT_ACTIVATION_VERSION",0) -> 0 -> false for every share version. Asserts the predicate is OFF across v17..v36 (and the sentinel stays disabled), so a regression re-introducing a non-zero SEGWIT_ACTIVATION_VERSION (the old stray-17 port -> sharechain fork) fails CI. Wired into BCH_ABLA_TESTS (pure, header-only over share_types.hpp). Byte-vector half (full coinbase vs oracle ground-truth) is the follow slice. Separate BCH-lane PR per per-coin isolation; #171 stays DGB-tree only. p2pool-merged-v36 surface: none.
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.
What
Per integrator [2026-06-19T00:00 +04] adjudication: the coinbase-byte factor + round-trip KAT, scoped to factor + KAT only (won-block-reaches-network wiring is fix #82, kept separate).
Coverage
Verification
Out of scope (sequenced, not absorbed)
HOLD merge.