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
Not getting blocks solo mining #245
Comments
Polling interval is a user-defined setting in other solo miners. Examples:
Or it just may be fast enough (see line 1182 in cpu-miner.c in that diff): hyc/ccminer-cryptonight@85c8ab4 I think that polling every second may leed to hashrate degradation, especially on a very slow CPUs. So a good decision is somewhere near 2-3sec default with ability to set up from cli. Block target times may be very small on "fast chains" (30sec or even 10sec - I've seen). If the coin difficulty algo is not smart enough, periodic instamines do occur (e.g. +50% of nethash just has joined, so the future blocks inside diff window would be found very fast), so polling once in a minute is veery slow. |
Will check some coins with a working solo mode. This may be a http server part thing (coin side). |
Once I realized longpoll wasn't being used the issue became clearer. There are two mechanisms to signal the miner threads of new work, a set time limit or the The time limit is currently calculated to 1 minute based on the reference hash rate. But neither stratum nor longpoll are running to set the flag. get_work is called inline by the The defined scan time is determnined by the --scantime option with a default of 5 seconds. A code change will be required to use the scantime option as the miner thread's hash timeout |
I have a fix preparing for release. When not using stratum or longpoll the miner thread scan time limit will be based on the scantime The default for the scantime option is 5 seconds and may be changed by the user. it is |
v3.12.4.1 is released. In addition to the scantime fix I also added a couple of debug logs to figure out why longpoll You don't have to end your current tests prematurely unless you don't exepect any more useful This should peel off another layer of the onion but I suspect the lack of reply to a submitted |
I've been investigating the missing replies to submitted blocks. They aren't actually replies The RPC function call to submit the block actually returns the result which is immediately But nothing. It's as if share_result was never called. Maybe there's something weird happening lower down but it still doesn't make |
Another curiosity is the missing mining info log. Mining info can be requested from the wallet via It's only disabled in one place in the code and doing so would produce an error log, but once It's important to note whether the working version displays mining info or not. Correction: get_mininginfo only produces a log if the block height was not previously set. |
I got new logs. There're 2 text files inside, named by the version of cpuminer-opt. 3.12.4 clearly indicates all blocks were stale blocks. |
I will get some logs for 3.12.4.1, to make sure there is no crash and found blocks are not stale ones. |
The logs from 3.12.4 are very encouraging. It's good to confirm the miner discarded the hash My preference would be to submit it anyway and let the wallet reject it. After doing all that work It's also encouraging that they were stale and directly related to this issue, ie not yet another issue. Looking forward to 3.12.4.1 results. In v3.12.4.1 you should notice immediately more frequent hash-meter logs, every 5 seconds |
Regarding longpoll, it looks like the longpoll thread is being created for gbt, but then not used If that works I will likely not try to "fix" it. It seems too risky to try to anticipate a switch to |
Sometimes a new block is received after the "submitted" log but before the "stale work detected" The test itself is pretty straightforward testing work vs g_work. It shouldn't be too hard to |
I think I found the bug where the miner thread fails to copy the global g_work to it's local work. A very simple code change will confirm it. cpu-miner.c:std_get_new_work if ( have stratum ) ... |
Simple lock for console output may help, but ofc using this lock only here is a bad idea.
That helped!
CPU: AMD Ryzen 9 3900X 12-Core Processor . Starting miner with AVX2 AES... [2020-02-23 08:36:47] Extranonce subscribe: YES Now we have an indication on every block received, and report that block was accepted (I've checked, it was). |
Great news. The only thing left is to tweak the patch for a proper fix. Then I can deal with Thanks for all your hard work. It's the first thorough test of solo mining. |
cpuminer-opt-3.12.4.2 released with a fix for stale shares. Please retest and report any problems. |
Latest release has a stable crash (any build) in several seconds:
CPU: AMD Ryzen 9 3900X 12-Core Processor . Starting miner with SSE2... [2020-02-24 09:46:09] 24 CPU cores available, 12 miner threads selected.
[2020-02-24 09:46:09] Binding thread 2 to mask 0000000000555555
C:\cpuminer-opt-3.12.4.2-windows>pause |
Debug info:
|
Oh crap, that's the format string for the new block log for getwork. I messed it up pretty good, cpu-miner.c:1491 applog( LOG_BLUE, "%s %s block %d, diff %.5g", work->height, net_diff ); should be applog( LOG_BLUE, "%s %s block %d, diff %.5g", algo_names[opt_algo], short_url, work->height, net_diff ); |
cpuminer-opt-3.12.4.3 is released fixing the segfault. |
[2020-02-25 11:12:34] 2 submitted by thread 3, lane 2 It seems to be OK for now, no crash, this one may be closed. I'll add a separate issue for idling. |
I'm not ready to close it yet I want to verify the coreectness of the logs. I see some problems already, The new getwork block is a new log, I'd like to see it in action. The first block was rejected |
I've told about block number 0 here - #246 (comment)
That seems to be normal. I see no response @ server side for this (reject reason, like pools do). |
I see nothing about rejecting the first block in #246. You'll have to tell me again. |
Stale block. Debug (--debug) was disabled. |
You're right it is a normal stale but not reported as stale. It might be a getwork issue, the test for |
Blocks are now being accepted using getwork so this isue can be closed. |
This is a follow up to #244.
There are sugnificant gaps in the block heigh of new blocks solo mining anime suggesting the
miner is not getting all blocks. The block emmission rate is quite high, around 6 per minute
which coincides with the height gaps and a presumed 1 minute poll.
This issue is opened to investigate:
height?
It was also noted that blocks appeared to be submitted but no reply was ever received. It may
be related or a seperate issue.
The text was updated successfully, but these errors were encountered: