dgb(#82): faithful won-block reconstruct closure + fail-closed KAT - #265
Merged
Conversation
make_reconstruct_closure (coin/reconstruct_closure.hpp) is the run-loop WonBlockReconstructor main_dgb.cpp binds in place of the interim nullopt stub: it composes the landed slices into p2pool Share.as_block -- share-field + gentx-regen seams -> unpack_gentx_coinbase -> reconstruct_ won_block (resolve refs -> assemble other_txs -> frame block). All sharechain/mempool access is INJECTED so the closure is unit-testable with no live tracker. Reward-path fail-closed: the callback fires on the compute thread and a broad std::exception catch yields std::nullopt (never throws, never a partial block) on ANY missing share, missing known-tx, out-of-range ref-walk, gentx-regen failure, or malformed gentx -- announce + audit, RPC submitblock fallback still attempts. dgb_reconstruct_closure_test 6/6 (success == reconstruct_won_block on same inputs; 5 distinct error paths each -> nullopt + loud log). Wired into test CMake + both build.yml allowlists. src/impl/dgb/ 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.
Faithful run-loop WonBlockReconstructor (#82) replacing the interim nullopt stub.
coin/reconstruct_closure.hpp — make_reconstruct_closure composes the landed slices into p2pool Share.as_block: share-field + gentx-regen seams -> unpack_gentx_coinbase -> reconstruct_won_block (resolve refs -> assemble other_txs -> frame). All sharechain/mempool access INJECTED -> unit-testable with no live tracker.
Reward-path fail-closed: broad std::exception catch -> std::nullopt (never throws off the compute thread, never a partial block) on ANY missing share / missing known-tx / out-of-range ref-walk / gentx-regen failure / malformed gentx. Announce + audit; RPC submitblock fallback still attempts independently.
dgb_reconstruct_closure_test 6/6: success path == reconstruct_won_block on same inputs; 5 distinct error paths each -> nullopt + loud log. Wired into test CMake + both build.yml allowlists.
Per-coin isolation: src/impl/dgb/ only. p2pool-merged-v36 surface: none. HOLD merge (integrator tap).