Skip to content

network/swarm.py and transport/tcp is not smart enough to detect that peerstore multiaddress is not reachable #391

@ShadowJonathan

Description

@ShadowJonathan

What was wrong?

In py-libp2p, as of right now, there only exists one network implementation, and one
transport implementation: Swarm and TCP.

When the swarm would encounter a multiaddress in it's peerstore with values like udp/9090 or tcp/9090/quic, it would not detect those, and instead fail with multiaddr.exceptions.ProtocolLookupError over here.

How can it be fixed?

Add a generic function under transport/ which iterates over all registered ITransport classes, and add a function to ITransport that accepts one Multiaddr, and returns True when that multiaddress is supported by that transport.

Make Swarm try to acquire that ITransport upon trying a Multiaddr, and fail with SwarmException when there is no ITransport that supports that MultiAddr.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions