-
Notifications
You must be signed in to change notification settings - Fork 112
Bitswap Refactor #2: Extract PeerManager From Want Manager + Unit Test #29
Conversation
4d5134c
to
69d063b
Compare
c320f0a
to
03f4615
Compare
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.
LGTM. Interesting solution to getting deterministic results on the goroutine channel selection logic.
NewMessageSender(context.Context, peer.ID) (bsnet.MessageSender, error) | ||
} | ||
|
||
// MessageQueue implements queuee of want messages to send to peers |
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.
typo: s/queuee/queue
@@ -30,7 +38,8 @@ type MessageQueue struct { | |||
done chan struct{} | |||
} | |||
|
|||
func New(p peer.ID, network bsnet.BitSwapNetwork) *MessageQueue { | |||
// New creats a new MessageQueues |
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.
nitpick FYI: comments should end with a fullstop, see here, please don't feel it necessary to update all the comments but moving forward it would be great to standardize on this.
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.
yea I can commit to this one going forward. :)
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.
went ahead and implemented this across bitswap as best I could, but put this in a seperate commit (including spelling change above) to be merged right after, so as to avoid making review harder. #31
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.
@lanzafame is your review a ✔️ given changes in #31?
99e83c7
to
03f4615
Compare
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 good. I like the Scott Encoding to handle different message types on the same queue, kudos.
I'm gonna go head and merge after a quick rebase. |
Seperates the functions of tracking wants from tracking peers Unit tests for both peer manager and want manager Refactor internals of both to address synchonization issues discovered in tests
Finishing adding comments to WantManager and PeerManager, refactor message structure for type safety, add sending messages test
03f4615
to
ac45ed0
Compare
Bitswap Refactor ipfs#2: Extract PeerManager From Want Manager + Unit Test This commit was moved from ipfs/go-bitswap@e9b80b6
Goals
Modularize Bitswap in preparation for attempts to optimize bitswap further
child of #26
Implementation