mycognosist / solar

A minimal Secure Scuttlebutt replication node.
Other
20 stars 2 forks source link

JSON-RPC blocks incoming TCP connections #50

Closed mycognosist closed 1 year ago

mycognosist commented 1 year ago

This is a weird one. I've been attempting to run an instance of solar on a VPS and establish a TCP connection from my laptop. When attempting this with two instances on my laptop, it succeeds. However, the laptop -> VPS connection fails.

I ensured the necessary ports were open on my firewall, tested using netcat (successfully) and tested with a basic Rust async TCP echo server (successfully). Somewhat by chance, I tried disabling the JSON-RPC server on the solar instance running on the VPS and it worked as intended (TCP connection established, replication performed).

I also notice that I'm able to stop the server using Ctrl+c now, whereas previously I had to use Ctrl+\ (only on the VPS though). So the JSON-RPC code (which is not async) is blocking in a problematic way.

I think it might be time to switch to an async JSON-RPC library. I will now look into refactoring solar to use https://github.com/paritytech/jsonrpsee.

mycognosist commented 1 year ago

Fixed in https://github.com/mycognosist/solar/pull/52