dash(dashboard): Best Share + peers + found-blocks parity with LTC dashboard (v0.2.4)#790
Merged
Conversation
…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
marked this pull request as ready for review
July 21, 2026 08:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'sWebServer/MiningInterfacewiring 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_difficultyhook (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:
IWorkSource::record_best_pseudoshare(...)(default no-op → LTC/BTC/DGB unchanged). The coreStratumSession::handle_submitcalls it for every accepted pseudoshare, passing the already-computed X11 difficulty + miner + the raw submit fields.DASHWorkSourceoverrides it: recomputes the exact X11 pow-hash (shareddash_reconstruct_pow_hashhelper, byte-identical tomining_submit/compute_share_difficulty) and forwards(difficulty, miner, pow_hash)to the dashboard via a callbackmain_dashbinds toMiningInterface::record_share_difficulty.record_share_difficulty/BestDifficulty//best_sharenow also carry the share hash + timestamp; a compactbest_shareblock 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_sharepopulated:{ "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)
peers {incoming:0, outgoing:0}always —dash::Nodehad noget_peer_info_json,set_peer_info_fnunwireddash::Node::get_peer_info_json, ltc parity; wiredset_peer_info_fn)DASHWorkSourcefires a found-block hook after dual-path dispatch;main_dashrecords viarecord_found_blockAlready 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_value2.381 /block_value_miner0.595 viacoin_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_fnis tied to embeddedcoin_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: onerecord_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-dashbuilds clean (0 errors)./best_share+/local_statspopulated as above. No production deploy (hotel deploy is an operator tap).DRAFT — no merge, no deploy.