Skip to content

Replace ConnectedPoint with Dialer in libp2p_swarm::DialError::WrongPeerId #2767

@dmitry-markin

Description

@dmitry-markin

Description

Change the endpoint type to Dialer, extracting it from ConnectedPoint.

Motivation

Currently in case of DialError with WrongPeerId the ConnectedPoint is returned, which can contain Listener, which can't happen, because we are the dialing side. Replacing ConnectedPoint with Dialer can help to resolve this ambiguity and eliminate client code assertions.

ConnectedPoint endpoint type in WrongPeerId was introduced in this PR, which was merged here.

The original discussion that lead to this issue is in the substrate PR that changes the error printed when we connect to a bootnode that provides a different than expected peer id.

Are you planning to do it yourself in a pull request?

Maybe. Yes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions