-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
move the go-libp2p-swarm here #1414
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use optimized 'HaveConnToPeer' checks
don't backoff dialing when the context is canceled
It doesn't exist anymore. This is now handled entirely though contexts.
don't pass the dial timeout option
We need a better solution (this is a memory hotspot when mass dialing) but that will take some thought and effort. This is a simple fix that should reduce memory usage a bit.
nil out references to finished dials
We call this method in `FindProvidersAsync`. Really, we shouldn't even be doing that (but this is "good enough" for now).
clear out extra dial jobs after dial finishes
We already setup the connection from within the new connection handler. No need to do it *again* on dial.
don't leak connections when canceling dials
Removes: * go-libp2p-conn logic (moved to transports) * go-libp2p-peerstream (moved here) Changes: * New transport interface. * Explicit over implicit (the implicit automagic now all lives in go-libp2p): * No more default transports, muxers, etc. * No more fallback dialer. Transports are now *required*. * Stream opening: * Connection picking logic (instead of just picking the first). * Tries harder to open a stream of some connections happen to be closed. * Stream closing: * No longer treats half-closed streams as fully closed. Users *must* read the an EOF or reset the stream for it to be garbage collected. * No more polling for dead connections. * Multiplexers are now *non-optional*. Really, they haven't been optional for a while but we still pretended that they were. * No more Network type alias. It added a bunch of code and didn't really provide anything but an alternative set of methods that do the same thing. * Notifications: * New guarantee: connection open notifications will complete before connection close notifications begin. * Given that, notifications are now delivered in parallel. No more notification backlogs blocking connection closing/opening.
refactor for new transports
limiter: cleanup the code
feat: lower timeout for local address dials
The global per-peer dial timeout had a significant drawback: When dialing many peers, this timeout could cause libp2p to cancel dials while they were still stuck in the limiter. A better but more complicated approach is a time budget system but we can implement that later. This change simply applies the limit to each `DialPeer`/`NewStream` call independently and makes it easy to override. While old timeout tried to account for how much we're willing to spend dialing a single peer, this new timeout tries to account for the amount of time a single "client" is willing to wait for a dial to complete before they no longer care.
improve timeouts
This timeout is already set by the dial limiter.
remove redundant dial timeout
On trying to open a new stream against an empty peer ID, we get an error saying that failed to dial a peer. This commit changes that to a more informative error message: `empty peer ID`
stop using the deprecated libp2p/go-maddr-filter
speed up the dial tests
increment active dial counter in dial worker loop
remove dependency on go-addr-util
use the transport.Upgrader interface
add support for the resource manager
release the stream scope if the conn fails to open a new stream
It turns out it is not actually necessary if the limiter short-circuits. Point being is that if the request channel has been closed, there is no active dial any more, at which point we might as well consider it done. This fixes the goroutine leak.
Refactor dial worker loop into an object and fix bug
sync: update CI config files
vyzo
approved these changes
Apr 22, 2022
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part of #1187.