libp2p / libp2p/rust-libp2p

core/transport: Extend `MultiaddrNotSupported` error

Open
#2,980 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

difficulty:moderate getting-started help wanted
Dominant language
Rust
Stars
5.6k
Forks
1.3k
Avg merge
8h 47m
Merged PRs (30d)
19

Description

I have had the problem multiple times where I pass a malformed Multiaddr to a hierarchy of Transport implementations (e.g. relayed addresses are tricky) and my Multiaddr is being denied via MutliaddrNotSupported.

Say I have the following address: /dns6/xxx/tcp/xxx/p2p/xxx/p2p-circuit/p2p/xxx. When I get a MultiaddrNotSupported I don't know whether this is due to:

  • The address being malformed for libp2p-relay.
  • The address being malformed for libp2p-dns.
  • The addresses resolved by libp2p-dns being malformed for libp2p-tcp.

In addition to not knowing where it has been denied, I don't know what the reason for denial was.

Extending MultiaddrNotSupported with something implementign Error would allow Transport implementations to add details to the error.

Originally posted by @mxinden in https://github.com/libp2p/rust-libp2p/pull/2289#discussion_r987176349

Contributor guide

Open the contributing guide

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 locating the MultiaddrNotSupported definition and the Transport implementations mentioned in the issue, especially libp2p-relay, libp2p-dns, and libp2p-tcp. Trace where the error is created or propagated, then define how an underlying Error can carry the rejecting transport and denial reason. Done means callers can distinguish which transport rejected the address and why.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.