-
Notifications
You must be signed in to change notification settings - Fork 957
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
misc/multistream-select: Implement simultaneous open extension #2066
Changes from 22 commits
8ecd5f4
b71abd8
2cfaec9
1213669
11542d1
618ccd5
1134173
dab4ceb
9861a53
227363f
224141e
cadb065
bd76946
ade2aff
b66b4eb
16da533
4a9fef3
41c884c
cf2e3ef
a4264fc
94793bc
deb5e10
b251211
9dc1271
d49cedd
58d8131
ed0ef92
ae26a87
00532e0
62e88f8
624c2de
29eb097
aad7e72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -12,7 +12,43 @@ | |||||
Introduce `upgrade::read_length_prefixed` and `upgrade::write_length_prefixed`. | ||||||
See [PR 2111](https://github.com/libp2p/rust-libp2p/pull/2111). | ||||||
|
||||||
- Add support for multistream-select [simultaneous open extension] to assign _initiator_ and | ||||||
_responder_ role during authentication protocol negotiation on simultaneously opened connection. | ||||||
|
||||||
This is one important component of the greater effort to support hole punching in rust-libp2p. | ||||||
|
||||||
- `Transport::upgrade` no longer takes a multistream-select `Version`. Instead the | ||||||
multistream-select `Version`s `V1`, `V1Lazy` and `V1SimultaneousOpen` can be selected when | ||||||
setting the authentication upgrade via `Builder::authenticate_with_version` and the | ||||||
multistream-select `Version`s `V1` and `V1Lazy` can be selected when setting the multiplexing | ||||||
upgrade via `Builder::multiplex_with_version`. | ||||||
|
||||||
Users merely wanting to maintain the status quo should use the following call chain depending | ||||||
on which `Version` they previously used: | ||||||
|
||||||
- `Version::V1` | ||||||
|
||||||
```rust | ||||||
my_transport.upgrade() | ||||||
.authenticate(my_authentication) | ||||||
.multiplex(my_multiplexer) | ||||||
``` | ||||||
- `Version::V1Lazy` | ||||||
|
||||||
```rust | ||||||
my_transport.upgrade() | ||||||
.authenticate_with_version(my_authentication, Version::V1Lazy) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a different type, isn't it?
Suggested change
|
||||||
.multiplex_with_version(my_multiplexer, Version::V1Lazy) | ||||||
``` | ||||||
Comment on lines
+99
to
+110
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it's worth adding the explicit |
||||||
|
||||||
- `Builder::multiplex_ext` is removed in favor of the new simultaneous open workflow. Please reach | ||||||
out in case you depend on `Builder::multiplex_ext`. | ||||||
|
||||||
See [PR 2066]. | ||||||
|
||||||
[PR 2090]: https://github.com/libp2p/rust-libp2p/pull/2090 | ||||||
[simultaneous open extension]: https://github.com/libp2p/specs/blob/master/connections/simopen.md | ||||||
[PR 2066]: https://github.com/libp2p/rust-libp2p/pull/2066 | ||||||
|
||||||
# 0.28.3 [2021-04-26] | ||||||
|
||||||
|
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.
Have you considered adding a
.upgrade_sim_open()
API instead of changing the existing one? That would:a) be backwards compatible
b) perhaps avoid the trickery around two
Version
enums?