Skip to content

dgb(#82): resolve other_tx hashes -> MutableTransaction other_txs (reconstructor sub-slice 2) - #176

Merged
frstrtr merged 1 commit into
dgb/won-block-other-tx-walkfrom
dgb/won-block-other-tx-assemble
Jun 19, 2026
Merged

dgb(#82): resolve other_tx hashes -> MutableTransaction other_txs (reconstructor sub-slice 2)#176
frstrtr merged 1 commit into
dgb/won-block-other-tx-walkfrom
dgb/won-block-other-tx-assemble

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Stacked on #174 (base = dgb/won-block-other-tx-walk @3e895b0b). Won-block reconstructor (#82) sub-slice 2.

What

coin/other_tx_assembler.hpp = the bridge from the ordered other_tx hash list (resolve_other_tx_hashes, sub-slice 1) to the deserialized MutableTransaction vector that assemble_won_block frames as txs = [gentx] ++ other_txs. Faithful port of p2pool data.py as_block: other_txs = [known_txs[h] for h in transaction_hashes].

  • known-tx lookup INJECTED as (hash)->const MutableTransaction* (nullptr=unknown), same seam-first shape as sub-slice 1 / won_block_dispatch.hpp.
  • missing hash THROWS std::out_of_range (loud failure: a dropped other_tx => wrong merkle root => daemon-rejected block; never emit a partial block).

Integrator asks answered

  1. BCH mirror: BCH has not landed a won-block reconstructor / known_txs resolver (bch/m5-embedded-body-wip), so there is no BCH witness artifact to mirror for this bridge. The lookup is coin-agnostic and needs no witness fork — no DGB-only divergence, no [blocker].
  2. Segwit-active reachable on DGB? YES — share_types.hpp SEGWIT_ACTIVATION_VERSION, v36 >= it; witness framing is live, not dead code. KAT pins a witness-bearing other_tx flips the block to the TX_WITH_WITNESS codec via the other_tx leg (not gentx-only).

Test

dgb_other_tx_assembler_test 5/5 PASS — order-preserve, missing-throws, empty, end-to-end resolve->assemble->frame (coinbase-first, ref order), witness reachability. Wired into test/CMakeLists.txt + BOTH build.yml --target allowlists (#143 NOT_BUILT trap). build EXIT=0.

Scope

Per-coin isolation: src/impl/dgb/ only. p2pool-merged-v36 surface: NONE. HOLD merge — no self-merge; lands after #173/#174 once whole rollup is green.

…b-slice 2)

Won-block reconstructor connecting tissue (sub-slice 2): coin/other_tx_assembler.hpp
bridges the ordered other_tx hash list from resolve_other_tx_hashes (sub-slice 1)
to the deserialized MutableTransaction vector that assemble_won_block frames as
txs = [gentx] ++ other_txs. Faithful port of the known_txs lookup in p2pool
data.py Share.as_block: other_txs = [known_txs[h] for h in transaction_hashes].

The known-tx lookup is INJECTED as a (hash) -> const MutableTransaction* callable
(nullptr == unknown), mirroring the seam-first decomposition of sub-slice 1 and
won_block_dispatch.hpp, so the bridge is unit-testable against a synthetic
known-tx set without a live mempool. A missing hash THROWS std::out_of_range
rather than dropping/placeholder-filling the tx: a block with a missing other_tx
has the wrong merkle root and is daemon-rejected, so loud failure is strictly
safer than emitting a malformed block.

Witness framing is not decided here -- the txs are returned verbatim and the
block witness shape stays governed by assemble_won_block`s TX_WITH_WITNESS
conditional codec. DGB is segwit-active (SEGWIT_ACTIVATION_VERSION, v36 >= it),
so the path is live; the KAT pins that a witness-bearing other_tx flips the
assembled block to the witness codec via the other_tx leg, not gentx-only.

dgb_other_tx_assembler_test: 5/5 PASS -- order-preserve, missing-throws, empty,
end-to-end resolve->assemble->frame (coinbase-first, ref order), witness
reachability. Wired into test/CMakeLists.txt + both build.yml --target
allowlists (#143 NOT_BUILT trap). Per-coin isolation: src/impl/dgb/ only;
p2pool-merged-v36 surface: NONE.
@frstrtr
frstrtr force-pushed the dgb/won-block-other-tx-walk branch from 3e895b0 to 885938d Compare June 19, 2026 01:44
@frstrtr
frstrtr force-pushed the dgb/won-block-other-tx-assemble branch from a11b3f7 to 24971a5 Compare June 19, 2026 01:44
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
frstrtr merged commit 3b9e0e5 into dgb/won-block-other-tx-walk Jun 19, 2026
1 check passed
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.
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