Skip to content
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

feat: parameterizable number of connections per IP #994

Merged
merged 2 commits into from
Jan 8, 2024

Conversation

richard-ramos
Copy link
Member

Description

Matches waku-org/nwaku#2323

@status-im-auto
Copy link

status-im-auto commented Jan 4, 2024

Jenkins Builds

Click to see older builds (1)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ a231905 #1 2024-01-04 20:34:24 ~1 min nix-flake 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 1252174 #2 2024-01-08 16:10:08 ~1 min nix-flake 📄log
✔️ 0640af7 #3 2024-01-08 19:02:33 ~1 min nix-flake 📄log

Copy link
Collaborator

@chaitanyaprem chaitanyaprem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left a minor comment.

waku/v2/peermanager/connection_gater.go Show resolved Hide resolved
Copy link
Contributor

@kaichaosun kaichaosun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IP based rate limit seems better apply to store (maybe also relay) protocol, as it mostly deploys in a server.
For other protocols, when used in client app like status, the user usually behind a NAT or VPN, which means same IP assigns to many users. Wondering what's the best practice for such scenarios?

waku/v2/node/wakuoptions.go Outdated Show resolved Hide resolved
@chaitanyaprem
Copy link
Collaborator

The IP based rate limit seems better apply to store (maybe also relay) protocol, as it mostly deploys in a server. For other protocols, when used in client app like status, the user usually behind a NAT or VPN, which means same IP assigns to many users. Wondering what's the best practice for such scenarios?

Here the limit is for any peer that is connecting to the node ir-respective of the protocol involved. This is to ensure that someone doesn't spawn too many peers in order to attack a node or mislead/coerce a node.

Wrt your query of nodes running behind a NAT or VPN, it is still fine. Because there would be other nodes in the network you can connect to as long as the network is sufficiently decentralized and has lot of nodes. This just prevents from more than n nodes with same IP connecting to same peer.

@richard-ramos richard-ramos merged commit 82fc800 into master Jan 8, 2024
12 checks passed
@richard-ramos richard-ramos deleted the max-conns-per-ip branch January 8, 2024 19:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants