libp2p / js-peer-id

peer-id implementation in JavaScript. Deprecated; use https://github.com/libp2p/js-libp2p-peer-id instead.
https://github.com/libp2p/js-libp2p-peer-id
MIT License
80 stars 44 forks source link

Breaking change with 0.12.3 & secio #100

Closed jacogr closed 4 years ago

jacogr commented 5 years ago

This took me a bit to track down. So effectively, the last working version for me in https://github.com/polkadot-js/client in 0.12.2, as soon as I try to upgrade to 0.12.3, I have issues.

So effectively what happens -

It gets the publicKey from the remote node and then calls to create the id string. Previously this was created via hash, now it gets created via identity. This means that the equality check here fails and we get back dialed to the wrong peer, Ids do not match

For now fixed peer-id to 0.12.2 and all is well again.

vasco-santos commented 4 years ago

Hey @jacogr

Thanks for reaching out and sorry for the really late answer. Can you try the latest 0.12.* and let me know if this problem persists? The 0.12.3 added support for secp256k1 keys, but the default behavior should be the same. The change for 0.12.3 is the following: https://github.com/libp2p/js-peer-id/commit/17440a3f9a67092499f5cb5c828936a8d06ad990