multiformats / multiformats/rust-multiaddr

Change Multiaddr internal structure to store parsed address

Open
#19 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
101
Forks
56
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the current Multiaddr representation and the decapsulate operation, then review the bug referenced in PR #18. Compare the proposed Vec and nested Addr/Option designs, and define the chosen representation's impact on parsing, serialization, and protocol-list operations before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.