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

Use either protocol.ID everywhere

Open Stebalien opened this issue 5 years ago • 1 comments

Currently, we use protocol.ID in some places, and string in others. We should just use protocol.ID.

  • Peerstore - string
  • NewStream - protocol.ID
  • Multistream - string
  • Stream.(Set)Protocol() - protocol.ID

This is:

  1. Annoying.
  2. Expensive. We end up allocating to convert between these.

Unfortunately, the simple way of fixing this is breaking the peerstore interfaces. I'd like to just rip off the band-aid and do that.

Stebalien avatar Apr 27 '20 00:04 Stebalien

cc @raulk?

Stebalien avatar Apr 27 '20 00:04 Stebalien

Duplicate of #1886.

marten-seemann avatar Jan 27 '23 03:01 marten-seemann