Skip to content

fix: make ipfs the default 421 proto name#77

Merged
vmx merged 3 commits intomasterfrom
fix/p2p-order
Dec 17, 2018
Merged

fix: make ipfs the default 421 proto name#77
vmx merged 3 commits intomasterfrom
fix/p2p-order

Conversation

@jacobheun
Copy link
Copy Markdown
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
@jacobheun jacobheun requested review from alanshaw and vmx December 17, 2018 21:13
[421, Protocols.lengthPrefixedVarSize, 'ipfs'],
// preferred name for 421 (added below ipfs, p2p takes precedence during table population)
[421, Protocols.lengthPrefixedVarSize, 'p2p'],
// preferred name for 421 (added below p2p, ipfs takes precedence during table population)
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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