-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
p2p/host: expose multistream function matching and add semver func #86
Conversation
I was thinking about prerelease version parts but those are not important in case of compat. Do we want to do anything special for major version 0 of protocols? Like treating minor as compat breaker? There are also no tests for minor version change, which makes it a bit less clear |
There is a test for a minor version change, I can add more. I'll also add a test for major version 0, but i don't think we should treat it special in any way |
return false | ||
} | ||
|
||
return vers.Major == chvers.Major && vers.Minor >= chvers.Minor |
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.
If both sides are using the same check, and one increments the Minor, then one side will accept connections and other will refuse, is that correct behaviour?
Oh, one would leave older handler and install new one with incremented Minor?
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.
good point... i'm not sure how best to handle this
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.
Ah, i remember now. If you dial to 1.1.0
as 1.0.0
, the other side should reply with 1.0.0
, allowing you to continue on as normal
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.
If you dial 1.1.0
to a 1.0.0
, the other side will return na
and you can retry using 1.0.0
.
@Kubuxu LGTY? |
Yup, LGTM. |
aggressively trim connections when we're running out of memory
fix deprecated call to key.Bytes
reduce allocations when adding addrs
This lets protocols easily match based on semver, so for example,
/bitswap/1.0.0
and/bitswap/1.0.2
would be compatible.