-
Notifications
You must be signed in to change notification settings - Fork 998
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
core: introduce {In,Out}boundConnectionUpgrade
traits
#4307
Comments
{In,Out}boundConnectionUpgrade
traits{In,Out}boundUpgrade
traits
{In,Out}boundUpgrade
traits{In,Out}boundConnectionUpgrade
traits
Hi! I am looking into this issue in order to start understand it better and maybe start contributing. :)
|
Great to hear! Thank you for your help :)
Yes, I think that all we need is a direct copy of the existing traits. Do we necessarily need the boxing or can we do without? Best would be to open a PR and see what CI has to say about this! An important goal here is backwards-compatibility because we want to release this as a non-breaking change. |
Just opened a draft pr! Let me know your thoughts. I hope I understood the requirements correctly |
#1298 ### Documentation: Removed `upgrade::read_length_prefixed` and `upgrade::write_length_prefixed`: https://github.com/libp2p/rust-libp2p/pull/4787/files Remove `FastMessageId`: libp2p/rust-libp2p#4138 Remove `TokioDnsConfig`: libp2p/rust-libp2p@95890b5 Implement `InboundConnectionUpgrade`/`OutboundConnectionUpgrade`: libp2p/rust-libp2p#4307 --------- Co-authored-by: Brandon Vrooman <[email protected]> Co-authored-by: Hannes Karppila <[email protected]> Co-authored-by: xgreenx <[email protected]>
FuelLabs/fuel-core#1298 ### Documentation: Removed `upgrade::read_length_prefixed` and `upgrade::write_length_prefixed`: https://github.com/libp2p/rust-libp2p/pull/4787/files Remove `FastMessageId`: libp2p/rust-libp2p#4138 Remove `TokioDnsConfig`: libp2p/rust-libp2p@95890b5 Implement `InboundConnectionUpgrade`/`OutboundConnectionUpgrade`: libp2p/rust-libp2p#4307 --------- Co-authored-by: Brandon Vrooman <[email protected]> Co-authored-by: Hannes Karppila <[email protected]> Co-authored-by: xgreenx <[email protected]>
The
InboundUpgrade
andOutboundUpgrade
traits currently fulfill two needs:libp2p-noise
orlibp2p-tls
but also going from a single-stream connection to a multiplexed connection usinglibp2p-yamux
orlibp2p-mdns
ConnectionHandler
trait by removing as many associated types as possible #2863 for details.To finish #2863, we need to deprecate the implementations of
{In,Out}boundUpgrade
for stream upgrades but without affecting implementations of connection upgrades.Thus, we need to create a dedicated set of traits that is used just for connection upgrades:
{In,Out}boundConnectionUpgrade
. They need a blanket impl over everything that implements{In,Out}boundUpgrade
for this to be backwards-compatible.We can then change the "transport upgrade" infrastructure to require these traits instead of the current ones. For example here:
rust-libp2p/core/src/transport/upgrade.rs
Lines 104 to 105 in 02dc432
For it actually be a backwards-compatible change, we have to rely on the blanket impl in all the dependent crates, like
libp2p-noise
etc. Changing those to the new traits will have to be in the next breaking release.The text was updated successfully, but these errors were encountered: