dgb: make_reconstruct_closure_from_template — version-agnostic #82 closure builder - #280
Merged
Merged
Conversation
…osure builder Compose the run-loop WonBlockReconstructor from the captured-GBT template source (#271) instead of the share tx_hash_refs: won_share_inputs (#279, small_header + merkle_link) ++ unpack_gentx_coinbase(gentx) ++ template_other_txs -> reconstruct_won_block_from_template. Version-agnostic (dissolves the v34+ no-m_tx_info concern) and fail-closed (any error -> nullopt, announce + audit, RPC submitblock fallback still attempts). Seam-injected so it is unit-tested with no live ShareTracker/mempool. +5 KAT into dgb_reconstruct_closure_test (existing target, no new allowlist entry): success==reconstruct_won_block_from_template, empty-template=>valid coinbase-only (not nullopt), unknown-share / malformed-gentx / template-throw each fail closed. 11/11 PASS. src/impl/dgb/ only; p2pool-merged-v36 surface NONE. This is the builder the main_dgb run-loop installs in place of the nullopt stub (next slice).
This was referenced Jun 20, 2026
frstrtr
added a commit
that referenced
this pull request
Jun 23, 2026
dgb: make_reconstruct_closure_from_template — version-agnostic #82 closure builder
frstrtr
added a commit
that referenced
this pull request
Jun 23, 2026
… nullopt stub) main_dgb.cpp --run binds tracker().m_on_block_found to the FAITHFUL make_reconstruct_closure_from_template (#280) in place of the interim nullopt stub. The three version-agnostic won-block inputs are bound to the live sharechain tracker: - won_share_fields_fn: share.m_min_header + m_merkle_link (#279) - gentx_bytes_fn: generate_share_transaction(...).GentxCoinbase.bytes (#173 SSOT); v36_active re-derived from the share compile-time version inside GST, byte-identical to the verify-path invocation - template_other_txs_fn: captured-GBT non-coinbase set (#271), empty today (no per-job template retention + unfed embedded mempool => coinbase-only), correct-and-empty, NOT fail-closed Fires on the compute thread already holding the tracker lock, so the fns read tracker().chain directly (no read_tracker(), no self-deadlock). Fail-closed end to end: any builder error -> nullopt (announce + audit; RPC submitblock fallback still fires). Fenced to main_dgb.cpp; build EXIT=0; selftest OK. #82 OPEN pending a live UpdateTip won-block test.
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.
Successor to #279. Adds the version-AGNOSTIC won-block reconstruct closure builder the main_dgb run-loop installs in place of the interim nullopt stub (main_dgb.cpp:318).
What
make_reconstruct_closure_from_template(won_share_fields_fn, gentx_bytes_fn, template_other_txs_fn)in coin/reconstruct_closure.hpp.Why a separate builder
The existing make_reconstruct_closure walks share tx_hash_refs — a share-CHAIN propagation mechanism, never the block-broadcast source. This is the correct run-loop closer.
Tests
+5 KAT into existing dgb_reconstruct_closure_test (no new allowlist target, #143 trap avoided):
11/11 PASS, build EXIT=0.
Scope
src/impl/dgb/ only (2 files). p2pool-merged-v36 surface: NONE. No core/ touch. Fenced own-coin tree — DGB smoke gate suffices.
NEXT: wire this builder into main_dgb.cpp run-loop (replace the nullopt stub), binding the live tracker/chain seams — the behavior-changing close of #82 with won-block-reaches-network on both legs.