Skip to content

dash(dashboard): Best Share + peers + found-blocks parity with LTC dashboard (v0.2.4)#790

Merged
frstrtr merged 1 commit into
masterfrom
dash/dashboard-parity
Jul 21, 2026
Merged

dash(dashboard): Best Share + peers + found-blocks parity with LTC dashboard (v0.2.4)#790
frstrtr merged 1 commit into
masterfrom
dash/dashboard-parity

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 21, 2026

Copy link
Copy Markdown
Owner

DASH dashboard → LTC parity (ships with v0.2.4)

Wires the DASH c2pool dashboard cards that were broken/unpopulated to the real DASH work-source / tracker / coin-state, reusing main_ltc's WebServer / MiningInterface wiring rather than forking a parallel dashboard. All changes are display-only — no share/target/payout/consensus logic is touched (confirmed below).

Base: fresh master @ 9ac8b3dd (#781).

PRIORITY-1 — Best Share card (end-to-end, populated)

The operator wants to see how close DASH solo shares got to net difficulty — solo shares rarely cross net-diff, and on the DASH path they seldom even mint onto the sharechain, so the tracker's verified-share m_on_share_difficulty hook (the only best-share feed) never fired → the 🎯 Best Share card sat empty.

Root fix — record best-share on the stratum vardiff-accept path, where every accepted pseudoshare is seen:

  • New IWorkSource::record_best_pseudoshare(...) (default no-op → LTC/BTC/DGB unchanged). The core StratumSession::handle_submit calls it for every accepted pseudoshare, passing the already-computed X11 difficulty + miner + the raw submit fields.
  • DASHWorkSource overrides it: recomputes the exact X11 pow-hash (shared dash_reconstruct_pow_hash helper, byte-identical to mining_submit/compute_share_difficulty) and forwards (difficulty, miner, pow_hash) to the dashboard via a callback main_dash binds to MiningInterface::record_share_difficulty.
  • record_share_difficulty / BestDifficulty / /best_share now also carry the share hash + timestamp; a compact best_share block is added to /local_stats; the dashboard card renders the record-hash line.

Verified live against a testnet dashd (ubuntu@192.168.86.52, isolated instance, testbed only) — a pseudoshare miner submitted and /best_share populated:

{
  "network_difficulty": 0.008288110320964296,
  "round": {
    "difficulty": 0.0007045984339726283,
    "pct_of_block": 8.501315820934325,
    "miner": "yiXsatJHYQD2u2vFVR1yeWQEUn3vDh7Ley",
    "hash": "0000058b39f949586e72742e3798efb456ba44d8f93686f2add980a9a271e78f",
    "timestamp": 1784597678
  },
  "session": { "difficulty": 0.0007045984, "pct_of_block": 8.50, "hash": "0000058b39f9...", ... },
  "all_time": { "difficulty": 0.0007045984, "pct_of_block": 8.50, "hash": "0000058b39f9...", ... }
}

i.e. the best share got to 8.5% of net difficulty, with the exact hash and the miner that found it — precisely the metric requested.

Other cards wired (audit vs LTC dashboard)

Card Before (DASH) After
Best Share 🎯 empty ("-") — no stratum feed; tracker hook never fires solo round/session/all-time difficulty + pct_of_block + hash + miner, populated from every accepted pseudoshare
Peers / node-status peers {incoming:0, outgoing:0} always — dash::Node had no get_peer_info_json, set_peer_info_fn unwired real pool p2p peers (added dash::Node::get_peer_info_json, ltc parity; wired set_peer_info_fn)
Recent blocks / found-block history DASH block wins never recorded to the dashboard DASHWorkSource fires a found-block hook after dual-path dispatch; main_dash records via record_found_block

Already correct on master and confirmed populated in the same run (reused LTC data path, no change needed): pool/network hashrate, network difficulty, miner count + per-miner rows (miner_hash_rates), shares/efficiency, block value + payout split (block_value 2.381 / block_value_miner 0.595 via coin_work_fn), attempts-to-block, uptime, sharechain tip/stats.

Not in this PR (documented follow-ups; higher-touch, coin-embedded specific): node-topology per-coin panel (set_node_topology_fn is tied to embedded coin_peer_sources) and the PPLNS current-payouts panel. DASH masternode-payee / DIP4 coinbase display has no analogous LTC slot to reuse.

Consensus-neutrality

Dashboard is read-only. The two touches on sensitive paths are strictly additive display feeds:

  • stratum_server.cpp: one record_best_pseudoshare(...) call inserted between existing statements on the already-accepted path — no control-flow, acceptance, target, or payout change.
  • work_source.cpp: the found-block hook fires after the existing dual-path dispatch decision (!payee_guard_reject) and only reads a callback.

No model/tool authorship attribution anywhere (branch/commit/PR/comments/HTML).

Build / test

  • c2pool-dash builds clean (0 errors).
  • Live testbed run against testnet dashd: web dashboard LIVE, /best_share + /local_stats populated as above. No production deploy (hotel deploy is an operator tap).

DRAFT — no merge, no deploy.

…ork source

Priority — Best Share card. On the DASH solo path shares seldom mint onto
the sharechain, so the tracker's verified-share hook never fired and the
"Best Share" card sat empty. Record every ACCEPTED stratum pseudoshare's
real X11 difficulty + miner + pow-hash into the dashboard best-share
tracker via a new IWorkSource::record_best_pseudoshare() hook that the
core stratum session fires on its vardiff-accept path (the one place every
pseudoshare is seen). DASHWorkSource overrides it to recompute the exact
pow-hash and forward to record_share_difficulty; LTC/BTC/DGB inherit a
no-op (unchanged). record_share_difficulty + BestDifficulty + /best_share
now carry the share hash; a compact best_share block is added to
/local_stats. The dashboard card renders the record hash line. The card
now shows how close the best share got to net difficulty (pct_of_block).

Peers / node-status card. Add dash::Node::get_peer_info_json (ltc node.hpp
parity) and wire MiningInterface::set_peer_info_fn so /local_stats peers
and the node-status panel report the real pool p2p peers instead of 0.

Recent-blocks card. DASHWorkSource fires a found-block hook after a won
block is dispatched to the network; main_dash records it via
record_found_block so DASH block wins appear in the found-block history.

All three are display-only feeds: no share/target/payout/consensus logic
is touched (the record_best_pseudoshare and found-block calls run after the
existing accept/dispatch decisions and only read callbacks). Verified live
against a testnet dashd: best_share populated difficulty=7.05e-4,
pct_of_block=8.5%, with the exact pow-hash + miner; miner_hash_rates,
block_value and payout split also populate through the reused LTC wiring.
@frstrtr
frstrtr marked this pull request as ready for review July 21, 2026 08:54
@frstrtr
frstrtr merged commit 991ca9e into master Jul 21, 2026
27 checks passed
@frstrtr
frstrtr deleted the dash/dashboard-parity branch July 21, 2026 08:54
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