felixbrucker / foxy-proxy

A Proof of Capacity proxy which supports solo and pool mining upstreams
GNU General Public License v3.0
32 stars 19 forks source link

Support for hpool's new protocol #210

Closed quetzalcoatl closed 5 years ago

quetzalcoatl commented 5 years ago

Is your feature request related to a problem? Please describe. bhd.hpool.com recently has posted an announcement: https://bhd.hpool.com/news/5cc1a87c5333e70348d65d74 where they warn about a required change in supported mining software. It's a bit hard to understand what they say exactly, but it looks like they will be rejecting incompatible clients and proxies and will require using their own specific proxy. Since the english version of the text is a bit hard to grasp, I tried the chinese version and google-translate, here's the result:

Notice about Hpool's BHD mining agent software: In order to optimize the data collection effect of the mining pool and take into account the revenue of different capacity mining machines, hpool has launched a mining agent software, and the agent software is used together with the mining software. Welcome everyone. Go to the download experience and give your valuable feedback. During the experience period, hpool will still adopt the answer that does not use hpool official agent software; after the expiration period, hpool will only adopt the answer using hpool official agent software, and the experience period is tentatively set to 4.25 - 5.8

They plan to activate new rules on May 8th (the end of 'experience period'). They already require use of their own miner, so it seems possible that this will be extended to proxies as well. On https://bhd.hpool.com/download they have posted a modified blago miner and a new piece called "x-proxy".

I have played a bit with that and it seems that when I connect the newest blago miner (190301) either directly, or via their x-proxy, it is always seen by the pool as 0.0TB capacity. That's because their modified blago sends some extra headers along with normal requests. From what I've seen, these are, at least:

X-Miner: Blago v1.170997_AVX2
X-Capacity: 1154
X-ClientIP: 127.0.0.1
X-Minername: quetzalcoatl
X-Account: abcdef01-2345-6789-abcd-ef0123456789

X-Miner is hardcoded to the .exe name, X-Capacity is just the total plot files in GB, X-ClientIP is obvious I suppose we could just hardwire it to 127.0.0.1, X-Minername and X-Account are read from configuration file and passed through. I don't know if they verify X-Miner name, so it probably would need to be configurable.

Plain blago miner doesn't send them and has no options for configuring this data. Without those headers, hpool doesn't seem to fully respect the miner. Since those headers are quite simple, the proxy seems a nice place to inject them on the fly.

Describe the solution you'd like I'd like to be able to configure the content of those headers via config yaml file and I'd like bhd-burst-proxy to send those header for me, as they are given in the config file, regardless of what miners connected to the proxy are sending.

Describe alternatives you've considered Once the rules are changed, I don't see any alternatives other than giving up on bhd-burst-proxy and switching to their modified blago and their x-proxy. I really don't want to do that, but right now I don't see any other way, since no other mining software has any options to send those headers.

quetzalcoatl commented 5 years ago

Actually, I started thinking about the headers due to their new x-proxy, but actually, we could use the header injection even now, regardless of whever the new rules are introduced or not. Header injection would probably allow us to use any miner, not just their special one.

quetzalcoatl commented 5 years ago

Huh what, I did not want to close! oops

felixbrucker commented 5 years ago

Those headers are already sent by the proxy by default. I took a quick look at the x-proxy and the only improvement i can see is some status upload to http://bhd.hpool.com/proxy/uploadminerstatus. I might play around with x-proxy the next days and see what it does exactly but i think we are good regarding their change.

You mentioned you got 0TB capacity displayed on hpool right now with blago either directly connected or via x-proxy? I'm mining on hpool right now with my proxy and i did not observe any degradations of capacity, everything looks good from my end.

felixbrucker commented 5 years ago

I took a look at their uploadminerstatus: You basically send a list of miners with their software, name, capacity etc. Hopefully hpool will give a more in-depth explanation of their upgrade and what exacly they are going to change (besides the upload miner stats endpoint). Maybe it is only that.

That being said ill probably implement it in the next days.