The Status module that consumes go-ethereum https://status.im
Go to file
Jakub Sokołowski fe8dab7391 go-ethereum: Drop throttling of inbound connections
This fix puts an end to a saga that essentially start during the
Status Prague Meetup at the end of October 2018. At the time we were
experiencing massive issues with `Connecting...` spinners in the app in the
venue we rented. We were pulling our hairs out what to do and we could not
find the cause of the issue at the time.

Three months later I deployed the following change:
https://github.com/status-im/infra-eth-cluster/commit/63a13eed

Which used `iptables` to map the `443` port onto our `30504` Status node port
using `PREROUTING` chain and `REDIRECT` jump in order to fix issues people
have been complaining about when using WiFi networks in various venues:
https://github.com/status-im/status-react/issues/6351

Our thinking when trying to resolve the reported issue assumed that some
networks might block outgoing connections on non-standard ports other than
the usual `80`(HTTP)/`443`(HTTPS) which would disrupt Status connectivity.
While this fix could have indeed helped a few edge cases, what it really
did was cause the Status node to stop seeing actual public IPs of the clients.

But __pure accident__ this change caused the code we inherited from
`go-ethereum` implementation of DevP2P protocol to stop throttling new
incoming connections, because the IP as which they appeared was a
`172.16.0.0/12` network address of the Docker bridge.

The `go-ethereum` code used the `!netutil.IsLAN(remoteIP)` check to
avoid throttling connections from local addresses, which included the
local Docker bridge address:
https://github.com/status-im/status-go/blob/82680830/vendor/github.com/ethereum/go-ethereum/p2p/netutil/net.go#L36

The fix intended to target a small number of networks with fortified
firewall configuration accidentally resolved our issues with
`Connecting...` prompts that our application showed us en masse during
our Prauge Meetup. Part of the reason for that is that venues like that
normally give out local IP addresses and use NAT to translate them onto
the only public IP address they possess.

Since out application is supposed to be usable from within networks
behind NAT like airport WiFi networks for example, it makes no sense to
keep the inbound connection throttle time implemented in `go-ethereum`.

I'm leaving `inboundThrottleTime` in because it's used to calculate
value for `dialHistoryExpiration` in:
`vendor/github.com/ethereum/go-ethereum/p2p/dial.go`

I believe reducing that value one we deploy this change should also
increase the speed with which the Status application is able to reconnect
to a node that was temporarily unavailable, instead waiting the 5*30 seconds.

Research issue: https://github.com/status-im/infra-eth-cluster/issues/35

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2021-02-16 20:38:47 +01:00
.dependabot Patch/dependabot protocol (#1980) 2020-05-19 00:14:02 +01:00
.github Move to monorepo structure (#1684) 2019-11-21 17:19:22 +01:00
.vscode Add go.formatFlags to VS Code settings 2020-01-16 13:18:36 +01:00
_assets compose: parametrize docker image, bind to v0.64.3 2021-01-20 14:58:28 +01:00
_examples Explain how to run Waku node in README (#1921) 2020-04-09 18:33:53 +02:00
account Upgrade linter and address issues 2020-12-28 16:55:14 +01:00
api [wallet] Merge blocks ranges when possible 2021-02-09 16:32:20 +02:00
appdatabase Clean topics that we don't listen to 2021-01-26 09:39:57 +01:00
bridge Clean topics that we don't listen to 2021-01-26 09:39:57 +01:00
build/bin add .gitkeep to build/bin so it always exists 2019-03-05 14:22:00 +01:00
cmd Revert "Revert "Expand Local Notifications to support multiple Notification types (#2100)"" 2021-02-05 16:48:45 +02:00
config Enabled push notifications by default and add fleet 2020-08-27 18:54:06 +02:00
contracts Use goimports instead of gofmt 2020-01-06 10:17:23 +01:00
db Use goimports instead of gofmt 2020-01-06 10:17:23 +01:00
discovery Upgrade linter and address issues 2020-12-28 16:55:14 +01:00
eth-node Clean topics that we don't listen to 2021-01-26 09:39:57 +01:00
exportlogs Upgrade geth to 1.9.5 and Whisper (#1617) 2019-10-04 17:21:24 +02:00
extkeys Upgrade extkeys (#1878) 2020-03-04 09:30:31 +01:00
images Remove image log 2020-12-17 14:10:00 +01:00
logutils Integrate Whisper-Waku bridge in status-go (#1854) 2020-02-18 12:21:01 +01:00
mailserver fix typo in mailserver archived envelope failures metric 2021-01-29 16:33:28 +01:00
metrics Handle deadlock in peerpool 2021-02-02 07:58:17 +01:00
mobile Add export/import methods 2021-01-26 09:39:54 +01:00
multiaccounts Clean topics that we don't listen to 2021-01-26 09:39:57 +01:00
node Clean topics that we don't listen to 2021-01-26 09:39:57 +01:00
notifier Notifier package to interact with gorush notifications (#910) 2018-05-08 16:30:03 +02:00
params Clean topics that we don't listen to 2021-01-26 09:39:57 +01:00
peers Fix peerpool test 2021-02-05 14:50:45 +01:00
profiling Add profiling with pprof (#754) 2018-03-23 14:58:40 +01:00
protocol Fix image messages being dropped in profile chats 2021-02-15 20:07:41 +01:00
rpc Nimbus node support 2020-01-20 13:15:17 +01:00
rtt rewrite mailserver systemd setup to a Makefile 2019-12-04 13:44:05 +01:00
services [wallet] Merge blocks ranges when possible 2021-02-09 16:32:20 +02:00
signal Local notifications service (#2026) 2020-10-28 10:56:14 +03:00
sqlite Add export/import methods 2021-01-26 09:39:54 +01:00
static Clean topics that we don't listen to 2021-01-26 09:39:57 +01:00
t Clean topics that we don't listen to 2021-01-26 09:39:57 +01:00
timesource Nimbus node support 2020-01-20 13:15:17 +01:00
transactions custom nonce 2020-11-24 12:20:57 +01:00
vendor go-ethereum: Drop throttling of inbound connections 2021-02-16 20:38:47 +01:00
waku Fix potential race condition 2021-01-26 17:58:25 +01:00
whisper Fix potential race condition 2021-01-26 17:58:25 +01:00
.codeclimate.yml add multi-account support (#1500) 2019-07-24 20:59:15 +02:00
.dockerignore Ignore *.test files from all folders (#635) 2018-02-08 14:23:08 +02:00
.gitignore Added IDE file to gitignore 2020-04-21 10:40:39 +02:00
.golangci.yml Remove protocol and eth-node submodules (#1835) 2020-02-10 12:22:37 +01:00
.travis.yml migrate to go 1.12 and go modules 2019-06-12 13:12:00 +02:00
BOOTNODE.md docs: clarify purpose and describe ports 2020-02-06 18:44:23 +01:00
CONTRIBUTING.md Update team collaboration forum (#1946) 2020-04-21 08:12:01 +01:00
LICENSE.md Create LICENSE.md 2016-09-21 10:00:29 +08:00
MAILSERVER.md expose the mailserver metrics port by default 2020-04-08 17:08:49 +02:00
Makefile makefile: use git email for AUTHOR value 2021-02-11 14:50:27 +01:00
README.md Explain how to run Waku node in README (#1921) 2020-04-09 18:33:53 +02:00
RELEASING.md update RELEASING docs links to CI (#1506) 2019-06-28 10:37:34 +02:00
VERSION Fix image messages being dropped in profile chats 2021-02-15 20:07:41 +01:00
WAKU.md Create WAKU.md with spec support (#1855) 2020-02-21 17:56:15 +08:00
go.mod go-ethereum: Drop throttling of inbound connections 2021-02-16 20:38:47 +01:00
go.sum go-ethereum: Drop throttling of inbound connections 2021-02-16 20:38:47 +01:00