Skip to content
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

LTC scrypt difficulty factor 65536 ( for nicehash ) #241

Closed
ghost opened this issue Jan 8, 2015 · 4 comments
Closed

LTC scrypt difficulty factor 65536 ( for nicehash ) #241

ghost opened this issue Jan 8, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Jan 8, 2015

Hi Forrest,
thank you for your great software! i have a problem:
I am renting big hashrates at cloud hashrate providers like nicehash.com

p2pool + btc is no problem.. the username

1GABCZjGVVMBca3puzUCs7occhV2YsY/999999999999+999999999999 

sets a difficulty of "999984.7412" for my worker .. so statistically we will need about 114 shares of the worker to get one p2pool-share of 11463938.22 .. so very big hashrates are possbible..

but when i use run_p2pool.py --net litecoin , the username

LiZBSYYaXcnBF1tdWzSYAqD2H1iAzAGzMq/9999999999+9999999999

leads to a difficulty of 0.2328 .. so we will need 12 shares to reach the p2pool-share-diff of 2.73 .. but at scrypt, all difficulties have to be multiplicated by 65336 .. normal pools will tell the worker a difficulty of 14749 ... i know that this does not matter statistically.. the client now simply creates 65536 *12 = 786432 shares to reach the p2pool-shre-diff of 2.73 *65536 = 178913. but this creates very much packages / traffic.. and probably 65535 of every 65536 packages have a hash > target error, just because the miner and p2pool have different opinions what the diff should be.. i can see that in my logs...

2015-01-08 21:33:52.462176 Worker LUfGskrLkhmmqgsT2AGiN23uD7cjc4uWJk submitted share with hash > target:
2015-01-08 21:33:52.462376     Hash:   352546cd0aaf22c968fab60f051e533805ece20cbf60da0e19b6562638
2015-01-08 21:33:52.462532     Target: 44b82fa09b5a52cb98b405447c4a98187eebb22f008d5d64f9c394ae8
2015-01-08 21:33:52.473330 Worker LUfGskrLkhmmqgsT2AGiN23uD7cjc4uWJk submitted share with hash > target:
2015-01-08 21:33:52.473443     Hash:   e134ce877affe0614c67f044eeba43ca1d8feb92a13c2e8a7f2c444fd4
2015-01-08 21:33:52.473548     Target: 44b82fa09b5a52cb98b405447c4a98187eebb22f008d5d64f9c394ae8
2015-01-08 21:33:52.520353 Worker LUfGskrLkhmmqgsT2AGiN23uD7cjc4uWJk submitted share with hash > target:
2015-01-08 21:33:52.520433     Hash:   b609cac916d6e16cad2f2d00b4922d85f64f0d695899647a3e16a5a251
2015-01-08 21:33:52.520485     Target: 44b82fa09b5a52cb98b405447c4a98187eebb22f008d5d64f9c394ae8

i once wrote a proxy which modified the stratum messages.. when i multiply the number here:

{"id":null,"method":"mining.set_difficulty","params":[0.2328]}

to

{"id":null,"method":"mining.set_difficulty","params":[14749]}

everything will be fine and p2pool and the miner are in sync

i also found in the config file p2pool/p2pool/bitcoin/networks/litecoin.py

DUMB_SCRYPT_DIFF = 2**16

but this obviously will not work..

am i missing something? p2pool is mining ltc for a long time now.. i wonder that nobody had this issue before..

here my config;

python run_p2pool.py --version
13.4-57-gdfad3cd
python -V
Python 2.7.6
uname -a
Linux f634 3.13.0-43-generic #72-Ubuntu SMP Mon Dec 8 19:35:06 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
@ghost
Copy link
Author

ghost commented Jan 8, 2015

oh i think you changed it once because of this.. #202
so here is the answer to myself:
we can fix it with changing p2pool/bitcoin/stratum.py line 44 from actual

self.other.svc_mining.rpc_set_difficulty(bitcoin_data.target_to_difficulty(x['share_target'])).addErrback(lambda err: None

to

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)

yep.. the hash > target errors are gone now!

@CohibAA
Copy link
Contributor

CohibAA commented Mar 27, 2015

@buechling - thank you for posting this! This fixes the messages.

CohibAA added a commit to CohibAA/p2pool-doge1-8 that referenced this issue Mar 27, 2015
CohibAA added a commit to CohibAA/p2pool-doge1-8 that referenced this issue Mar 27, 2015
@dtlgc
Copy link

dtlgc commented Dec 21, 2017

Would be nice if this was pushed into the main git - just fixed my problem in 2017?

thanks

@farsider350
Copy link
Collaborator

farsider350 commented Sep 20, 2018

I have made a Pull Request for this and am closing the issue. Thanks for the contributions.
#413

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants