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

chore: downgrade peer-id to the same version used by libp2p #26

Merged
merged 1 commit into from
Sep 25, 2019

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Sep 23, 2019

Needed to upgrade ipfs to the latest libp2p, otherwise you end up with multiple versions of peer-id in the dependency tree and then libp2p thinks peer-ids are not peer-ids and can't dial anything.

Depends on libp2p/js-libp2p-crypto#158

Copy link
Member

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Just left a minor comment, and I will merge and release this once the dependants are release

@@ -183,7 +186,7 @@ const embedPublicKey = async (publicKey, entry) => {
*/
const extractPublicKey = (peerId, entry) => {
if (!entry || !peerId) {
const error = 'one or more of the provided parameters are not defined'
const error = new Error('one or more of the provided parameters are not defined')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do the new Error only on throw?

Same applies on another case below

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There won't be a stack trace in the logs if we just log the message.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually prefer to have clean logs and with the ERR CODE find and replicate the issue. But, I understand your point as well

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there's only one place in the entire codebase a certain error code is emitted, and it's also only invoked from one place in the entire codebase I'd agree, but that's rarely the case so more verbose logs can only help.

This is to ensure you can dial other peers on the network, otherwise
libp2p doesn't think peer-ids are peer-ids.
@vasco-santos vasco-santos merged commit 0313ddb into master Sep 25, 2019
@vasco-santos vasco-santos deleted the downgrade-peer-id branch September 25, 2019 10:18
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.

2 participants