Skip to content

webrtc: wrong peer id when connecting to peer via relay  #5453

Open
@dariusc93

Description

@dariusc93

Summary

When attempting to connect to a peer (from the browser) through a relay with webrtc-direct transport, it gives a WrongPeerId. This seems to happen because it is reporting/expecting the relay peer id instead the actual peer id whom we are connecting to via relay, likely coming from the outbound upgrade in webrtc-websys.

Expected behavior

Connect to peer over relay

Actual behavior

Errors with wrong peer id when attempting to connect to remote peer via relay

Relevant log output

/home/darius/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libp2p-swarm-0.44.2/src/lib.rs:843 Connection attempt to peer failed with WrongPeerId { obtained: PeerId("12D3KooWSsn13GxHchpG6dtr7o6ARqSkcMtsBuojgL9XU9t1M1uE"), endpoint: Dialer { address: "/ip4/XXX.XXX.XXX.XXX/udp/XXXX/webrtc-direct/certhash/uEiAX9LacN1_nm3t-qLg7Ap7g3GMiAoJgWTPwfueva3xdlg/p2p/12D3KooWSsn13GxHchpG6dtr7o6ARqSkcMtsBuojgL9XU9t1M1uE/p2p-circuit/p2p/12D3KooWR8YyQ3TxpkdS6QYNDjC18XtyqBxwaPGVMGraDmpmchqQ", role_override: Dialer } }. peer = 12D3KooWR8YyQ3TxpkdS6QYNDjC18XtyqBxwaPGVMGraDmpmchqQ;

Possible Solution

If intended, might be worth to document this until browser-to-browser is implemented (which may be the best solution), otherwise, we might need to report the correct peer id when connecting over relay (would need to evaluate other libp2p impl in how they handle relay v2 with webrtc-direct)

Version

0.53

Would you like to work on fixing this bug ?

Maybe

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