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
[GBT] Failure to restore connection right after getwork fallback attempt #398
Comments
Does anyone use getwork anymore? Maybe I should make no_getwork the default. I presume this occurs after a successful GBT connection was established and later failed. I don't think this was considered in the initial GBT implementation. The fallback to getwork was intented for GBT failing at startup, assuming GBT wasn't supported. It might be possible to distinguish startup failure from a network failure but that could be more complicated and require more testing than simply disabling automatic fallback. I'll look into it before deciding. |
I think almost noone. Old (still popular) Bitcoin Core wallet versions use it, but this is not about CPU mining. |
IIRC bitcoin core dropped support for getwork a coule of years ago, I doubt the old wallets still work. Getwork would only likely be used on old coins forked from Bitcoin that haven't been updated for GBT. I think the solution might be as simple as automatically activating no-getwork after having successfully connected using GBT. It should be a simple change. |
It's not that simple, 2 flags are involved. What happens when you set --no-getwork? Does it error out or retry? |
Excellent, only requires a one line change. |
Mybe you could look into max-diff option code then, meanin disable useless CLI output spam (higlighted section): Yep new block info is useful, but fake hashrate lines are a complete spam. If the diff is high for a prolonged period, then it's a mess. Btw, atempt to mine BTC (hahaha) using sha256d and latest Bitcoin Core wallet with GBT produces a cpuminer-opt crash, but this task (attempt to fix) is useless. I just used it to test connection. |
That line shouldn't be printed without a blue log header, that's a bug.
I suspect it's due to a missing BIP, something I've been afraid of. It's almost impossible for cpuminer to keep up with Bitcoin improvements and many of them will be picked up by other coins so this problem could spread like a virus. |
I understand the logging bug. The log header wasn't printed because the work data didn't change, the work wasn't new. Update: I have a fix that avoids adding a strcmp. The logs will still be displayed while paused but only when new work is received. |
Pooler's version seems to work: Crash here: |
It looks like a crash printing a log, displayed the timestamp but not the content. There are also differences in the HTTP parameters but I don't know what they mean or why. Edit: I need more logs, there are no cpuminer logs in your snapshot to provide a point of reference to find where it crashed. |
cpuminer-opt-3.23.0 is released with the title issue and log spam issue fixed as noted above. |
I now see a total lack of fast hashrate reporting: So, a single output per block. I'm not sure if that was expected (@ your side). However, it is enough to see this info once in a block, for fast (5sec) output and speed testing better to use benchmark mode. Reconnect issue is fixed. |
Actually it should be a log for any new work but shouldn't go over two minutes. Slow algos have fewer intermediate jobs so it's mostly block time. |
...
[2023-08-28 10:28:19] JSON decode failed(1): '[' or '{' expected near '<'
[2023-08-28 10:28:19] getblocktemplate failed, falling back to getwork
[2023-08-28 10:28:49] HTTP request failed: Connection timed out after 30000 milliseconds
[2023-08-28 10:28:49] json_rpc_call failed, retry after 10 seconds
[2023-08-28 10:28:49] HTTP request failed: Connection timed out after 30000 milliseconds
[2023-08-28 10:28:49] json_rpc_call failed, retry after 10 seconds
...
Workaround: --no-getwork
I may leave this upon your decision, but this is not expected to restore connection with different parameters, and then use 'em permanently. Thanks.
The text was updated successfully, but these errors were encountered: