Skip to content

btc: BIP 35 mempool pull on connect -> POPULATED G3b templates - #566

Merged
frstrtr merged 1 commit into
masterfrom
btc/g3b-mempool-bip35-ingest
Jun 27, 2026
Merged

btc: BIP 35 mempool pull on connect -> POPULATED G3b templates#566
frstrtr merged 1 commit into
masterfrom
btc/g3b-mempool-bip35-ingest

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 27, 2026

Copy link
Copy Markdown
Owner

What

Embedded BTC TemplateBuilder produced coinbase-only (nTx=1) won blocks — the G3b POPULATED residual. The new_tx -> mempool.add_tx subscription in main_btc only sees txs announced via inv after connect; txs already resident in the bitcoind mempool at connect time (e.g. a seeded regtest mempool) were never requested.

Fix

  • Expose btc::coin::Node::enable_mempool_request() — forwards to NodeP2P (applied at start_p2p and on any later reconnect).
  • Call it from main_btc after start_p2p, so the BIP 35 mempool request fires on connect and the existing new_tx subscription ingests the pulled txs.
  • Mirrors the established main_dgb.cpp pattern. BTC-fenced; no cross-coin contract change.

Prereq for live proof

Peer must advertise NODE_BLOOM or NodeP2P skips the request (logged) to avoid a disconnect. Regtest re-drive must launch bitcoind with -peerbloomfilters=1. Normal inv relay is unchanged.

Verification

  • cmake --build build --target c2pool-btc clean.
  • Live proof = G3b re-drive on .121 showing a won block with nTx>1 (next step, deploy-gated).

Held for operator tap — I do not self-merge.

…r produces POPULATED blocks

The new_tx -> mempool.add_tx subscription in main_btc only sees txs
announced via inv AFTER connect. Txs already resident in the bitcoind
mempool at connect time (e.g. a seeded regtest mempool) were never
requested, so won blocks were coinbase-only (nTx=1) — the G3b POPULATED
residual.

Expose Node::enable_mempool_request() (forwards to NodeP2P, applied at
start_p2p time and to any later reconnect) and call it from main_btc
after start_p2p. Mirrors the established main_dgb pattern. Peer must
advertise NODE_BLOOM (regtest: -peerbloomfilters=1) or NodeP2P skips the
request (logged) to avoid a disconnect; normal inv relay is unchanged.

BTC-fenced; no cross-coin contract change.
@frstrtr
frstrtr merged commit 414cf41 into master Jun 27, 2026
21 checks passed
frstrtr added a commit that referenced this pull request Jun 27, 2026
btc: g3b POPULATED re-drive harness (turnkey #566 BIP35 proof)
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