NethermindEth/dotnet-libp2p

Refactor MultiAddr

flcl42 opened this issue · 4 comments

flcl42 commented

MultiAddr implementation is limited and not optimal, it asks for improvements.

Fresh ideas are welcome. Existing ones(that are optional):

  • MultiAddr requires a lot of allocations, the reason is that it contains address tokens. Let's parse it on demand instead.
  • The class also relies on Multiaddr enum and when enum's string representation is needed we use limited ugly switch for that, let's create a generator for the code of Multiaddr-to-string operation.
  • Move to a separate module
  • Check https://github.com/multiformats/cs-multiaddress ?

Would it be acceptable to fork https://github.com/multiformats/cs-multiaddress and start from there?

flcl42 commented

@JuanuMusic yep, seems like a viable approach.

Hope you like my PR!

Should we close this one?