-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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: add pending connection limits + bump libp2p to 0.54.1 #2644
base: master
Are you sure you want to change the base?
Conversation
Thanks for the contribution! Before we can merge this, we need @maschad to sign the Fuel Labs Contributor License Agreement. |
318d164
to
c27d715
Compare
@MitchTurner Can we update to libp2p 0.55 directyl it would fix : #2488 |
@AurelienFT I'd be happy to, but it looks like it requires Rust v1.83. So maybe we wait until we update the Rust version? |
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.
will not approve, will allow others to review
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 mostly good to me. The only blocking thing I've spotted are some as
conversions that could potentially panic.
Co-authored-by: Mårten Blankfors <[email protected]>
Co-authored-by: Mårten Blankfors <[email protected]>
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 updating! 🙏
max_gossipsub_peers_connected: 100, | ||
max_request_response_peers_connected: 100, |
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.
Some suggestions on these two lines:
- should these values be configurable, and also have a hard limit?
e.g. something like
max_gossipsub_peers_connected: 100, | |
max_request_response_peers_connected: 100, | |
max_gossipsub_peers_connected: self.max_gossipsub_peers_connected.min(100), | |
max_request_response_peers_connected: self.max_request_response_peers_connected.min(100), |
-
Maybe best to declare the hardcoded constants as const variables?
-
You renamed
self.max_peers_connected, but not
self.max_peers_connected. (Ther argument has
--max-peers-connected` as argument name hardcoded in clap_derive, so there should be no risk in renaming this
hash::Hash, | ||
}; | ||
|
||
pub struct SizedHashset<T> { |
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.
nit: I find BoundedHashSet
more clear
if !self | ||
.gossipsub_peer_limiter | ||
.insert_new_if_room(propagation_source) | ||
{ | ||
return None; | ||
} | ||
|
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 wonder if this makes the node susceptible to a DoS. It requires only 100 peers to effectively block all GossipSub
messages on a target node.
if !self | ||
.gossipsub_peer_limiter | ||
.insert_new_if_room(propagation_source) | ||
{ |
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.
should there be a warn message that the node has reached the maximum number of peers?
only one comment re the possibility of DoS, otherwise LGTM |
Linked Issues/PRs
Replaces: #2150
connection_limits
behavior toFuelBehavior
#1560max_pending_outgoing_connections
):Description
Checklist
Before requesting review