Closed aknuds1 closed 5 years ago
@jacobheun @vasco-santos This is my solution for fixing interop between Go and JS peers when Secp256k1 keys are used. Basically, it makes JS peers behave the same as Go peers when Secp256k1 keys are used, i.e. their peer ID is generated by inlining the PK. From my testing (with the interop suite) it works well.
hey @aknuds1
We are in the process of merging libp2p/js-peer-id#87, which will create a lof of conflicts in here. Maybe it is worth getting that in first
@vasco-santos Sure, I can see that it would be the natural order. Do that one first if you want.
Once this is ready, we will likely need to release this as a patch on the current version (because it is backwards compatible), and then rebase this onto the async changes and release a patch on top of that version.
If we only do the latter, this will probably create some annoying blockers getting the key updates done while the async changes are propagated up the chain.
@jacobheun Aha - you guys know best in which order to do this :)
I guess I need to add a test or two to reach the coverage target.
I guess I need to add a test or two to reach the coverage target.
Looking at the lines that aren't covered I think it's fine. It's a nominal drop and the error states that would need to be covered aren't very likely imo.
Will do @jacobheun! Just have to get back on the computer.
On Thu, Jul 11, 2019, 17:53 Jacob Heun notifications@github.com wrote:
@jacobheun commented on this pull request.
In src/index.js https://github.com/libp2p/js-peer-id/pull/95#discussion_r302620279:
@@ -145,18 +166,14 @@ exports.create = function (opts, callback) {
}
opts = opts || {}
opts.bits = opts.bits || 2048
- opts.keyType = opts.keyType || 'RSA'
Forgot one thing! Can you update the options in the readme for create? 🙏
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/libp2p/js-peer-id/pull/95?email_source=notifications&email_token=AACEVV3MHEGFVQDEL56PAF3P65JQTA5CNFSM4IBJXJL2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOB6FXH5A#pullrequestreview-260797428, or mute the thread https://github.com/notifications/unsubscribe-auth/AACEVV3PJ4SEE3SEDCX3QCTP65JQTANCNFSM4IBJXJLQ .
@jacobheun I pushed an update to the README, please have a look.
That works, thanks! Going to start the release hydra for this and async await.
0.12.3 contains this fix.
Will rebase this once I've finished the 0.13 async release
Rebased this if you want to take a look @aknuds1, and make sure I didnt miss anything. I'll let ci do it's thing and then do a patch of this for the 0.13 async line.
I looked it over @jacobheun, it looks fine to me. Thanks!
This is now in both the 0.12 and 0.13 version lines. 🎉
awesome 🚀
Support creating peer IDs from Secp256k1 type keys and harmonize ID algorithm with Go so that for public keys of <= 42 bytes length, we inline the public key.
Required by https://github.com/libp2p/interop/pull/21