Skip to content

Change Multiaddr internal structure to store parsed address #19

Description

@progval

As of now, Multiaddr stores a byte array, representing the serialized version of the address.

Although this allows very fast serialization (array copy), I believe this is not the most appropriate format.
Indeed, operations on Multiaddr (eg. decapsulate) actually work on the list of protocols, and not on the byte representation. The bug mentioned in PR #18 is a good example of it.

I see two possible representations:

  • Make Multiaddr store a Vec<Addr>, with Addr being an Enum for all supported protocols
  • Make Multiaddr only store an Addr and an Option<Multiaddr> for the inner and/or outer multiaddr.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions