Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
e5c5ba9
bch(m5): EmbeddedDaemon real-seam tests + network-free assemble() split
frstrtr Jun 18, 2026
92d95e5
bch(m5): AblaBlockFeed GAP/never-undercut regression test
frstrtr Jun 18, 2026
2c027c8
bch(m5): register impl_bch test subdir in CMake — ABLA seam tests RUN…
frstrtr Jun 18, 2026
f151cc6
bch(m5): BlockConnector — full_block -> mempool reconciliation (block…
frstrtr Jun 18, 2026
6865127
bch(m5): BlockConnector BIP130 ordering edge cases — orphan-reject + …
frstrtr Jun 18, 2026
1b39aa1
bch(m5): flip VM300 cold-start anchor pin dry-run -> live (operator-a…
frstrtr Jun 18, 2026
a1aedcd
bch(m5): UTXO-connect leg — connect_block applied on best-chain conne…
frstrtr Jun 18, 2026
e3f1c89
bch(m5): compact-block (BIP152) ingest + reorg/disconnect leg on conn…
frstrtr Jun 18, 2026
b22fc39
bch(m5): headers-first IBD continuation on the sync seam
frstrtr Jun 18, 2026
2cc7de4
bch(m5): windowed headers-first block download — close the IBD block-…
frstrtr Jun 18, 2026
66166bb
bch(m5): in-flight timeout/eviction for the block-download window
frstrtr Jun 18, 2026
7d14eef
bch(m5): fold master ee7d405b (#133 M5 share-layer landed) into embed…
frstrtr Jun 18, 2026
4a36765
bch(m5): wire periodic block-download expire() tick into NodeP2P poll
frstrtr Jun 18, 2026
a731700
bch(m5): instrument cumulative block re-issue tally for IBD evidence
frstrtr Jun 18, 2026
4bd621c
bch(m5): c2pool-bch exe-wire entrypoint driving live ABLA budget path
frstrtr Jun 18, 2026
4406dd3
bch(m5): IBD evidence plumbing — false-eviction accounting + new_head…
frstrtr Jun 18, 2026
cdc3990
bch(m5): --ibd read-only headers-first IBD run-loop over P2P front-end
frstrtr Jun 18, 2026
1982694
bch(m5): set BCHN P2P net-magic on --ibd config so handshake completes
frstrtr Jun 18, 2026
c4088df
bch(m5): surface live ABLA budget+cursor in --ibd evidence loop
frstrtr Jun 18, 2026
00071ee
bch(m5): --near-tip IBD mode seeds header origin at BCHN anchor to ex…
frstrtr Jun 18, 2026
d8a1e75
bch(m5): pull block bodies for ALL header batch shapes so near-tip AB…
frstrtr Jun 18, 2026
5c7169f
bch(m5): pin genesis hashes vs BCHN v29.0.0 chainparams; close TODO(M3)
frstrtr Jun 18, 2026
422d1dd
bch(m5): ABLA budget-GROWTH soak fixture — prove dynamic rise above 3…
frstrtr Jun 18, 2026
78a1aea
bch(m5): fold master 708f6443 (DGB #150-152, DASH #146-147) into embe…
frstrtr Jun 18, 2026
92198be
bch(m5): sync-to-peer-tip convergence soak for headers-first IBD
frstrtr Jun 18, 2026
30d7f2c
bch(m5): startup block-solution scan fires m_on_block_found
frstrtr Jun 18, 2026
90a3553
bch(m5): dual-path won-block broadcaster on EmbeddedDaemon (gate A+B)
frstrtr Jun 18, 2026
9fed495
bch(m5): pool-node won-block sink + reconstruct_won_block as_block seam
frstrtr Jun 18, 2026
9f9b596
bch(m5): entrypoint won-block sink standup (broadcaster-gate leg C, p…
frstrtr Jun 18, 2026
0c0e81b
bch(m5): clamp gentx miner vouts to 3999 (reserve donation slot)
frstrtr Jun 18, 2026
1ab67f1
bch(m5): expose serialized gentx bytes from generate_share_transaction
frstrtr Jun 18, 2026
c5fcd43
bch(m5): wire reconstruct_won_block full block assembly
frstrtr Jun 18, 2026
0b15ee9
bch(m5): pool run-loop entrypoint standup (broadcaster-gate leg C, po…
frstrtr Jun 18, 2026
68f9faf
bch(m5): add has_block_broadcaster() entrypoint sink-live assert helper
frstrtr Jun 18, 2026
021a8ea
bch(m5): NodeImpl Legacy/Actual handle_message dispatch routers
frstrtr Jun 18, 2026
97aaedd
bch(m5): Legacy peer-book HANDLER cluster (addrs/addrme/ping/getaddrs)
frstrtr Jun 18, 2026
2154fe3
bch(m5): Legacy share/tx HANDLER bodies (shares/sharereq/sharereply/b…
frstrtr Jun 18, 2026
51dcd2b
bch(m5): Actual share/tx + peer-book HANDLER bodies (mirror of btc::A…
frstrtr Jun 18, 2026
5cb82a8
bch(leg-C): self-provision regtest daemon RPC creds generator
frstrtr Jun 18, 2026
55ade69
Merge remote-tracking branch 'origin/master' into bch/m5-embedded-bod…
frstrtr Jun 18, 2026
080546f
bch(leg-C): valid regtest block builder for dual-path broadcaster cap…
frstrtr Jun 19, 2026
81ca0ca
bch(leg-C): --leg-c-capture RPC leg — build+solve regtest block, subm…
frstrtr Jun 19, 2026
bf16f21
bch(leg-C): --leg-c-capture-p2p — embedded P2P relay leg of dual-path…
frstrtr Jun 19, 2026
03c28f4
bch(kat): coinbase DGB<->BCH pairing slice 1 -- gated-segwit-OFF pred…
frstrtr Jun 19, 2026
6115a98
bch(m5): standup_pool_run instantiates concrete Node, not abstract No…
frstrtr Jun 19, 2026
4913c68
ci(bch): dedicated COIN_BCH leg — close 15-target false-green merge gate
frstrtr Jun 19, 2026
d9510b0
Merge remote-tracking branch 'origin/master' into bch/m5-embedded-bod…
frstrtr Jun 19, 2026
3c83a89
test(bch): wire 4 M5 embedded-body tests into CI (#156)
frstrtr Jun 19, 2026
268eeec
bch: route 2 residual V36 gates through core::version_gate SSOT
frstrtr Jun 19, 2026
70ccc03
bch: revert config_pool donation gate to bare >=36 (bucket-3, mirror …
frstrtr Jun 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
153 changes: 153 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,159 @@ jobs:
uses: actions/upload-artifact@v7
with: { name: test-results-linux-asan, path: build_asan/Testing/, retention-days: 7 }

# ════════════════════════════════════════════════════════════════════════════
# COIN_BCH leg — Bitcoin Cash (SHA256d standalone parent, V36)
#
# Dedicated per-coin leg (integrator 2026-06-19 decision). build.yml previously
# configured ONLY -DCOIN_DGB=ON, so the 15 bch_ M5 targets never compiled and a
# gh rollup reported GREEN while exercising ZERO BCH — a false-green merge gate
# (the DGB #137 NOT_BUILT shape, but 15 targets, not one). Coin flags are
# additive independent if() guards (no mutual-exclusion), so -DCOIN_BCH=ON
# composes with COIN_DGB in one configure — but BCH ships its own c2pool-bch
# binary + its own 15 test targets, so a separate configure/leg is the clean
# per-coin signal: a BCH break reads as "COIN_BCH leg red," not buried in DGB.
# Mirrors the DGB linux/linux-asan coverage. Does NOT relax the per-coin
# source-presence guards (PR #47). ctest scoped to ^bch_ (network-free; the
# live VM300 IBD path lives in the c2pool-bch --ibd harness, not in ctest).
# ════════════════════════════════════════════════════════════════════════════
coin-bch:
name: COIN_BCH Linux x86_64
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6

- name: Install system dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
g++ cmake make libleveldb-dev libsecp256k1-dev

- uses: actions/setup-python@v6
with: { python-version: 3.12 }

- name: Install Conan 2
run: pip install "conan>=2.0,<3.0"

- name: Detect Conan profile
run: |
conan profile detect --force
sed -i 's/compiler.cppstd=.*/compiler.cppstd=20/' "$(conan profile path default)"

- name: Restore Conan cache
uses: actions/cache@v5
with:
path: ~/.conan2
key: conan2-ubuntu24-gcc13-bch-${{ hashFiles('conanfile.txt') }}

- name: Conan install
run: conan install . --build=missing --output-folder=build_bch --settings=build_type=Release

- name: Configure (-DCOIN_BCH=ON)
run: cmake -S . -B build_bch -DCMAKE_TOOLCHAIN_FILE=build_bch/conan_toolchain.cmake -DCMAKE_BUILD_TYPE=Release -DCOIN_BCH=ON

- name: Build c2pool-bch binary
run: cmake --build build_bch --target c2pool-bch -j$(nproc)

- name: Build BCH test targets
run: |
cmake --build build_bch \
--target bch_abla_floor_invariant_test bch_abla_block_feed_test \
bch_abla_block_feed_gap_test bch_header_sync_test \
bch_header_sync_progress_test bch_block_download_test \
bch_genesis_conformance_test bch_abla_growth_soak_test \
bch_coinbase_kat_segwit_predicate_test \
bch_block_connector_test bch_block_ordering_test \
bch_utxo_connect_test bch_reorg_connect_test \
bch_compact_block_connector_test \
bch_embedded_daemon_assembly_test \
bch_embedded_getwork_test bch_embedded_seam_workview_test \
bch_embedded_block_broadcast_test bch_coin_node_seam_test \
-j$(nproc)

- name: Run BCH tests
working-directory: build_bch
run: ctest --output-on-failure -j$(nproc) -R "^bch_"

- name: Upload test results on failure
if: failure()
uses: actions/upload-artifact@v7
with: { name: test-results-coin-bch, path: build_bch/Testing/, retention-days: 7 }

# ════════════════════════════════════════════════════════════════════════════
# COIN_BCH AddressSanitizer + UBSan (informational, mirrors linux-asan posture)
# ════════════════════════════════════════════════════════════════════════════
coin-bch-asan:
name: COIN_BCH Linux x86_64 (AsAN+UBSan)
runs-on: ubuntu-24.04
continue-on-error: true
steps:
- uses: actions/checkout@v6

- name: Install system dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
g++ cmake make libleveldb-dev libsecp256k1-dev

- uses: actions/setup-python@v6
with: { python-version: 3.12 }

- name: Install Conan 2
run: pip install "conan>=2.0,<3.0"

- name: Detect Conan profile
run: |
conan profile detect --force
sed -i 's/compiler.cppstd=.*/compiler.cppstd=20/' "$(conan profile path default)"

- name: Restore Conan cache
uses: actions/cache@v5
with:
path: ~/.conan2
key: conan2-ubuntu24-gcc13-bch-${{ hashFiles('conanfile.txt') }}

- name: Conan install
run: conan install . --build=missing --output-folder=build_bch_asan --settings=build_type=Release

- name: Configure (Release + AsAN + UBSan, -DCOIN_BCH=ON)
run: |
cmake -S . -B build_bch_asan \
-DCMAKE_TOOLCHAIN_FILE=build_bch_asan/conan_toolchain.cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCOIN_BCH=ON \
-DCMAKE_CXX_FLAGS="-fsanitize=address,undefined -fno-sanitize=vptr -fno-omit-frame-pointer -fno-sanitize-recover=undefined -g" \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address,undefined -fno-sanitize=vptr" \
-DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=address,undefined -fno-sanitize=vptr"

- name: Build c2pool-bch + BCH tests
run: |
cmake --build build_bch_asan \
--target c2pool-bch \
bch_abla_floor_invariant_test bch_abla_block_feed_test \
bch_abla_block_feed_gap_test bch_header_sync_test \
bch_header_sync_progress_test bch_block_download_test \
bch_genesis_conformance_test bch_abla_growth_soak_test \
bch_coinbase_kat_segwit_predicate_test \
bch_block_connector_test bch_block_ordering_test \
bch_utxo_connect_test bch_reorg_connect_test \
bch_compact_block_connector_test \
bch_embedded_daemon_assembly_test \
bch_embedded_getwork_test bch_embedded_seam_workview_test \
bch_embedded_block_broadcast_test bch_coin_node_seam_test \
-j$(nproc)

- name: Run BCH tests under sanitizers
working-directory: build_bch_asan
env:
ASAN_OPTIONS: detect_leaks=0:check_initialization_order=1:strict_string_checks=1:abort_on_error=0
UBSAN_OPTIONS: print_stacktrace=1:halt_on_error=0
run: ctest --output-on-failure -j$(nproc) -R "^bch_"

- name: Upload sanitizer test results on failure
if: failure()
uses: actions/upload-artifact@v7
with: { name: test-results-coin-bch-asan, path: build_bch_asan/Testing/, retention-days: 7 }

# ════════════════════════════════════════════════════════════════════════════
# Web-static JS verify (typecheck + build + tests + bundle-size gate)
# Covers web-static/sharechain-explorer/: the Explorer + PPLNS View
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -215,3 +215,4 @@ external/**/depends/**/docs/

# Release artifact staging area (built binaries, not source)
release-staging/
/.c2pool-bch-regtest/
58 changes: 58 additions & 0 deletions scripts/gen-bch-daemon-creds.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/usr/bin/env bash
# gen-bch-daemon-creds.sh -- self-provision BCH daemon RPC creds for the
# co-located regtest leg-C broadcaster harness.
#
# Standing rule (operator 2026-06-19): the fleet generates its own daemon RPC
# creds -- RPCUSER fixed, RPCPASS = openssl rand -- writes a localhost-only conf,
# and wires both the daemon conf and the c2pool config. The password is NEVER
# placed in any coordination card; this is [fyi], not [decision-needed].
#
# PER-COIN ISOLATION: BCH only. Tooling for the leg-C regtest host -- zero
# p2pool-merged-v36 surface (no share / PPLNS / coinbase bytes). Idempotent:
# refuses to clobber an existing conf unless --force is passed.
set -euo pipefail

RPCUSER="c2pool_bch"
DATADIR="${BCH_REGTEST_DATADIR:-$HOME/.c2pool-bch-regtest}"
DAEMON_CONF="$DATADIR/bitcoin.conf"
C2POOL_CONF="${C2POOL_BCH_CONF:-$DATADIR/c2pool-bch.conf}"
FORCE=0
[ "${1:-}" = "--force" ] && FORCE=1

mkdir -p "$DATADIR"
chmod 700 "$DATADIR"

if [ -f "$DAEMON_CONF" ] && [ "$FORCE" -ne 1 ]; then
echo "conf exists: $DAEMON_CONF (pass --force to regenerate); leaving creds intact" >&2
exit 0
fi

RPCPASS="$(openssl rand -hex 32)"

umask 077
cat > "$DAEMON_CONF" <<CONF
# BCH regtest -- localhost-only, leg-C broadcaster harness. Generated; do not commit.
regtest=1
server=1
listen=1
[regtest]
rpcbind=127.0.0.1
rpcallowip=127.0.0.1
rpcuser=$RPCUSER
rpcpassword=$RPCPASS
bind=127.0.0.1
CONF
chmod 600 "$DAEMON_CONF"

cat > "$C2POOL_CONF" <<CONF
# c2pool-bch regtest -- points the embedded-daemon external-RPC fallback at the
# co-located regtest node. Generated; do not commit.
bch_rpc_address=127.0.0.1
bch_rpc_user=$RPCUSER
bch_rpc_password=$RPCPASS
bch_network=regtest
CONF
chmod 600 "$C2POOL_CONF"

echo "wrote $DAEMON_CONF and $C2POOL_CONF (mode 600, localhost-only)" >&2
echo "RPCUSER=$RPCUSER RPCPASS=<32-byte openssl rand, in conf only, NOT echoed>" >&2
48 changes: 48 additions & 0 deletions src/c2pool/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,54 @@ target_link_libraries(c2pool-dgb
nlohmann_json::nlohmann_json
${Boost_LIBRARIES}
)
# c2pool-bch: Bitcoin Cash (SHA256d standalone parent, V36) — EXE-WIRE slice.
# Closes the "no runnable c2pool-bch entrypoint" gap (integrator 2026-06-18):
# the M5 lane was pure state-machine + ctest with no main_bch.cpp. Mirrors the
# c2pool-dgb add_executable shape but is even leaner: main_bch.cpp drives the
# LIVE header-only ABLA template-budget path (impl/bch/coin/abla.hpp, 1:1 BCHN
# consensus/abla.cpp port). abla.hpp is std-only (no core/yaml/uint256/leveldb),
# so this target links NOTHING beyond the standard runtime — it never drags in
# the core OBJECT-lib web_server/stratum tangle that forces c2pool-btc to pull
# ltc/payout/merged. The global src/ include path resolves <impl/bch/...>. The
# P2P IBD run-loop (coin/p2p_node.cpp read-only sync vs VM300 .110:8333) and its
# live numbers are the NEXT --ibd slice; kept separate so this lands additive.
# Per-coin isolation held: src/impl/bch only, no shared-base/core edits.
add_executable(c2pool-bch
main_bch.cpp
# BCH coin impl TUs (M3 deferred impl_bch reg, now forced by --ibd harness
# needing to LINK bch:: symbols). Compiled directly into the target, exactly
# as the bch tests add coin/transaction.cpp; per-coin isolation holds.
${CMAKE_SOURCE_DIR}/src/impl/bch/config_coin.cpp
${CMAKE_SOURCE_DIR}/src/impl/bch/config_pool.cpp
${CMAKE_SOURCE_DIR}/src/impl/bch/coin/transaction.cpp
${CMAKE_SOURCE_DIR}/src/impl/bch/coin/p2p_connection.cpp
${CMAKE_SOURCE_DIR}/src/impl/bch/coin/p2p_node.cpp
${CMAKE_SOURCE_DIR}/src/impl/bch/coin/coin_node.cpp
${CMAKE_SOURCE_DIR}/src/impl/bch/coin/rpc.cpp
)
target_compile_definitions(c2pool-bch PRIVATE C2POOL_VERSION="${C2POOL_GIT_VERSION}")
# --ibd RUN-LOOP slice (integrator 2026-06-18): the read-only headers-first IBD
# harness stands up EmbeddedDaemon over its P2P front-end (NodeP2P/HeaderChain/
# Timer), which pulls the core OBJECT-lib + Boost.Asio. Adding ONLY these link
# deps (core + btclibs + yaml-cpp + json + Boost), matching the c2pool-dgb tier,
# is SAFE-ADDITIVE on this target (integrator explicitly cleared it): no shared-
# base/core SOURCE edit, src/impl/bch headers only, per-coin isolation held. The
# --selftest path remains the std-only ABLA budget driver. core is an OBJECT lib
# so it links all its objects (incl. web_server/stratum) — those symbols already
# resolve in the full c2pool target; we depend on the same set here.
target_link_libraries(c2pool-bch
# OBJECT-lib SCC direct-naming (#22/#39): core is monolithic; its stratum_server/
# web_server objects reference the whole pool/payout/merged/hashrate/storage/
# difficulty SCC, so every core consumer names the full set. Identical to the
# bch test link set; merged is the shared core SCC (BCH never invokes it), NOT
# BCH-specific merged-mining logic -> per-coin isolation holds.
core pool sharechain
c2pool_payout c2pool_merged_mining c2pool_hashrate c2pool_storage c2pool_difficulty
btclibs
yaml-cpp::yaml-cpp
nlohmann_json::nlohmann_json
${Boost_LIBRARIES}
)

# Windows: Boost.Asio requires Winsock libraries; /bigobj for large translation units
if(WIN32)
Expand Down
Loading
Loading