johnMinelli / SQLMiner

Miner for Bitcoin implemented in SQL
9 stars 9 forks source link

Share not accepted #2

Closed Newinvestcoin closed 2 years ago

Newinvestcoin commented 4 years ago

i have pool btc, set low diff on port, run you miner, and have this {"error": [23, "low difficulty share of 2.984882439119098e-10"], "id": 3, "result": null} all share low diff

johnMinelli commented 4 years ago

It depends on what method you use to set the difficulty. Normally it's on the pool to choose dinamically the difficluty. Oversimplifyng it, normally in the packet to the miner arrive the value of the difficulty to use, and the miner use it in the cycle of tryng each possibility to accept or reject. Assuming the dynamic difficluty, if you got that error i think that: or the value that come to you is not formatted rightly/the miner doesn't get it rightly so maybe you need to make some tweaks in the code or it's a fact of timing:

Newinvestcoin commented 4 years ago

static diff pool. its log from pool. i try search error info] [bitcoin] [Pool [:1]] : Share rejected: {"job":"13e","ip":"::ffff:192.168.1.180","worker":"1K54xmSfJ4m7hpmo3F7sVjEPT3XQJpLnYC","difficulty":1024,"error":"low difficulty share of 7.453153690186982e-10"} log miner -----------found 0 : 1d93b418 for 000000208ba65dd66e2abae1fb1aa1bb33937ae0a5033f1e954511000000000000000000416ee11b93e2ccf9b1fecaa65e45f013db25f4a14bcc3776eae8e75903b139d308bb655ebc2c1217 [2020-03-09 08:42:54] [INFO] Found share: ['1K54xmSfJ4m7hpmo3F7sVjEPT3XQJpLnYC', u'13e', '05000000', '5e65bb08', u'1d93b418'] ...build new chunk... [2020-03-09 08:42:54] [INFO] Share - Invalid [2020-03-09 08:42:54] [ERROR] Mining Sate Error: Failed to accept submit {"params": ["1K54xmSfJ4m7hpmo3F7sVjEPT3XQJpLnYC", "13e", "05000000", "5e65bb08", "1d93b418"], "method": "mining.submit", "id": 57} {"error": [23, "low difficulty share of 7.453153690186982e-10"], "id": 57, "result": null} ...build new chunk...

Newinvestcoin commented 4 years ago

what pool you use? you have valid share? another pool [2020-03-09 10:38:20.2142] [I] [bitcoin1] [0HLU3TFR4QUAI] Share rejected: low difficulty share (1.68910532549234E-08) [2020-03-09 10:38:20.2185] [I] [bitcoin1] [0HLU3TFR4QUAI] Share rejected: low difficulty share (7.1436905493839E-10) [2020-03-09 10:38:23.0694] [I] [bitcoin1] [0HLU3TFR4QUAI] Share rejected: low difficulty share (3.40424861995446E-10) [2020-03-09 10:38:23.0735] [I] [bitcoin1] [0HLU3TFR4QUAI] Share rejected: low difficulty share (8.0662872994325E-10) [2020-03-09 10:38:41.2502] [I] [bitcoin1] [0HLU3TFR4QUAI] Share rejected: low difficulty share (4.10122753233514E-10)

Newinvestcoin commented 4 years ago

i see one strande.. if i run just -a sha256d share accepted if run -a sha256dsql share rejected need your help

johnMinelli commented 4 years ago

what pool you use?

I tested on f2pool but the diff is dinamically choosen by the pool so i never got a valid share. Instead using kano pool you can set the difficulty so i got some share accepted lowering it but the results aren't worth it. Of cource you have almost zero expanse let it running on a RPi but the results mining this way is a fight against probability. It's a good way to learn how a miner works and interact with a pool anyway.

i see one strande.. if i run just -a sha256d share accepted if run -a sha256dsql share rejected need your help

That's very strange... the flag choose between the function to use and the sha256d is basically in the code just for completeness but it's a simple double hashing bruteforce over CPU and it's almost impossible that you can get a valid value to submit in time

Newinvestcoin commented 4 years ago

you can try use -a sha256d and see))) share accept. i try 3 diffrent pools and 2 say “low diff” and 1 say “Above target”

Newinvestcoin commented 4 years ago

i can run pool, open port for you. set diff on 5 and you can connect and test

Newinvestcoin commented 4 years ago

can yo do this scrypt on rpc? no stratum) if we can connect to btc wallet maybe it well be better?

johnMinelli commented 4 years ago

My initial idea was to do my own job of mining with the chain and wallet in local but the difficulty is too high to mine a block solo. With stratum you can partecipate in the process of mining, submitting lower difficulty share and ipotetically get a smaller revenue. 

Newinvestcoin commented 4 years ago

My initial idea was to do my own job of mining with the chain and wallet in local but the difficulty is too high to mine a block solo. With stratum you can partecipate in the process of mining, submitting lower difficulty share and ipotetically get a smaller revenue.

where i can find you rpc miner sql? i want try)

johnMinelli commented 4 years ago

You can reuse the functions of mining and to get the blocks but you need to do the one specific for the block format given by rpc. In the wiki of BTC you can find the specs to do so.

Newinvestcoin commented 4 years ago

------------found 0 : afa77749 for 000000202166d6cbd77d72a8cd1842b3696e76031391a11bbdf2050000000000000000007bcf5614765aabd8753d059b307909fb97700ff1bcf159ca8096d99eb1a793db3689685e19011117 [2020-03-11 11:46:45] [INFO] Found share: ['1K54xmSfJ4m7hpmo3F7sVjEPT3XQJpLnYC', u'5e0294cc00036b95', '04000000', '5e688936', u'afa77749'] ...build new chunk... [2020-03-11 11:46:45] [INFO] Share - Invalid [2020-03-11 11:46:45] [ERROR] Mining Sate Error: Failed to accept submit {"params": ["1K54xmSfJ4m7hpmo3F7sVjEPT3XQJpLnYC", "5e0294cc00036b95", "04000000", "5e688936", "afa77749"], "method": "mining.submit", "id": 4} {"id": 4, "error": null, "result": false, "reject-reason": "Above target"}

it is kano pool say.