Skip to content

dgb(#82): faithful won-block reconstruct closure + fail-closed KAT - #265

Merged
frstrtr merged 1 commit into
masterfrom
dgb/won-block-reconstruct-closure
Jun 20, 2026
Merged

dgb(#82): faithful won-block reconstruct closure + fail-closed KAT#265
frstrtr merged 1 commit into
masterfrom
dgb/won-block-reconstruct-closure

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 20, 2026

Copy link
Copy Markdown
Owner

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).

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.
@frstrtr
frstrtr merged commit f785aea into master Jun 20, 2026
27 checks passed
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