Skip to content

PR-C: web_server retype to core::coin::ICoinNode + set_coin_node wiring (btc smoke green)#80

Merged
frstrtr merged 4 commits into
masterfrom
btc/pr-c-web_server-icoinnode-retype
Jun 11, 2026
Merged

PR-C: web_server retype to core::coin::ICoinNode + set_coin_node wiring (btc smoke green)#80
frstrtr merged 4 commits into
masterfrom
btc/pr-c-web_server-icoinnode-retype

Conversation

@frstrtr

@frstrtr frstrtr commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Final red-to-green step for btc smoke (also unblocks #75/#77).

What

Retypes the web_server coin-node seam to core::coin::ICoinNode and restores the set_coin_node wiring de-scoped from PR-A.

Commits

  1. Revert de-scope of set_coin_node wiring (ad05cc0) — restores embedded-branch get_mining_interface() wiring.
  2. core/web_server: retype coin-node seam from concrete ltc NodeRPC to core::coin::ICoinNode (removes NodeRPC::getwork/submit_block_hex link coupling).
  3. build(c2pool-btc): link ltc_coin so ltc OBJECT-lib protocol handlers resolve ltc::coin::{Mutable,}Transaction ctors (mirrors c2pool/c2pool_enhanced; btc-target-only).

Verification

Note: residual web_server ltc share-message/config refs remain (later-B-phase decouple); c2pool-btc still links ltc by design for those.

frstrtr added 4 commits June 11, 2026 02:29
web_server is SHARED core but held raw pointers to CONCRETE impl/ltc types
(ltc::coin::NodeRPC, ltc::interfaces::Node, ltc::coin::CoinNodeInterface),
which left undefined ltc:: coin-RPC symbols (NodeRPC::getwork/submit_block_hex)
in the BTC link and kept btc smoke red.

Collapse the three concrete pointers + two setters (set_coin_rpc /
set_embedded_node) in both MiningInterface and WebServer into a single
core::coin::ICoinNode* + set_coin_node(). The concrete per-coin node
(ltc::coin::CoinNode / btc::coin::CoinNode) now makes the embedded-vs-rpc
decision coin-side and crosses the seam only via get_work_view() (agnostic
WorkView slice), submit_block_hex() (2-arg, no mweb), is_embedded() and
has_rpc(). Full per-coin WorkData (incl. m_txs) never leaves the coin.

No behavior change: refresh_work() keeps local wd (now a WorkView with the
same m_data/m_hashes/m_latency fields), submit path splits on has_rpc()/
is_embedded(), source labels + status JSON keys preserved, and the
WebServer initial-template-fetch timer stays rpc-only via has_rpc().

Pairs with the reverted de-scope (574e2444) that re-wires the set_coin_node
callers in c2pool_refactored.cpp.
…tors

web_server retype removed the coin-node coupling, but c2pool-btc still links the ltc OBJECT lib for web_server share-message/config symbols (later-B-phase decouple). That pulls in ltc protocol handlers needing ltc::coin::{Mutable,}Transaction ctors, which live in ltc_coin. c2pool/c2pool_enhanced already link ltc_coin; mirror that for c2pool-btc. btc-target-only.
web_server retype (d1012a4) renamed the production seam
MiningInterface::set_embedded_node(CoinNodeInterface*) ->
set_coin_node(core::coin::ICoinNode*). The phase4 test callers still
named the old API and passed a CoinNodeInterface mock, breaking the
Linux x86_64 test-suite build.

Wrap the existing CoinNodeInterface mock/embedded node in the production
ltc::coin::CoinNode adapter (the concrete ICoinNode) exactly as
c2pool_refactored.cpp:1984/1990 does, then call set_coin_node. The
adapter funnels getwork() through get_work_view(), so each test template
(height=1 mock / chain.height()+1 live) is byte-for-byte preserved.
Pure API-rename migration; test intent unchanged.
@frstrtr frstrtr merged commit 48dd2bc into master Jun 11, 2026
17 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