wellenreiter01/p2pool-neoscrypt

High stale rate with master

Closed this issue · 8 comments

Trying to use latest master gives me an almost 100% stale rate and lots of these messages:

Switchover imminent. Upgraded: 100.000% Threshold: 95.000%
> Unhandled Error
> Traceback (most recent call last):
>   File "/home/user/p2pool-neoscrypt/run_p2pool.py", line 5, in <module>
>     main.run()
>   File "/home/user/p2pool-neoscrypt/p2pool/main.py", line 672, in run
>     reactor.run()
>   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1192, in run
>     self.mainLoop()
>   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1201, in mainLoop
>     self.runUntilCurrent()
> --- <exception caught here> ---
>   File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 824, in runUntilCurrent
>     call.func(*call.args, **call.kw)
>   File "/home/user/p2pool-neoscrypt/p2pool/bitcoin/stratum.py", line 44, in _send_work
>     self.other.svc_mining.rpc_set_difficulty(bitcoin_data.target_to_difficulty(x['share_target'])*self.wb.net.DUMB_SCRYPT_DIFF).addErrback(lambda err: None)
>   File "/home/user/p2pool-neoscrypt/p2pool/bitcoin/data.py", line 227, in target_to_difficulty
>     assert 0 <= target and isinstance(target, (int, long)), target
> exceptions.AssertionError: 6.26990234362e+69

Setting "-d A" seems to prevent the messages and the stale rate is near zero again. Seems that there is a bug with "-d D".

Yes, I noticed that, too.

-d A should become the default as it is more effective for the miners anyway

Part of me is conflicted by your statement. I agree that adaptive should be the default because it is better. However, if a feature in provided, it should work or be removed. However, the install base of this code is small enough that it probably doesn't matter.... ehh... Works for me, and I know how to solve it now, so it is up to you.

Thanks.

I think I found the cause of the problem, but I need to check.
As part of a merge from p2pool/p2pool stratum.py was changed.
Due to FTC using Neoscrypt, there are a couple of changes to be done in stratum.py.
The little problem is to stay compatible with other coins.
The error should not occur, if miners connect using longpoll and start the url with "http://" instead of "stratum+tcp://"

accidentally closed

I see that you found that -A wasn't really working. I submitted #9 which fixes the assert on my end. The only problem is the reporting is terrible.

You also didn't clean up a merge conflict, so I'm not sure how it is even working as it won't compile. That is fixed in the pull request too.