-
Notifications
You must be signed in to change notification settings - Fork 63
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
fix: make ipfs the default 421 proto name #77
Conversation
src/protocols-table.js
Outdated
[421, Protocols.lengthPrefixedVarSize, 'p2p'], | ||
// preferred name for 421 (added below p2p, ipfs takes precedence during table population) |
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.
This comment isn't correct anymore.
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.
Oh wait. It is correct.
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.
I did an update because I saw it wasn't correct when I made the change and fixed the comment. The push may have just taken a little bit as I'm on a train 🚆.
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.
I find it confusing (as you can see on my comments). Why not putting a comment before the p2p
saying:
// `p2p` is the preferred name for 421
And before ipfs
:
// `ipfs` is intentionally below `p2p` so that `ipfs` takes precedence during table population
// this enables us ...
Perhaps in nicer English, but you get the point :)
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.
Updated, let me know if that is clearer.
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.
LGTM. I've run the js-ipfs browser tests with this branch locally and all passing. Running the node tests now. Looking good so far.
This is a good way to do it - introduce support and then change the default. We're doing the same thing with CIDv1 and base32 :D |
All Node.js tests passing locally for me in js-ipfs with this PR - I'd say this is good to go! 👍 |
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.
Very clear. Thanks @jacobheun!
Thanks @alanshaw and @jacobheun for getting fixing this o quickly. I'll do another release. |
New release is out! |
This corrects an issue with the order of the protocol table. Previously p2p was set last in the order, which caused all created multiaddr's to use p2p instead of ipfs. While
p2p
is the desired protocol name, this helps better support legacy systems that will not yet have support for p2p.Eventually,
p2p
should be transitioned to the default.I've updated the test suite to account for p2p and ipfs protocol checks. They verify that created multiaddr's will always use ipfs instead of p2p.
Reference #76 (comment)