Skip to content
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

RFC: Remove StreamMuxerEvent::AddressChange variant #2723

Closed
wants to merge 3 commits into from

Conversation

thomaseizinger
Copy link
Contributor

@thomaseizinger thomaseizinger commented Jun 22, 2022

Description

This is never constructed, neither by libp2p-yamux, nor by libp2p-mplex.
Also, the WIP QUIC (#2289) implementation which is mentioned in the comments
also does not support this feature.

All of theses lines are dead code and are never executed.

I propose to delete this "functionality" until we know that it will be implemented and used.

This is a draft for now because:

Links to any relevant issues

Open Questions

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@mxinden
Copy link
Member

mxinden commented Jun 23, 2022

I am torn. On the one hand I am in favor of deleting the dead code, on the other hand, would be a bummer to have two consecutive breaking changes, one removing it, one re-introducing it ones supported in libp2p-quic.

@elenaf9 what are your thoughts on this? Do you expect we can support this feature in libp2p-quic in the near future, say till early 2023?

@thomaseizinger
Copy link
Contributor Author

I am torn. On the one hand I am in favor of deleting the dead code, on the other hand, would be a bummer to have two consecutive breaking changes, one removing it, one re-introducing it ones supported in libp2p-quic.

At least in the current version of this PR, the functions on ConnectionHandler and NetworkBehaviour are only deprecated, not removed. We could remove that attribute again and pretend like the code is called but it actually won't be? :D

@elenaf9 what are your thoughts on this? Do you expect we can support this feature in libp2p-quic in the near future, say till early 2023?

To add to this question: Will we support this feature via the StreamMuxer interface? AFAIK, QUIC shares the same object between Transport and StreamMuxer. Perhaps this feature can also be supported via a TransportEvent::ListenerAddressChange variant?

It feels a bit odd that the StreamMuxer has to report the address change. Yes it wraps the connection but in regards to its other concerns, roaming seems to be unrelated?

Base automatically changed from refactor/introduce-substream-box to master June 23, 2022 11:52
This is never constructed, neither by libp2p-yamux, nor by libp2p-mplex.
Also, the WIP QUIC implementation which is mentioned in the comments
also does not support this feature.

All of theses lines are dead code and are never executed.
@elenaf9
Copy link
Contributor

elenaf9 commented Jun 25, 2022

@elenaf9 what are your thoughts on this? Do you expect we can support this feature in libp2p-quic in the near future, say till early 2023?

Yes I think we can support it. Not necessarily in the first version, but in near future afterwards. I believe the reason that we currently don't do it is because quinn-proto does not emit an event if the remote's address changed. So right now we'd have to manually poll quinn_proto::Connection::remote_address, which is not ideal. But looking at quinn-rs/quinn#1095 it seems like the quinn maintainers would be open for adding such an event. I think that's doable given that they already handle if a connection migrates to a new address: https://github.com/quinn-rs/quinn/blob/cd00119d254f9442618a7f1b8f748dcb9f309740/quinn-proto/src/connection/mod.rs#L2617. CC @kpp.

To add to this question: Will we support this feature via the StreamMuxer interface? AFAIK, QUIC shares the same object between Transport and StreamMuxer. Perhaps this feature can also be supported via a TransportEvent::ListenerAddressChange variant?

Not sure if I understand what you mean. From how you named the variant I would assume that you are referring to address changes on the local node, e.g. because we switched network. But I believe the StreamMuxerEvent::AddressChange refers to the remote's address changing on an established connection. This we can not handle in the Transport, since a transport is not aware of established connections, it just produces futures that eventually result in a connection. So in our QuicTransport we only manage the Endpoint, and the QuicMuxer manages the connections.
Am I missing something?

@kpp
Copy link
Contributor

kpp commented Jun 25, 2022

Yes I think we can support it. Not necessarily in the first version, but in near future afterwards.

I agree

@thomaseizinger
Copy link
Contributor Author

All good. I think the solution in #2724 is superior to a design without this variant anyway :)

Going to close as a result.

@thomaseizinger thomaseizinger deleted the remove-address-change-event branch August 2, 2022 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants