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
Share stats for solo mining #246
Comments
The summary report will need to be implemented for solo minig as it is currently generated in No changes are anticipated to the report fiields or format. |
Another problem was discovered durting tyesting of v3.12.4, the miner will silently discard has |
The next release will have the new block and summary logs implemented for getwork. Summary log was implemented in workoi_get_work which is called by the workio thread only New block log is implemented in get_upstream_work for the same reasons. The format of the summary log is unchanged for now, the new block log is slightly modified [algo] [URL] block {height], diff [net_diff] |
cpuminer-opt-3.12.4.2 is released with initial implementation of block and summary logs for getwork. User feedback is welcome. |
One of the follow up issues is the silent discard of stale blocks. The first problem is a log is only Anotther problem is there is no mechanism to communicate the error back from These 2 problems combined create the silent stale scenario. Always producing the discard Another more phylosophical question is whther the block should be discarded or submitted There are actually 2 tests affected: the stale work test which was seen in recent testing, I'm leaning toward submitting just in case it might be accepted accepted. after all te work to That's 2 reasons to submit. Comments welcome. Edit: Correction: stratum performs the stale work test but not the stale block test because stratum There's a third reason, [stratum has no similar tests]. The tests by getwork are 1, a On its surface this seems like the right thing to do, and in most cases it would be. As previously stated allowing the likely stale block to be submitted makes the stats record the I'm not quit eready to make the final decision but I haven't found a practical reason to |
Just after stating stratum didn't perform the last muinute stale test, I didi some testing I found Scryptn2 at zergpool has a chronic stale share problem. The logs show a share submitted Stratum receives the job, signals the miner threads to abort their current work and get new The worst case latency is the time it takes for one thread to calculate one hash. A slow algo like Another interesting observation was made. The silent discard explains why the share stats get Disabling thesoilent discard would help keep the stats in sync as well as provide a more Unfortunately it doesn't help with the underlying chronic stale share problem, although the |
The chronic stale share problem with scryptn2 is now understood. The scrypt code does up to 24 way hashing therefore the time to calculate one hash is the same This is the result of the extremely slow hashing of scryptn2 combined with the design of the I intend no further follow up on the scryptn2 stale share problem. |
cpuminer-opt-3.12.4.3 is released. The silent discarding of suspected stale shares has been It was found to cause share count mismatches in share stats that resulted in invalid data in By submitting tthe suspected stale shares, and letting the server reject them, ensures the counters One more release is possible before this issue is closed to allow for final tweaking after user |
Of course if there are no rejects the lost hashrate should be zero and therefore not displayed. I see a couple of other issues: Duplicate new block logs, it looks like each thread reports it, easy fix. If the data isn't correct in the block log the error will likely propagate to the share and summary |
Nope. Real diff level and block times are shown in another miner and @ pool side. No way it's a day or an hour. There're some protocol dump logs in another issue, as you remeber, maybe they could make the real diff level clearer.
Yes, that is present in linux, too. |
In the new block log the diff and height should be correct. If not we have a big problem. The net hashrate is probably messed up. It's a global but I treat it like a local and overwrite it when That limits the value of future data collection until it's fixed. It's an easy fix if you're up to it. Define local net_hr and use it instead ot net_hashrate: cpu-miner.c:1427
|
There is an interest quirk in the stats for solo mining. The target diff and net diff should be the The net_diff is provided by RPC mininginfo, but the target diff is calculated by the miner from Regarding point 4: 5 min hashrate always zero. This is the effective hash rate based on submitted I think I've gone as far as possible with the available data. I'll wait a while longer to see if |
There seems to be an issue with reporting stale shares, they get reported as rejected instead |
v3.12.4.4 has some fixes to getwork stats. Please test. |
One other note is that every "Accepted" should be a "BLOCK SOLVED" when solo mining.. |
I'm on it. |
I just noticed share diff is incorrect in the share result log for stratum. It should always Edit: I have a fix for the incorrect share diff ready to go. I'll wait for your test report first in case I hope the next release is the last test release before declaring victory over this issue. |
Just released v3.12.4.5 with some more fixes. I'll take a look at your logs fro 3.12.4.4. Edit: Repeated block logs for the same block. I think I know what that is, probably just new work, What's you're opinion of new work? should it be logged like stratum logs new jobs? How much are the TTF estimates off by? How long does it usually take for you to get a block. |
I'm able to solve pretty fast. I've just seen your new release, and already have new logs from it: There's something here: That was not expected :D |
I think we should log new block number only once.
My real estimate is 4-5 blocks in 30min @ ~75Mh/s nethash
Explorer #1: https://animeco.in/explorer |
Sorry, it seems that cpuminer-opt displays correct diff, e.g. "New block 6273277, diff 118.48", only NET TTF and miner TTF values are not correct. |
That's good data. It looks like a false positive for the stale block test, probably because of invalid I'll double check the TTF calculations, the miner TTF should be the same as stratum, the For getwork the net hashrate is provided via RPC and the TTF is calculated. For stratum the net TTF is calculated by counting the new blocks over time and converting However, the share TTF and block TTF for stratum are correct so it's just a matter of doing Block is still reported as "Accepted" not "BLOCK SOLVED", need to look into that too. There's a lot more to look at. Let me know of other interesting stuff you find. |
About logging new block, part of the issue is distinguishing a new block from simply new work. Usually when solo mining the output is pretty sparse and the new work logs can provide |
Previously, it was a per-thread hashrate. But yes, thread count is increasing every year, so it is totally inacceptable to use such an output as a heartbeat in case of Threadripper 3990X or similar systems... Too much new lines.
Seems to be a good solution.
Definitely we should not base on one coin. But the current tendency is to reduce block times (1-3 minutes or less). The goal is to have fast transactions while maintaining reasonable count of block confirmations. So about 5 minutes... this is too much, and may become an edge case sometime soon. I recommend to take 2 minutes as a reference point. |
I think the issue is the scan time. Your seeing the heartbeat every 5 seconds the scantime There are currently no checks of the new work to see if it's actually different. I can add a check It's becoming clear another test release will be required to test the next batch of fixes. I have a fix for invalid block height. It should fix the false positive stale block pre-test. I'm stuck with the TTF problem, the code is identical to how it's done for stratum. This could Unstuck. I found a difference with the stratum share TTF. It uses targetdiff whis is the stratum diff Edit: Usng the target factor didn' work for stratum net TTF, it was ridiculously low. That's 3 new fixes so far and I haven't looked at your attachments yet. |
I see the end for this issue. It's main focus was on share stat specific to getwork which There are 3 remaining issues:
A new release will be available in a few hours. It will llikley the last test release to deal with |
FYI. I think I just saw the idle problem with ccminer and powershell. I've only recently started using |
v3.12.4.6 is released with a couple of fixes and a coupe of new debug logs. Please test with -D. The 3 areas of focus:
1b. Also with the new block log is the TTF problem. This may be due to conflicting data
Edit: Ignore the following, the results will be invalid due ot a bug in calculating share difficulty. 3, Share result. There seems to be some confusion about the target to solve a block. This Looking forward to your test report, we're getting close to the end. |
Here's another test suggestion for the new block, new work logs. The default scan time is 5 seconds. In your last test new block messages were displayed |
I've made a lot of progress with sharediff & targetdiff and I think I have it all working for the I've also given up with the stale block test. It's redundant with the stale work test. Everything should work now. Well almost everything. I'm still not 100% confident with the With getwork the network hashrate and network difficulty are both provided via RPC mininginfo. For Stratum only the network difficulty is provided. The network hash rate is calculated from the I have been able to verify share diff is correct and share targetting is precise so all share |
cpuminer-opt-3.12.5 is released. This one should do it, everything should work correctly. Please report any problems. In addition to testing for any previously identified problems I have one specific request: You can even double check the math is correct for hashrate and TTF estimates if you want. There may be a final tweak but if stats are working properly for getwork this issue can finaly |
I'm on it. Net TTF and miner TTF seems to be OK now. Will use v3.12.5 with -D and output to a file. UPD:. here it is: Well, I do not see any issues (except no "BLOCK SOLVED" or stale info, and a small race in affinity logging in the very beginning). The lack of proper nethash rounding (should be is not an issue, as it is used only with -D I guess. This [2020-03-02 10:14:27]�[01;37m 8 Submit diff 5.9678, block 6281908�[0m block was not rewarded, I don't know why. Anyway, that should not be a cpuminer-opt issue. |
The last summary log reported 10 accepted, how many were rewarded? The -D did its job and confirmed mininginfo was correct. The first thing I noticed is the net diff and targetdiff are different. That explains why "Accepted" |
I found the problem with zero block number in share_result log. The bigger question, I'm not sure if it's a problem or a misunderstanding, is the different values Net_diff is provided via RPC mininginfo and is supposed to be the minimum diff to solve a block Target diff is calculated from the 256 bit hash target in the work struct and represents the When pool mining they are expected to be different but solo mining there is no share so the target That's the theory. The data show otherwise. "Shares" were submitted that passed the target test, were accepted and resulted in a block Your session was 136 minutes and you submitted 15 blocks, for a TTF of around 9 mins. The miner TTF is based on the target diff and estimated around 4m45s. This is consistent I can find no inconsistencies in the data, everything indicates target diff is used by the server. If target diff is what is required to solve a block it should be the same value as net diff, Why are they different? If target diff is the diff to find a block what is net diff? I can make it work without answers to those questions by just ignoring net diff and using I can do some more math, verifying net hash rate and TTF looking for discrepencies. I'm curious about the rejects, none were reported as stale. But the reject at 9:51:00 was I don't see a performmance issue that would suggest an invisible problem. The effective hash rate, If you have any insights or find anything else worth reporting, please do so. Tha's 3 items so far:
|
Something is not right. The block explorer for Anime says it's at block 4,539,011 but your logs |
I tracked the block numbers reported in the logs and everything looks ok. New blocks What is weird is the polling rate. Getwork requests occur every 7 seconds, same as previous Can you reduce the scantime to 4 seconds (--scantime 4) to see if that changes the timing of the |
A summary of the rejects. 9:46:26 new block 845, targetdiff .2631 Both the block and diff were good so it wasn't stale or low diff. 9:50:38 new block 853 This was clearly a stale share, a new block was received between submitting the nonce and 10:49:40 new block 961, target .28873 Not stale, not low diff 10:59:56 new block 971, diff .28873 This was not stale but could be low diff. The share diff is very close to the target, it could be a math 11:2:06 new block 19 Not stale not low diff. In general it's looking pretty good. The new blocks and new work are reported corectly and the But there are some items to follow up:
I may be able to find a workaround to determine if the share was
We can't explain them if we don't know the reason. Unfortunately It would be a waste of time to retest the hash using the same test procedure so it has to be
I've expressed my concerns with the accuracy of the hash test. The test previously had a margin I use the same logic as with stale shares. Don't pre-judge your work, submit it and let the server Ideally the test should be precise and accurate, but that might not be possible. i can take I might be able to create a mechanism like I did fo stales where I set a flag that the share For share diff I could set an error tolerance. If the share is within the margin of error I set This will require some tuning and a better understanding of the exact error as well as coordination The 2 other items are awaiting more info to explain the block height confusion and to |
Follow up to the accuracy of the hash test. The test itself is 100% accurate with 100% precision because it does a 256 bit This make it unlikely that reject 4 was low difficulty A precise test wilh unconverted data More testing is required to see if there are any other rejects with share diff close to target diff. I'm abandoning trying to detect marginal shares, it might be trying to ber too clever. |
@JayDDee There're 2 block explorers I've mentioned above (https://animeco.in/explorer and https://miningbase.tk/explorer/ANI). This is to check the block height to compare with my logs. I don't know where the one you shared was taken from (it seems to be outdated). I'm going to provide a new (longer period) session with maxing-out the debug info. This will require to make a ZIP archive btw.
Will add to CLI.
Got rewards for 9 out of 10. When I'll have the logging done, I'll share the reward log as well (so it may be compared to log via timiline). Thanks. |
Debug is only need for a short test time to measure the poll time with different --scantime. I prefer you do the long test without debug, it just make more logs to search through |
So, you have no interest in --protocol-dump to see the received & send info itself? I'll skip this parameter then. |
Got three blocks in a row (almost), all got rewarded. So, I'll post it anyway. |
Correct, I didn't mention protocol dump earlier because I thought you found it useful. I looked at the explorer and the data looks good. The block height, net diff, net hash rate, You can verify the TTF etc live. Edit: The block explorer confirmed the net diff but it isn't used to set the target. I still don't |
Some info may be found here: https://github.com/Animecointeam/Animecoin/blob/master/src/rpc/mining.cpp Block creation method, consensus settings and chain params are split between several header files. I can also find several reject reasons over there: Checks and POW part itself: |
Big log: |
First impression of the logs: Effective share rate is too low. It quickly converges to arond 1800kh/s but the ref rate is 3780 kh/s. I've never noticed a hashrate problem with stratum mining so it may be a getwork issue. The reject rate isn't alarmingly high, once the stales are factored out it should be even lower. I have fixes ready for block 0 in the share result log and better detection of stale shares |
I checked the effective hash rate calculation. it's the same code as stratum uses and it reports Ignore the following, there is a real problem of low difficuty shares. The low effective hash
One possibility is the target is too low and shares that would be accepted may be discarded. If you add -m 0.9 it will reduce the target diff by 10%. If you mine with this setting you may submit If the target diff is reduced by 10% you should expect 10% rejects for low diff. The effective hash If there are no rejects, or less that 10%, it means the lower diff shares are being accepted. This kind of test can be run for a long time, or for as long as it takes to draw a conclusion. Don't go higher than -m 1.0, you start to lose performance. If you do it please report your results.
Edit: I have reason to suspect the target diff is actually too low which account for some R1: diff .35401, target .31496 A32: diff .42385, target .28476 A32 is the lowest diff share accepted, R1, R3 are the 2 shares with the lowest diff and both were R5 has a higher diff than the lowest accepted, but also has a higher target. This is all evidence of incorrect targetting but targetting too low causing low diff rejects. The ratio is impoprtant because the target changes. From the samples available. 1.31 is rejected, |
I tested target_to_diff and diff_to target and the results were interesting. diff_to_target is accurate to 50 bits or around 15 decimal digits. target_to_diff is accurate to 4 decimal digits. The lower precision of target_to_diff affects mostly stats not actual mining. The target as received getwork gets the target directly from the server, no conversion is necessary. With conversin not a factor in getwork mining it's still a mystery how you are experiencing I need to analyze the logs in more detail to see if there's a pattern. |
cpuminer-opt-3.12.6 is released. /it contains 2 fixes for this issue:
There are a few other enhancements to th elogs not directly related to this issue but may help Two outstanding problems are not resolved:
I intend to close this issue if the are fixes are confirmed and there are no regressions. |
Here's a test I did on stratum to verify the target. Do a control and wait for a block to be submitted, Accepted or not the hash and target will be displayed. It reads like a 256 bit hex integer that is truncated. A valid share is one where the hash Take note of the target value, it is the target set by the server andthis is the value to be verified. If it's off my a significant amount it will cause low diff rejects (target too high) or performance loss |
Please let me know if you plan on doing any more testing, I'll wait for your results. Otherwise I'll close the issue because I have no plans to pursue this any longer without new data. |
This is yet another follow up to #244 & #245 to support share statistics for solo mining.
For the most part the share statistics feature works for solo mining with the limitation that "share"
related data has no meaning when solo mining. A share essentially represents a solved
block so all "share" related statistics will actually be block statistics.
Some of this info may be redundant with explicit block level stats or the share stats may be
all zero.
Though acceptble this is not ideal. An attempt will be made to suppress irrelevant info in
the logs.
The only significant work item is to implement a new block log for solo mining. The existing
block log is generated in stratum code that is not used when solo mininig.
The new block log for solo mining will have a different format that it's stratum cousin and
will display different info. There is no stratum diff and no need for share estimates.
This will resuilt in a shorter log than the stratum version.
A proposed format:
[algo]: [URL] block [work->height], diff [net_diff]
TTF @ [refhashrate] [time], net hashrate [net_hash]
All fields have the same meaning as the block related fields of the stratum new block log
and will be displayed in the same format
This log will be output for both getwork and GBT excluding longpoll. Longpoll will be implemented
when it can be tested.
The text was updated successfully, but these errors were encountered: