Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
protocols/gossipsub: Review #93
protocols/gossipsub: Review #93
Changes from 1 commit
73b4d9f
91c3f92
8e6da09
b273662
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
All the objects that contain the raw data now have generic versions (which are only exposed for advanced use cases), we expect the general use should not require these Generic types.
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.
Yep. A scoring parameter prevents messages being re-routed that we published. For
random
andannonymous
author messages this is harder to determine and we need to keep track of our published messages to handle this.There are triangle routing connections which are supposedly unlikely but still allows these kinds of messages to be sent back to us.
Will extend the comments
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.
As explained above, we expect most users to just use this type. More advanced users can adjust the internals.
Its more a convenience type to hide added complexities from the average user.
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.
As a
GossipsubEvent
or simply adding a log?The way we are currently using this is by calling the
subscribe()
orunsubscribe()
functions and checking for failures at that level. The application then logs these warnings.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.
Yes, passing it back as a
GossipsubEvent
. Again, I haven't found the time to fully think this through, but from a first grasp this seems intuitive.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 guess this comes down to how we expect the application to handle this. I would have thought it more intuitive that the
gossipsub.subscribe()
function itself returns a Result and the application knows immediately there is an error and handles it then, rather than handling errors during the poll.This saves the application from having some intermediate state between sending a subscription and knowing whether it was successful or not. I guess if we throw a
GossipsubEvent
on failure, we might want to throw the success case also?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 am a bit confused why you are referring to
subscribe()
andunsubscribe()
here. How does this comment onpublish()
relate to the subscription or unsubscription paths?Do I understand correctly that this comment refers to the
poll
function inhandler.rs
, more concretely the handling ofGossipsubHandlerError::MaxTransmissionSize
when sending a message?My initial idea was to encapsulate the original oversized message in the
GossipsubHandlerError::MaxTransmissionSize
error, bubbling it up to the user. Thinking some more about it, this is likely confusing as (a) sending a oversized message to multiple peers would result in multiple such events for a singlepublish
call and (b) as you elaborated in the comment onpublish
the limit can both be reached through messages and topics. With that in mind I would leave it as is with the error log as well as the early length check inpublish
.How can the message to be send still in itself exceed the
max_transmit_size
even though, for the purpose of checking, it is being encoded as a protobuf message here to check the length? Or are you referring to something different here withmessage
?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.
@AgeManning pinging you here, not because it is urgent, but due to the comment being marked as outdated, and thus maybe getting lost.
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.
Yeah. I think this is a point of contention in the 1.1 specs.
There is a scoring configuration parameter that allows you to adjust the number of peers allowed under a single IP before the scoring kicks in. Also you can easily turn this off with the scoring parameters. See the
ip_colocation_factor
parameters inpeer_score/params.rs
.Ultimately its an optional scoring param that a user can decide to use or not (and suggested by the specs) and I guess depending on the use of this, is up to the user to include or not.