js-libp2p icon indicating copy to clipboard operation
js-libp2p copied to clipboard

fix: make plaintext public key follow to the specs

Open oott123 opened this issue 1 year ago • 1 comments

Title

fix: make plaintext public key follow to the specs

Description

In js, all "public keys" are marshaled using protobuf PublicKey message.

However, according to specs and other implementations, the Data field should contains the raw key, instead of the protobuf marshaled key, and then put in to the exchange.

Otherwise, js-libp2p will not connect to golang or rust libp2p, raising the "Public key did not match id" error, if only plaintext selected for encryption.

Notes & open questions

Should we involve some cross-implementation tests to check if any further issue like that?

Change checklist

  • [x] I have performed a self-review of my own code
  • [ ] I have made corresponding changes to the documentation if necessary (this includes comments as well)
  • [ ] I have added tests that prove my fix is effective or that my feature works

oott123 avatar Jun 20 '24 16:06 oott123

So weird that tests are still failed. I think I have finished all the changes required... have no clue now

oott123 avatar Jun 21 '24 11:06 oott123