pooler / cpuminer

CPU miner for Litecoin and Bitcoin
https://bitcointalk.org/index.php?topic=55038.0
Other
2.77k stars 1.21k forks source link

Frequent "stratum_send_line failed" #58

Closed bo-liu closed 10 years ago

bo-liu commented 10 years ago

Hi,

I'm getting disconnects frequently like this: [2014-02-01 19:41:09] submit_upstream_work stratum_send_line failed [2014-02-01 19:41:09] ...retry after 30 seconds

I'm using the latest cpuminer and connected to a p2pool setup by myself.

pooler commented 10 years ago

Could you please post the full output of minerd with the -D and -P switches, from the start of the program till the issue arises, as well as the output of p2pool? (Please use a pastebin.)

bo-liu commented 10 years ago

Thank you for your quick response. p2pool.log: http://pastebin.com/raw.php?i=FEUMqgkE cpuminer log: http://pastebin.com/raw.php?i=X5iPpaE1

pooler commented 10 years ago

What happens is that p2pool is setting a very low share difficulty, which causes way too many solutions to be found and submitted, effectively flooding the connection. This does not happen if you mine bitcoins or litecoins, and I see that you are running a fork of p2pool for Testcoin, but I can replicate the issue if I try to mine with p2pool on the Litecoin testnet. This appears to be an issue with the per-chain settings in p2pool, so you probably want to fix that in your fork (see the target settings in the two networks.py files).

bo-liu commented 10 years ago

Thanks a lot!

But I still got this error after changed the setting in p2pool/networks.py from MIN_TARGET=0 MAX_TARGET=2256//220 - 1 to MIN_TARGET=2256//50 - 1, MAX_TARGET=2256//2**20 - 1

The p2pool/bitcoin/networks.py setting is: SANE_TARGET_RANGE=(2256//1000000000 - 1, 2256//1000 - 1)

The p2pool print still say: New work for worker! Difficulty: 0.000000 Share difficulty: 0.000244 Total block value: 100000.000000 TEC including 0 transactions

From my wallet getinfo, the "difficulty" is 0.00024414. Where did I wrong? ps, The testcoin is just a copy of litecoin following some public guide.

pooler commented 10 years ago

The sane target range still looks pretty high to me... could you please try reducing 2**256//1000 - 1 to something like 2**256//50000 - 1?

bo-liu commented 10 years ago

Thank you so much, I can't see this issue any more!

By the way, could you explain to me a bit more about the meaning of SANE_TARGET_RANGE, MIN_TARGET/ MAX_TARGET? And what's their relationship with the difficulty of block chain(showed in wallet directly)? I didn't find any useful document.

pooler commented 10 years ago

Honestly I'm not sure how exactly MIN_TARGET, MAX_TARGET and SANE_TARGET_RANGE are used by p2pool. For an explanation of target and difficulty you should check the Bitcoin wiki. Basically, if the target is 2**256//50000 - 1, about 1 hash every 50000 will be a solution.

bo-liu commented 10 years ago

Thank you all!