-
Notifications
You must be signed in to change notification settings - Fork 213
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
Cap number of nodes allowed to connect for third party networks #314
Conversation
Only add a new node if the current number of connected nodes is below the max Define "first party networks" to be: Polkadot, Kusama, Westend and Rococo. All other networks are capped to 500 nodes
set.insert("Polkadot"); | ||
set.insert("Kusama"); | ||
set.insert("Westend"); | ||
set.insert("Rococo"); |
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.
This needs some vetting. Is that the full list of networks we want to consider "first party"?
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.
Looks fine to me, at least; we also run Canvas but I think we can ignore that for now. The only one I'm not super sure about is "Local Testnet" but that's well under 500 at the moment so...
let label: Label = label.into(); | ||
let cid = self.chains.add_with(|cid| { | ||
ChainEntry { | ||
addr: Chain::new(cid, addr, label.clone()).start(), | ||
label: label.clone(), | ||
network_id: network.clone(), | ||
network_id: None, // TODO: this doesn't seem to be used anywhere. Can it be removed? |
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.
Is network_id
still used in the fn handler
inside of the impl Handler
?
In an attempt to stem the flood of nodes connecting to the telemetry server from third party networks this PR caps the maximum number of nodes to 500.