Skip to content

btc: reconstructor slice 3/7 — template_capture FIFO GBT-tx store (btc::coin::TemplateCapture) - #837

Merged
frstrtr merged 1 commit into
masterfrom
btc/template-capture
Jul 25, 2026
Merged

btc: reconstructor slice 3/7 — template_capture FIFO GBT-tx store (btc::coin::TemplateCapture)#837
frstrtr merged 1 commit into
masterfrom
btc/template-capture

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 24, 2026

Copy link
Copy Markdown
Owner

Reconstructor slice 3/7, stacked on #835 (btc/gentx-coinbase-ssot).

Adds btc::coin::TemplateCapture — a FIFO store of the GBT transactions used to build a template, so a share can be faithfully reconstructed back into a full block. Coin-agnostic behavior mirrors the DGB reconstructor arc.

  • btc_share_test: 80/80 green
  • Scope: btc-tree only
  • HEAD: 3e4430b

Merge behind #835.

…onstructor slice 3/7)

Add btc::coin::TemplateCapture: a bounded FIFO store keyed by share_hash
that retains each handed-out GBT transactions[] so the won-block
reconstructor replays the EXACT non-coinbase set the share committed to,
not a live-mempool re-selection (merkle-consistent only on a static
mempool -> daemon-rejected block -> lost reward in prod). Miss replays an
empty array -> valid coinbase-only block, never fail-closed. Body-identical
to src/impl/dgb/coin/template_capture.hpp (namespace + log tag swap only).

Leaf slice: opaque to transactions[] content, so pinned WITHOUT the
slice-5 make_template_other_txs_fn bridge. New template_capture_test.cpp
(5 KATs) rides the allowlisted btc_share_test. Local btc_share_test 80/80.
btc-tree-only.
@frstrtr
frstrtr force-pushed the btc/template-capture branch from 3e4430b to ffd500c Compare July 25, 2026 04:46
@frstrtr
frstrtr merged commit 92c4b31 into master Jul 25, 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