-
Notifications
You must be signed in to change notification settings - Fork 57
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
fix: avoid segfault by setting a default num peers requested in PX #3122
Conversation
You can find the image built from this PR at
Built from 9fd30c5 |
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 it!
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.
It is a great catch! Thank you for it.
Left some opinions... :-)
@@ -57,7 +58,7 @@ type | |||
requestRateLimiter*: RequestRateLimiter | |||
|
|||
proc request*( | |||
wpx: WakuPeerExchange, numPeers: uint64, conn: Connection | |||
wpx: WakuPeerExchange, numPeers = DefaultPXNumPeersReq, conn: Connection |
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 it necessary to apply default here? ... and for other variants?
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.
Over here it's not necessary! But added it because given that we now defined a default, it would make sense for that number to be used whenever no value is provided
8de6ae9
to
c93e0a8
Compare
Description
When using Peer Exchange in nwaku, we are setting the number of peers requested by using a Relay-specific parameter, which isn't set if we use nwaku as a light client and produces a segfault.
Therefore, defined a
DefaultPXNumPeersReq
constant with a value of 5 to use whenever no argument is provided or whenever Relay is not mountedChanges
DefaultPXNumPeersReq
constantIssue
#3115