dgb(#82): resolve transaction_hash_refs -> ordered other_tx hashes (reconstructor sub-slice 1) - #174
Merged
Conversation
frstrtr
force-pushed
the
dgb/won-block-other-tx-walk
branch
from
June 18, 2026 23:31
a11b3f7 to
3e895b0
Compare
This was referenced Jun 18, 2026
Merged
frstrtr
force-pushed
the
dgb/won-block-gentx-expose
branch
from
June 19, 2026 00:54
4a8c031 to
4ab5495
Compare
Won-block reconstructor connecting tissue (sub-slice 1): faithful port of p2pool get_other_tx_hashes ancestry resolution. coin/other_tx_resolver.hpp walks each (share_count, tx_count) ref back share_count generations from the won share (0 == the share itself) and indexes tx_count into that ancestors new_transaction_hashes, preserving ref order = block other_txs order. The two tracker ops (nth_parent / new_transaction_hashes lookup) are injected as callables, mirroring the seam-first decomposition of won_block_dispatch.hpp, so the walk is unit-testable against a synthetic ancestry without a live ShareTracker. Reuses the tracker ancestry walk rather than a flat known_txs map: a flat lookup cannot reproduce how the sharechain addresses a tx and diverges on duplicate txids or refs past the locally-known set. Malformed refs (tx_count OOB, share_count past chain end) throw rather than emit a wrong hash. 6 gtests pin self-share/walk-back/order/empty/both throws. Single-coin (src/impl/dgb/ only); no shared base / p2pool-merged-v36 surface. Test wired into ctest + both build.yml --target allowlists (#143).
frstrtr
force-pushed
the
dgb/won-block-gentx-expose
branch
from
June 19, 2026 01:44
4ab5495 to
7b1f57a
Compare
frstrtr
force-pushed
the
dgb/won-block-other-tx-walk
branch
from
June 19, 2026 01:44
3e895b0 to
885938d
Compare
frstrtr
added a commit
that referenced
this pull request
Jun 19, 2026
…me as_block Tie the three landed sub-slices into the single composition the dispatch handler injects as its WonBlockReconstructor: resolve_other_tx_hashes (#174) -> assemble_other_txs (#176) -> assemble_won_block (#168 framing) Faithful port of p2pool data.py Share.as_block: produces {bytes, hex} for broadcast_won_block dual path. Gentx enters as a deserialized MutableTransaction + txid (the SSOT gentx-bytes -> MutableTransaction unpack, inverse of #173 exposure, is the next slice). Injected tracker/known_txs seams keep it unit-testable; out_of_range propagation from each step preserved (never emit a partial/wrong block). dgb_reconstruct_won_block_test 5/5 PASS: end-to-end == manual resolve+assemble+frame (byte-identical), [gentx]++others in ref order, empty-refs gentx-only, ref-past-chain + unknown-known-tx throw. Wired into test/CMakeLists.txt + both build.yml --target allowlists (#143 trap). Per-coin isolation: src/impl/dgb/ only. p2pool-merged-v36 surface: none.
frstrtr
added a commit
that referenced
this pull request
Jun 19, 2026
…(--run) Stand up the run-loop spine in main_dgb.cpp behind a new --run flag: a boost::asio::io_context plus an explicit graceful shutdown driven from signal_set(SIGINT, SIGTERM), mirroring main_btc.cpp s teardown contract. This is the lifecycle every node subsystem (sharechain peer dgb::Node, embedded digibyted P2P, Stratum acceptor) and the #82 won-block dispatch handler hangs off. Standing the spine up first keeps the next increments (node/Config construction over LevelDB, P2P listen, Stratum, and the m_on_block_found -> reconstruct_won_block -> broadcast_won_block binding landed across #163/#166/#167/#173/#174/#176/#177/#179) build-verifiable rather than landing a large unverified port in one step. --selftest / bare invocation unchanged (live ShareTracker::score() path). External digibyted RPC fallback posture preserved. Build: c2pool-dgb links EXIT=0 (-DCOIN_DGB=ON). Smoke: --selftest OK (block_period=75s SSOT); --run spine up, SIGINT -> clean shutdown exit 0.
frstrtr
added a commit
that referenced
this pull request
Jun 19, 2026
…(--run) Stand up the run-loop spine in main_dgb.cpp behind a new --run flag: a boost::asio::io_context plus an explicit graceful shutdown driven from signal_set(SIGINT, SIGTERM), mirroring main_btc.cpp s teardown contract. This is the lifecycle every node subsystem (sharechain peer dgb::Node, embedded digibyted P2P, Stratum acceptor) and the #82 won-block dispatch handler hangs off. Standing the spine up first keeps the next increments (node/Config construction over LevelDB, P2P listen, Stratum, and the m_on_block_found -> reconstruct_won_block -> broadcast_won_block binding landed across #163/#166/#167/#173/#174/#176/#177/#179) build-verifiable rather than landing a large unverified port in one step. --selftest / bare invocation unchanged (live ShareTracker::score() path). External digibyted RPC fallback posture preserved. Build: c2pool-dgb links EXIT=0 (-DCOIN_DGB=ON). Smoke: --selftest OK (block_period=75s SSOT); --run spine up, SIGINT -> clean shutdown exit 0.
frstrtr
added a commit
that referenced
this pull request
Jun 19, 2026
…(--run) Stand up the run-loop spine in main_dgb.cpp behind a new --run flag: a boost::asio::io_context plus an explicit graceful shutdown driven from signal_set(SIGINT, SIGTERM), mirroring main_btc.cpp s teardown contract. This is the lifecycle every node subsystem (sharechain peer dgb::Node, embedded digibyted P2P, Stratum acceptor) and the #82 won-block dispatch handler hangs off. Standing the spine up first keeps the next increments (node/Config construction over LevelDB, P2P listen, Stratum, and the m_on_block_found -> reconstruct_won_block -> broadcast_won_block binding landed across #163/#166/#167/#173/#174/#176/#177/#179) build-verifiable rather than landing a large unverified port in one step. --selftest / bare invocation unchanged (live ShareTracker::score() path). External digibyted RPC fallback posture preserved. Build: c2pool-dgb links EXIT=0 (-DCOIN_DGB=ON). Smoke: --selftest OK (block_period=75s SSOT); --run spine up, SIGINT -> clean shutdown exit 0.
frstrtr
added a commit
that referenced
this pull request
Jun 19, 2026
…(--run) Stand up the run-loop spine in main_dgb.cpp behind a new --run flag: a boost::asio::io_context plus an explicit graceful shutdown driven from signal_set(SIGINT, SIGTERM), mirroring main_btc.cpp s teardown contract. This is the lifecycle every node subsystem (sharechain peer dgb::Node, embedded digibyted P2P, Stratum acceptor) and the #82 won-block dispatch handler hangs off. Standing the spine up first keeps the next increments (node/Config construction over LevelDB, P2P listen, Stratum, and the m_on_block_found -> reconstruct_won_block -> broadcast_won_block binding landed across #163/#166/#167/#173/#174/#176/#177/#179) build-verifiable rather than landing a large unverified port in one step. --selftest / bare invocation unchanged (live ShareTracker::score() path). External digibyted RPC fallback posture preserved. Build: c2pool-dgb links EXIT=0 (-DCOIN_DGB=ON). Smoke: --selftest OK (block_period=75s SSOT); --run spine up, SIGINT -> clean shutdown exit 0.
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.
Stacked on #173. Won-block reconstructor (#82) sub-slice 1 — integrator-approved 2026-06-19: resolve a share's transaction_hash_refs to the ordered other_tx hash list via the tracker ancestry walk (not a flat known_txs map).
What
coin/other_tx_resolver.hpp: faithful port of p2poolget_other_tx_hashes. Each(share_count, tx_count)ref walks backshare_countgenerations from the won share (0 == the share itself, matchingget_nth_parent_hash(h,0)==h), then indexestx_countinto that ancestor'snew_transaction_hashes. Ref order = block other_txs order.nth_parent/new_transaction_hasheslookup) are injected as callables — same seam-first decomposition aswon_block_dispatch.hpp— so the walk is unit-testable against a synthetic ancestry with no live ShareTracker. Run-loop binds them tochain.get_nth_parent_via_skip+chain.get_share(h).invoke(...m_tx_info.m_new_transaction_hashes).std::out_of_rangerather than emit a wrong hash.Why ref-walk, not flat map
Per integrator: a flat
known_txs[hash]lookup resolves the same hashes on the happy path but diverges the moment two ancestors announce the same txid or a ref points past the locally-known set — it cannot reproduce how the sharechain actually addresses a tx.Test
dgb_other_tx_resolver_test— 6 gtests (self-share refs, ancestor walk-back, mixed-order preservation, empty refs, tx_count-OOB throw, walk-past-chain-end throw). 6/6 PASS, build EXIT=0. Wired into ctest + both build.yml --target allowlists (#143 trap avoided).Scope
Single-coin (
src/impl/dgb/only). No shared base / CMake-root / p2pool-merged-v36 surface — only re-reads share_info already validated by share_check. HOLD merge (integrator gates; no self-merge).