-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use custom-diff shares for better proxy and worker stats #376
Conversation
Looks good, however I will review/merge it tomorrow. |
It not works as expected if proxy connected to pool, hashrate calculated twice (custom diff + accepted by pool), I think best solution is add new option to determine how hashrate should calculated, biggest issue: I have no idea how name this option.
|
You are right, I did not test this case. I'll try to make the necessary adjustments. |
Forgive my foolish oversight. Now it should work as intended. ChangesWith the new method, every share has to be considered with the diff of the worker. In the first commit, shares accepted by the pool were considered with the pool diff instead. That's a bit like calculating the hashrate based on the actual diff of the shares ... it's always too high. Method TestsThis time, I tested with a pool (fixed diff at 400015). Show log
Second, with Show log
Third, with Show log
|
Option added. As statistics (hashrates and worker share count) are calculated based on custom diff shares (via global or per-worker setting), I named it As the configuration needs to be accessed within I also did a test with a pool (fixed diff at 400015), first with Show log
|
Thank you for the quick review! |
Objective
In daemon mode, a share is only accepted when a block is successfully mined. Therefore, the statistics show zero hashrate most of the time (for the proxy and all of the workers), making them almost useless. This PR provides a solution to this problem. It can also be used to improve the statistics for high difficulty upstream connections.
Proposal
When the
custom-diff
feature is enabled, more shares are submitted to the proxy, carrying valuable information about the actual hashrate of the workers. Currently, this information is discarded.Using the existing
AcceptEvent
, an update of the statistics can be triggered for incoming shares at thecustom-diff
level. Flagging the event via its new memberisCustomDiff()
ensures correct handling by the associated subscribers.Result
With
custom-diff
enabled, the proxy is able to calculate the actual hashrate although no shares are accepted by the daemon.Setup:
custom-diff
set to 5000 for meaningful stats within 10 minutesSide effect (may be desired): The worker stats now show the same accepted shares count as the miner software of the worker and not only the count of shares sucessfully passed upstream.