-
Notifications
You must be signed in to change notification settings - Fork 294
multistream-select 1.0: simultaneous open protocol extension #196
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
Changes from 7 commits
31b56bf
df1ad98
15eb969
682894e
21be08c
26774a2
ff7a12e
3dd8877
debc8f5
dc663fe
ae86e33
13ea44a
41ce779
77cbb43
dd14a1e
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 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,89 @@ | ||||||||||||
| # Simultaneous Open for bootstrapping connections in multistream-select | ||||||||||||
|
|
||||||||||||
| | Lifecycle Stage | Maturity | Status | Latest Revision | | ||||||||||||
| |-----------------|---------------|--------|-----------------| | ||||||||||||
| | 1A | Working Draft | Active | DRAFT | | ||||||||||||
|
||||||||||||
| | 1A | Working Draft | Active | DRAFT | | |
| | 1A | Working Draft | Active | r0, 2021-05-06 | |
Outdated
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.
| order to do so, they both generate a random 256-bit integer and send it as | |
| order to do so, they both generate a random 64-bit integer and send it as |
The Golang implementation is using a 64-bit integer:
myNonce := binary.LittleEndian.Uint64(randBytes)
Outdated
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.
| `select:` string. The integer is in big-endian format, encoded in base64. The | |
| `select:` string. The integer is send in its base-10 string representation. The |
The Golang implementation is sending the nonce in the base-10 string representation.
myselect := []byte(tieBreakerPrefix + strconv.FormatUint(myNonce, 10))
mxinden marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Outdated
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.
| In the unlikely case where both peers selected the same integer, they | |
| generate a fresh one and enter another round of the protocol. If | |
| multiple rounds of the protocol result in the same integers, this is | |
| indicative of a bug and both peers should abort the connection. | |
| In the unlikely case where both peers selected the same integer, connection establishment fails. |
The Golang implementation does not retry. See multiformats/go-multistream#42 (comment).
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.
As per @raulk's comment in #196 (comment).