Add client.reconnect hostname/port/waittime support#1630
Add client.reconnect hostname/port/waittime support#1630parabitdev wants to merge 1 commit intobitaxeorg:masterfrom
Conversation
Parse optional params from client.reconnect messages per the stratum protocol spec. The client disconnects, waits the requested time, then reconnects to the specified host/port. Hostname defaults to the current server and is validated against the configured pool domain (including subdomains) to prevent redirection to unrelated servers.
12b0ba1 to
e86a1c3
Compare
| return esp_transport_write(transport, configure_msg, strlen(configure_msg), TRANSPORT_TIMEOUT_MS); | ||
| } | ||
|
|
||
| bool is_same_domain(const char * host_a, const char * host_b) |
There was a problem hiding this comment.
Please add a unittest for this helper to make sure pool.co.uk and evil.co.uk fail the check
There was a problem hiding this comment.
Excellent catch, I will add testing/handling of multipart TLDs prior to converting from draft.
|
Is this an extension of the stratum protocol, and is it documented somewhere? |
Oh I totally missed that. Not many pools implement it, I guess. Should it try to connect to the fallback pool if there's a wait period longer than a certain amount? |
This is an opinionated question. I personally lean towards the miner<->pool relationship being symbiotic and as such it makes no sense to send a long wait time. There is an argument though that a miner should never be locked out for long periods by a pool's decision ("It is the user's hardware, not mine."). I am happy to follow your guidance on if you want one (or more) of the following safeguards added wrt this point:
|
|
I tend to the last one, if the pool is not available the firmware tries a few times, fails to do so and connect to the fallback pool. Also, I'm not sure why a pool would say how long that is, maybe to spread the load of reconnects over time? Counter to that is what you also said, it's symbiotic, so if a pool says it's not available for x amount of time, we can adhere to that. But maybe it's for another PR, and just ignoring the time value for now is one step closer. |
Parse optional params from client.reconnect messages per the stratum protocol spec. The client disconnects, waits the requested time, then reconnects to the specified host/port. Hostname defaults to the current server and is validated against the configured pool domain (including subdomains) to prevent redirection to unrelated servers.
Added Params:
Cases and what I believe the correct resolution is: