-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Unified nicehash+eth-proxy #417
base: develop
Are you sure you want to change the base?
Conversation
Your work is great 👍 |
@sammy007 // hello~ if you have any interest or some free time to review this code, please let me know or I will make a temporal repo to support both nicehash(EthereumStratum/1.0.0) and EthereumStratum/2.0.0 for gangnam testnet. (I'm already prepared for the next PR to support EthereumStratum/2.0.0) |
Hello @hackmod |
@aemet93 // sorry for late answer. |
type JSONRpcResp struct { delete omitempty in Error type JSONRpcResp struct { works |
Could you squash? Using |
Author: Wolfgang Frisch <[email protected]> Date: Mon Sep 25 19:24:09 2017 +0200 NiceHash support: working prototype unified nicehash + ethproxy and cleanup by hackmod * rebased and squashed * unified processShare*() * unified nicehash + ethproxy * height field added to support extended getWork() * support mining.extranonce.subscribe for nicehash * fixed crash and cleanup * remove DifficultyNiceHash using DiffFloatToInit() * remove all nicehash specific options * BUG: do not modify shareDiff to show hashrate correctly * check len(params) * Do not terminate connection if miner submits one duplicate share (by nicehashdev, manually applied by hackmod) * fixed stale job bug using cached stale jobs. * BUG: old behavior always drop stale jobs * sendJob() again after stale share found. * cache stale jobs info. * use cached headHash/seedHash from stales cache * reuse Compute() result instead of calling Verfiy() again * confirm uniq Extranonce * set ExtranonceSub session flag to support non extranonce.subscribe capable miners for NiceHash * check the length of params * always calc actual difficulty * debug config option added to toggle some logs * disable some log conditionally Co-authored-by: Wolfgang Frisch <[email protected]>
e3a3fb3
to
62392c6
Compare
FYI, you should be able to squash on merge. Just hit the dropdown arrow on the merge button |
I just wanna look into it and it's easier to read it all at once. |
Hi there! I've tried to run it with nicehash and the first thing i've encountered was nonce size mismatch:
it indeed does not match the regex (it's len is 12 instead of 16). If I skip that check, I get the following error:
And that's probably related to nonce length. Maybe I should add leading 0x0 to the nonce value? |
Hi! extranonce ( (extranonce) (nonce = extranonce + I guess the extranonce was missing or not properly prepended at pool side.
|
Hi, thanks for the reply!
I've dumped the beginning of the communication, could you please give me a hint if something looks wrong here...
Backend skipped the wrong nonce length (len 12) and failed with the incorrect difficulty error in this case
|
yes right. the extranonce seems correctly responsed by pool server.
this PR already handle it. (I guess you are trying to make your own fix or pool server) |
Thanks, @hackmod. As I see from the code
the extranonce is not concatenated because cs.ExtranonceSub is false.
Do I miss something else?
Thanks |
how about to apply the following fix? diff --git a/proxy/stratum.go b/proxy/stratum.go
index fda127c..10fb42a 100644
--- a/proxy/stratum.go
+++ b/proxy/stratum.go
@@ -165,6 +165,7 @@ func (cs *Session) handleTCPMessage(s *ProxyServer, req *StratumReq) error {
return cs.sendStratumError(req.Id, "unsupported stratum version")
}
+ cs.ExtranonceSub = true
cs.setStratumMode("EthereumStratum/1.0.0")
log.Println("Nicehash subscribe", cs.ip)
result := cs.getNotificationResponse(s)
Please see EthersocialNetwork@e2f191a |
Thank you. I got the point. |
any update on this? |
Hello all again. |
We have seen this delta before with another implementation of NH protocol. |
If anyone interested, continue debugging this stuff, I assume that not all shares comes to pool. I have logged all shares, and for 100% share pool respond to NH as true. Speed calculation is obviously based on shares amount, so looks like NH send more shares than we see on pool. Now most interesting question is where is this lost shares?.. I will give a report here, if will find something interesting. |
this is the original unified nicehash-v1 branch https://github.com/EthersocialNetwork/open-ethereum-pool/tree/unified-nicehash-v1-original I guess, lost shares may be caused by the following code. (original NH fix always drop these shares) |
Nicehash(EthereumStratum/1.0.0) support based on Wolfgang Frisch's working prototype.
unified nicehash + ethproxy and cleanup by @hackmod
processShare*()
height field added to support extendedgetWork()
DiffFloatToInit()
Note
it use modified version of the ethash lib. https://github.com/hackmod/ethereum-ethash
this work supported by Ethersocial Network (ESN)
see also Ethersocial/Proposals#15
cc: @kimmyeonghun @magnalucus