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

limits number of nodes per IP address in Turbine #864

Merged
merged 1 commit into from
Apr 22, 2024

Conversation

behzadnouri
Copy link

Problem

Nodes congestion.

Summary of Changes

Limit to max 10 nodes per IP address in Turbine.

@@ -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;

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?

Copy link
Author

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.

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...

Copy link
Author

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.

Comment on lines +339 to +347
|| 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)
})

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

Copy link
Author

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.

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?

Copy link
Author

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.

turbine/src/cluster_nodes.rs Show resolved Hide resolved
turbine/src/cluster_nodes.rs Show resolved Hide resolved
@behzadnouri
Copy link
Author

@t-nelson we probably need to ship this sooner.

Copy link

@t-nelson t-nelson left a 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. :shipit:

@behzadnouri behzadnouri merged commit c87b830 into anza-xyz:master Apr 22, 2024
38 checks passed
@behzadnouri behzadnouri deleted the dedup-tvu branch April 22, 2024 22:31
Copy link

mergify bot commented Apr 22, 2024

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.

mergify bot pushed a commit that referenced this pull request Apr 22, 2024
behzadnouri added a commit that referenced this pull request Apr 23, 2024
behzadnouri added a commit that referenced this pull request Apr 24, 2024
…864) (#978)

limits number of nodes per IP address in Turbine (#864)

(cherry picked from commit c87b830)

Co-authored-by: behzad nouri <[email protected]>
behzadnouri added a commit to behzadnouri/solana that referenced this pull request Apr 29, 2024
This was erronously deemed unnecessary and removed in:
anza-xyz#864

The commit partially reverts solana-labs#864 and adds back socket-addr dedup.
behzadnouri added a commit to behzadnouri/solana that referenced this pull request Apr 29, 2024
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.
behzadnouri added a commit that referenced this pull request May 7, 2024
This was erronously deemed as unnecessary and removed in:
#864

The commit partially reverts #864 and adds back socket-addr dedup.
mergify bot pushed a commit that referenced this pull request May 7, 2024
This was erronously deemed as unnecessary and removed in:
#864

The commit partially reverts #864 and adds back socket-addr dedup.

(cherry picked from commit fbe1dbc)
CriesofCarrots pushed a commit to CriesofCarrots/solana that referenced this pull request May 7, 2024
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.
mergify bot added a commit that referenced this pull request May 14, 2024
… of #1106) (#1225)

reverts back in SocketAddr dedup in retransmit stage (#1106)

This was erronously deemed as unnecessary and removed in:
#864

The commit partially reverts #864 and adds back socket-addr dedup.

(cherry picked from commit fbe1dbc)

Co-authored-by: behzad nouri <[email protected]>
yihau pushed a commit to solana-labs/solana that referenced this pull request May 14, 2024
… 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 <[email protected]>
anwayde pushed a commit to firedancer-io/agave that referenced this pull request Jul 23, 2024
…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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants