-
Notifications
You must be signed in to change notification settings - Fork 737
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
Electrum over Tor disconnects from Electrumx after about 5 minutes #817
Comments
I guess all resource usage over the .onion host is accounted against the private IP of the Tor gateway (e.g. localhost). |
Unfortunately this seems to be the current state of ElectrumX - resource limits implemented to help counter the DDoS abuse tallies usage per discrete IP so once that limit is reached no further connections are allowed from that IP until server reboot i.e. stops serving Tor (Tails) clients. The server OP has the choice of a) disabling resource limits or b) disallowing Tor users after a short period of time, at least until something like #303, #790 or #805 is implemented although the first two would likely require a change on the client side. |
@SomberNight is that because I also act as a Tor relay node?
How can I do that (maybe just for testing)? |
@sumBTC No, that is unrelated. It's because recent commits introduced limiting of resource usage of sessions. Resource usage is totalled over IP address. The problem is that for the sessions connecting to your .onion host, ElectrumX sees the source IP as the local IP of your Tor process that runs the hidden service. So e.g. This means that all users who use your server will increase the resource usage of that single IP, and then that IP will effectively end up banned. @kyuupichan I think there could be an option to disable the IP buckets for onion only (for sessions where |
@SomberNight Thanks a lot for the explanation. As I understand it now, all Tor connections will be unable to connect eventually or Electrumx will be vulnerable to DDOS attacks over Tor. So this basically leaves whitelisting onion addresses as the only option. |
Environment variables: |
@peleion So there is not 1 parameter to turn it on or off. Setting
I think that parameter should be really high to allow onion addresses (and also |
Try
Don't set |
@SomberNight High values work also but this is easier and till now everything seems fine. EDIT: yep, this works. Thanks a lot to all.Not closing this issue myself because it's still a workaround in my opinion. |
Setting soft and hard limit costs to zero works well enough to solve my issue. Closing. |
When hosting a server over .onion, all resource usage was accounted against the private IP of the Tor gateway (e.g. localhost). related: kyuupichan/electrumx#817 (comment)
When hosting a server over .onion, all resource usage was accounted against the private IP of the Tor gateway (e.g. localhost). related: #817 (comment)
When hosting a server over .onion, all resource usage was accounted against the private IP of the Tor gateway (e.g. localhost). related: kyuupichan/electrumx#817 (comment)
I run an Electrumx (1.11.0) server (also) over Tor and sometimes test it by starting Electrum, also running over Tor, from my laptop. Electrum wouldn't connect to my server anymore, while Electrum without Tor has no problems connecting to my server.
I found out that if I restart Electrumx, my Electrum over Tor reconnects and shows the right amounts but after about 5 minutes (maybe it's doing a resync) it disconnects and won't connect anymore. Even restarting Electrum doesn't help: it simply won't connect to my server anymore (while Electrum without Tor has no problems, even running it longer (about 10 minutes)).
The Electrum wallet (.electrum) is created via my Trezor hardware wallet and I use it while the Trezor is not connected but that shouldn't be a problem, it shows the correct amounts initially.
I see the following Electrum error message (probably) when it disconnects:
The text was updated successfully, but these errors were encountered: