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

[Rendezvous] Change ttl and limit to uint64 #338

Merged

Conversation

thomaseizinger
Copy link
Contributor

@thomaseizinger thomaseizinger commented Jun 21, 2021

To be meaningful, TTL has to be a positive integer hence the use of
an signed integer does not bring any value and only introduces
unnecessary error handling.

@thomaseizinger thomaseizinger changed the title Change ttl to uint64 [Rendezvous] Change ttl to uint64 Jun 21, 2021
@mxinden
Copy link
Member

mxinden commented Jun 21, 2021

I am guessing you meant to write:

- hence the use of an unsigned integer does not bring any value
+ hence the use of a signed integer does not bring any value

I agree, though I don't think we can just alter the type as that would be a breaking protobuf change while this protocol is already used in the wild. @vyzo @vasco-santos can you comment here?

@thomaseizinger
Copy link
Contributor Author

I am guessing you meant to write:

- hence the use of an unsigned integer does not bring any value
+ hence the use of a signed integer does not bring any value

I agree, though I don't think we can just alter the type as that would be a breaking protobuf change while this protocol is already used in the wild. @vyzo @vasco-santos can you comment here?

Yep will fix that!

Re breaking change: How does the protocol being a Draft affect this? I would have assumed that prior to being finalized, we can make breaking changes. It is not particularly nice for implementations but the way I see it, early adoptions of protocols have to accept that?

@vyzo
Copy link
Contributor

vyzo commented Jun 21, 2021 via email

To be meaningful, TTL has to be a positive integer hence the use of
an signed integer does not bring any value and only introduces
unnecessary error handling.
@thomaseizinger thomaseizinger force-pushed the rendezvous-ttl-unsigned-integers branch from 66f47fb to f4a617d Compare June 23, 2021 03:01
@thomaseizinger
Copy link
Contributor Author

@mxinden I've changed the commit message to say "signed integer".

Limiting the number of responses makes only sense if it is a positive
integer.
@thomaseizinger thomaseizinger changed the title [Rendezvous] Change ttl to uint64 [Rendezvous] Change ttl and limit to uint64 Jun 23, 2021
@thomaseizinger
Copy link
Contributor Author

In the same spirit, I changed limit of Discover to a uint64.

Copy link
Member

@mxinden mxinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After a bit of research it seems like the rendezvous protocol isn't used anywhere yet, thus the breaking changes here are fine by me. Thanks for cleaning these types up Thomas!

Would you mind bumping the spec revision?

diff --git a/rendezvous/README.md b/rendezvous/README.md
index 4d98b2f..9277d40 100644
--- a/rendezvous/README.md
+++ b/rendezvous/README.md
@@ -2,7 +2,7 @@
 
 | Lifecycle Stage | Maturity      | Status | Latest Revision |
 |-----------------|---------------|--------|-----------------|
-| 1A              | Working Draft | Active | r1, 2019-01-18  |
+| 1A              | Working Draft | Active | r2, 2021-06-24  |
 
 Authors: [@vyzo]

@thomaseizinger
Copy link
Contributor Author

Would you mind bumping the spec revision?

Done!

thomaseizinger added a commit to comit-network/rust-libp2p that referenced this pull request Jun 24, 2021
@mxinden mxinden merged commit ed021a9 into libp2p:master Jun 28, 2021
@mxinden
Copy link
Member

mxinden commented Jun 28, 2021

Thanks @thomaseizinger!

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.

3 participants