-
Notifications
You must be signed in to change notification settings - Fork 0
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
transports/quic: Refactor listener handling (updated) #19
Conversation
…td::error::Error` (libp2p#2710) * core/muxing: Remove `Into<io::Error>` bound from `StreamMuxer::Error` This allows us to preserve the type information of a muxer's concrete error as long as possible. For `StreamMuxerBox`, we leverage `io::Error`'s capability of wrapping any error that implements `Into<Box<dyn Error>>`. * Use `?` in `Connection::poll` * Use `?` in `muxing::boxed::Wrap` * Use `futures::ready!` in `muxing::boxed::Wrap` * Fill PR number into changelog * Put `Error + Send + Sync` bounds directly on `StreamMuxer::Error` * Move `Send + Sync` bounds to higher layers * Use `map_inbound_stream` helper * Update changelog to match new implementation
…p#2726) Print remote peer ID when seeing a second identify push stream coming in.
…ibp2p#2731) Bumps [styfle/cancel-workflow-action](https://github.com/styfle/cancel-workflow-action) from 0.9.1 to 0.10.0. - [Release notes](https://github.com/styfle/cancel-workflow-action/releases) - [Commits](styfle/cancel-workflow-action@a40b884...bb6001c) --- updated-dependencies: - dependency-name: styfle/cancel-workflow-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
* protocols/gossipsub: Fix a typo in error message * protocols/gossipsub: Make the error message accurately
Allow for custom protocol ID via `GossipsubConfigBuilder::protocol_id()`.
…ect (libp2p#2744) **Summary** of the plot of the `discover_peer_after_disconnect` test: 1. `swarm2` connects to `swarm1`. 2. `swarm2` requests an identify response from `swarm1`. 3. `swarm1` sends the response to `swarm2`. 4. `swarm2` disconnects from `swarm1`. 5. `swarm2` tries to disconnect. **Problem** `libp2p-identify` sets `KeepAlive::No` when it identified the remote. Thus `swarm1` might identify` `swarm2` before `swarm2` identified `swarm1`. `swarm1` then sets `KeepAlive::No` and thus closes the connection to `swarm2` before `swarm2` identified `swarm1`. In such case the unit test `discover_peer_after_disconnect hangs indefinitely. **Solution** Add an initial delay to `swarm1` requesting an identification from `swarm2`, thus ensuring `swarm2` is always able to identify `swarm1`.
…er (libp2p#2652) Remove the concept of individual `Transport::Listener` streams from `Transport`. Instead the `Transport` is polled directly via `Transport::poll`. The `Transport` is now responsible for driving its listeners.
Adapt to the transport changes of libp2p#2652. Note: this is only a draft "to make it work", and not a proper implementation. It does not support listening on multiple addresses. The listening logic with multiple Endpoints will need to be supported for the upstream implementation.
Co-authored-by: Max Inden <mail@max-inden.de>
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.
Copied over the open discussions from #17. Lmk if I forgot something.
@elenaf9 thanks for porting all the past discussions over here. As far as I can tell there is no input needed from my side right now. Please correct me if I am wrong. Also please let me know in case you want me to review any of these changes again. |
I tested it: Also one minor issue: I got LGTM. Other issues can be solved in follow up PRs. |
Do I understand correctly that you only had the |
I had two nodes, one is |
Thank you for the reviews @mxinden @kpp!
Fixed the logic now for selecting an endpoint for dialing: From my side this is ready for merge. I can not merge the latest upstream master because of some more muxer changes. @kpp I can look into fixing them, unless you are already working on it? Edit: CI is failing because of libp2p#2770 which is independent of libp2p-quic, but came up because we use libp2p-core as dependency. |
Sure. I tried but it was a little bit hard because your branch was not merged yet. You can take this issue while I am working on that issue with disconnects. |
7019d49
to
bf06d96
Compare
Sorry for the force-push. I did not change anything, just reverted the merge of upstream master. Will do a separate PR that includes the latest master and adapts the QuicMuxer. Referencing a comment in libp2p#2722:
To avoid duplicating work: are you working on this right now? From your above comment (#19 (comment)) I assumed that you are currently working on the disconnect issues, but I'm happy to sync on this in case that you have now started looking into this. Otherwise I'd draft the PR and we can discuss the solution there. |
No. |
See elenaf9#6. |
For the sake of reducing the number of parallel open PRs related to quic, and also to ease reviewing: Additional reviews would also be appreciated (cc @mxinden @thomaseizinger @MarcoPolo; relevent is only the diff within transports/quic). |
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 in favor of merging here as is. Thanks for the ping and thanks for staying on top of things @elenaf9.
keypair: &libp2p_core::identity::Keypair, | ||
multiaddr: Multiaddr, | ||
) -> Result<Self, tls::ConfigError> { | ||
pub fn new(keypair: &libp2p_core::identity::Keypair) -> Result<Self, tls::ConfigError> { |
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.
🚀 great to no longer having to pass a Multiaddr
.
I think we should merge it. I will review it today/tomorrow, wait for an additional reviews till the end of Monday and merge it. |
bench `multiple-endpoints-2#bf06d967`
|
I am not gonna be able to fit a review in in time but I think this has had a good few pairs of eyes. Happy to see it merged. The numbers look good too :) |
Friendly ping @kpp. Would you mind hitting the merge button? |
@mxinden I am not quite sure whether we have to merge it right now because of elenaf9#6 (comment). |
I think we can already merge this PR (if you have reviewed and approved) because it does not depend on elenaf9#6. The issue about not being compatible with the go-impl that appears on that other PR is not an issue here. |
Description
Replaces #17. Rebased onto latest
kpp::libp2p-quic
and merged latestlibp2p::main
. Apart form that, the only other change compared to #17 is to remove theMutex
inInAddr
(ef7b823).Copying over the description from #17:
Discussed in libp2p#2289 (comment).
This PR adapts the quic transport to the upstream listener changes of libp2p#2652. Additionally, it now allows the quic transport to listen on multiple addresses / endpoints. The changes include:
QuicTransport
now owns and drives multiple endpoints. An endpoint is created each timeTransport::listen_on
is called.None
). If then a new listening endpoint is created any following dials will use the new endpoint, but existing connections are not migrated.Open Questions
Quoting response from @mxinden:
-> I will look into it and come back to this.
Quoting again response from @mxinden:
-> If we decide to add the logic mentioned in question 1. to migrate a dialing endpoint to be the new listener, we have to deal the case of one interface vs multiple anyway. So it probably makes sense to solve this together. Will look into it.