stratum-mining / stratum

stratum
https://stratumprotocol.org
Other
191 stars 117 forks source link

undeterministic connection between JDC and pool #874

Open plebhash opened 2 months ago

plebhash commented 2 months ago

context

we had a community member reporting they could not connect a JDC to our hosted setup (TP + pool + JDS)

I logged into the VPS and noticed the pool was frozen. The reason why the pool was frozen is unknown, but outside the scope of this issue.

This issue is an initial report of some bug on JDC + Pool. The root cause is still unknown, and requires more investigation.

testing observations

test 1

After restarting pool + JDS processes on the VPS, I was able to connect JDC + tProxy, but tProxy crashed as soon as I started CPU miner

test 2

I restarted JDC + tProxy on my machine, but when I tried to restart JDC, it would consistently get its connection rejected by the pool.

JDC logs: image

pool logs: image

test 3

restarted pool + JDS on VPS, attempted to reconnect JDC, to see the same behavior.

I kept trying to reconnect JDC (without restarting pool + JDS), the behavior kept repeating. until eventually I saw some different behavior: immediately after some errors I got a successful connection

pool logs were identical to test 2 (followed by normal logs)

JDC logs: image

test 4

killed JDC, started again... different error messages, unsuccessful connection.

pool logs were identical to test 2 (followed by normal logs)

JDC logs: image

test 5

killed JDC, started again... different error messages, unsuccessful connection.

pool logs were identical to test 2 (followed by normal logs)

JDC logs: image

test 6

killed JDC, started again... different error messages, but now, successful connection.

pool logs were identical test 2 (followed by normal logs) JDC logs were identical to test 3

Fi3 commented 2 months ago

this is most likely due to issue with the certificate validity time

plebhash commented 2 months ago

this is most likely due to issue with the certificate validity time

@Fi3 do you have any suggestions for next steps in testing, and potentially fixing this issue?

Fi3 commented 2 months ago

Not really, I would start playing with this function https://github.com/stratum-mining/stratum/blob/main/protocols/v2/noise-sv2/src/signature_message.rs#L27