Display aggregated stratum client share stats in solo (non-pooled) mining mode #159
+46
−2
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.
Problem
When running DATUM Gateway without a pool configured, the "Shares Accepted" and "Shares Rejected" counters on the web dashboard always display
0, as there is no pool to track shares against. This makes it impossible to monitor mining activity via the gateway when not connected to a pool.Community Discussion
https://x.com/innerhat/status/1979236476652261388
I'm not the only one who can see the confusion around the feature, and I can do something to help.
Solution
This PR mirrors stratum client share submissions into the existing pool share counters when no pool is active/configured, allowing miners to see their mining activity on the dashboard regardless of pool configuration.
Dashboard behavior:
Note: DATUM always constructs block templates from your own Bitcoin node in all configurations. The difference is whether shares are accounted for by a pool or tracked locally.
Changes
Modified Files
src/datum_stratum.c- Added mirroring logic to increment pool counters when no pool is activesrc/datum_stratum.h- Removed stratum_client_* counter declarationssrc/datum_api.c- Simplified dashboard display logicREADME.md- Updated documentation to clarify share statistics behaviorModifications
datum_accepted_share_count/datum_rejected_share_countcountersdatum_protocol_is_active()anddatum_pool_hostto determine if pool is activePerformance Impact
Atomic Operations Cost
__atomic_add_fetch()(RELAXED)Context
Real-World Impact
Conclusion
The atomic increments only execute when no pool is active, adding a few nanoseconds per submitted share on the gateway. Template generation and delivery are completely unaffected (separate thread).
Testing
Tested with:
Could not test:
Benefits