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

fix: make ipfs the default 421 proto name #77

Merged
merged 3 commits into from
Dec 17, 2018
Merged

fix: make ipfs the default 421 proto name #77

merged 3 commits into from
Dec 17, 2018

Conversation

jacobheun
Copy link
Contributor

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)

@ghost ghost assigned jacobheun Dec 17, 2018
@ghost ghost added the status/in-progress In progress label Dec 17, 2018
[421, Protocols.lengthPrefixedVarSize, 'p2p'],
// preferred name for 421 (added below p2p, ipfs takes precedence during table population)
Copy link
Member

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.

Copy link
Member

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.

Copy link
Contributor Author

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 🚆.

Copy link
Member

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 :)

Copy link
Contributor Author

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.

Copy link
Member

@alanshaw alanshaw left a 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.

@alanshaw
Copy link
Member

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

@alanshaw
Copy link
Member

All Node.js tests passing locally for me in js-ipfs with this PR - I'd say this is good to go! 👍

Copy link
Member

@vmx vmx left a 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!

@vmx
Copy link
Member

vmx commented Dec 17, 2018

Thanks @alanshaw and @jacobheun for getting fixing this o quickly. I'll do another release.

@vmx vmx merged commit bab6edb into master Dec 17, 2018
@ghost ghost removed the status/in-progress In progress label Dec 17, 2018
@vmx vmx deleted the fix/p2p-order branch December 17, 2018 21:55
@vmx
Copy link
Member

vmx commented Dec 17, 2018

New release is out!

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