-
Notifications
You must be signed in to change notification settings - Fork 209
Implement supportsPartial field
#649
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
base: marco/partial-messages-2
Are you sure you want to change the base?
Conversation
This lets us distinguish who can support a partial message request versus who requests partial message on a per topic basis.
Creates a mixed network where only one peer request partial, and the rest either support or don't
ca702b7 to
a306e04
Compare
34e9bba to
d0f9caf
Compare
| func SupportsPartialMessages() TopicOpt { | ||
| return func(t *Topic) error { |
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.
Can you add some documentation for this?
| // messages on this topic. If requestsPartial is true, this is assumed to be | ||
| // true. | ||
| optional bool supportsPartial = 4; |
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:
| // messages on this topic. If requestsPartial is true, this is assumed to be | |
| // true. | |
| optional bool supportsPartial = 4; | |
| // messages on this topic. If requestsPartial is true, this is assumed to be | |
| // true. | |
| optional bool supportsSendingPartial = 4; |
I think more explicit is more readable. requestsPartial has a receive connotation to it.
| tmap[rpc.from] = peerTopicState{requestsPartial: subopt.GetPartial()} | ||
| pts := peerTopicState{ | ||
| requestsPartial: subopt.GetRequestsPartial(), | ||
| // If they peer requested partial, they support it by default |
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:
| // If they peer requested partial, they support it by default | |
| // If the peer requested partial, they support it by default |
| return ok && gs.extensions.myExtensions.PartialMessages && peerStates[p].requestsPartial | ||
| } |
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.
| return ok && gs.extensions.myExtensions.PartialMessages && peerStates[p].requestsPartial | |
| } | |
| return ok && gs.extensions.myExtensions.PartialMessages && peerStates[p].supportsPartial | |
| } |
This lets us distinguish who can support a partial message request versus who requests partial message on a per topic basis.
See this spec commit for details: libp2p/specs@b90b21b