-
Notifications
You must be signed in to change notification settings - Fork 361
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
limits number of nodes per IP address in Turbine #864
Conversation
@@ -39,6 +40,9 @@ use { | |||
const DATA_PLANE_FANOUT: usize = 200; | |||
pub(crate) const MAX_NUM_TURBINE_HOPS: usize = 4; | |||
|
|||
// Limit number of nodes per IP address. | |||
const MAX_NUM_NODES_PER_IP_ADDRESS: usize = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the usecase for more than one? local-cluster or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple nodes running behind NAT probably.
Currently I see several nodes on mainnet with the same IP address; in particular one IP address with 5 nodes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lemme guess... all with ~40kSOL stake. sfdp sybils...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not checked their stake.
Either way, it is the status quo and we cannot break it with this commit because it was not disallowed before.
|| node | ||
.contact_info() | ||
.and_then(|node| node.tvu(Protocol::UDP).ok()) | ||
.map(|addr| { | ||
*counts | ||
.entry(addr.ip()) | ||
.and_modify(|count| *count += 1) | ||
.or_insert(1) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we pop the query out to a closure for the sake of readability? nfc why fmt prefers something like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get lifetime errors with an out-of-line closure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔
are you capturing counts
instead of passing it in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing it might work but it definitely becomes a more verbose code.
I think the inline version is better anyways because it is explicit what is it doing and don't need to jump elsewhere to figure that out.
@t-nelson we probably need to ship this sooner. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the nudge! i don't think any of my concerns are blockers.
Backports to the beta branch are to be avoided unless absolutely necessary for fixing bugs, security issues, and perf regressions. Changes intended for backport should be structured such that a minimum effective diff can be committed separately from any refactoring, plumbing, cleanup, etc that are not strictly necessary to achieve the goal. Any of the latter should go only into master and ride the normal stabilization schedule. Exceptions include CI/metrics changes, CLI improvements and documentation updates on a case by case basis. |
(cherry picked from commit c87b830)
(cherry picked from commit c87b830)
This was erronously deemed unnecessary and removed in: anza-xyz#864 The commit partially reverts solana-labs#864 and adds back socket-addr dedup.
This was erronously deemed as unnecessary and removed in: anza-xyz#864 The commit partially reverts solana-labs#864 and adds back socket-addr dedup.
This was erronously deemed as unnecessary and removed in: anza-xyz#864 The commit partially reverts solana-labs#864 and adds back socket-addr dedup.
… of #1106) (#1225) reverts back in SocketAddr dedup in retransmit stage (#1106) This was erronously deemed as unnecessary and removed in: anza-xyz#864 The commit partially reverts #864 and adds back socket-addr dedup. (cherry picked from commit fbe1dbc) Co-authored-by: behzad nouri <behzadnouri@gmail.com>
…nza-xyz#864) (anza-xyz#978) limits number of nodes per IP address in Turbine (anza-xyz#864) (cherry picked from commit c87b830) Co-authored-by: behzad nouri <behzadnouri@gmail.com>
Problem
Nodes congestion.
Summary of Changes
Limit to max 10 nodes per IP address in Turbine.