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

p2p/host: expose multistream function matching and add semver func #86

Merged
merged 2 commits into from
Aug 17, 2016

Conversation

whyrusleeping
Copy link
Contributor

This lets protocols easily match based on semver, so for example, /bitswap/1.0.0 and /bitswap/1.0.2 would be compatible.

@whyrusleeping whyrusleeping added the status/in-progress In progress label Aug 16, 2016
@whyrusleeping whyrusleeping added need/review Needs a review and removed status/in-progress In progress labels Aug 16, 2016
@Kubuxu
Copy link
Member

Kubuxu commented Aug 17, 2016

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?
Either way I would suggest adding test cases with major version 0 to the suite so it is definitive.

There are also no tests for minor version change, which makes it a bit less clear

@whyrusleeping
Copy link
Contributor Author

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
Copy link
Member

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

@whyrusleeping
Copy link
Contributor Author

@Kubuxu LGTY?

@Kubuxu
Copy link
Member

Kubuxu commented Aug 17, 2016

Yup, LGTM.

@whyrusleeping whyrusleeping merged commit b077d39 into master Aug 17, 2016
@whyrusleeping whyrusleeping deleted the feat/semver-mstream-matching branch August 17, 2016 17:58
marten-seemann added a commit that referenced this pull request Jan 17, 2022
aggressively trim connections when we're running out of memory
marten-seemann added a commit that referenced this pull request Apr 27, 2022
marten-seemann pushed a commit that referenced this pull request Aug 9, 2022
reduce allocations when adding addrs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/review Needs a review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants