Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rendezvous: Example "discovering with identify" doesn't work #5388

Open
caementarius opened this issue May 15, 2024 · 4 comments
Open

rendezvous: Example "discovering with identify" doesn't work #5388

caementarius opened this issue May 15, 2024 · 4 comments

Comments

@caementarius
Copy link

Summary

When launching the rendezvous example and trying to discover peers with identify, the peer abort because it can't register without knowing any external address.
Steps to reproduce

  1. Launch the server (1)
  2. Launch a peer with identify (4)

Expected behavior

As suggested in this comment, the protocol identify could allow to know and set an external address automatically and then the registration should be successfull.
Then the discovering would work as described.

Actual behavior

The peer aborts when registering because it doesn't know any external address.

Relevant log output

$ RUST_LOG=info cargo run --bin rzv-identify
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.15s
     Running `~/rust-libp2p/target/debug/rzv-identify`
2024-05-15T06:34:58.587487Z  INFO libp2p_swarm: local_peer_id=12D3KooWNFn1BxcTXDvNY9YKY3gr4Sn3V6eTu2Pb1dPnFgtHdTHF
2024-05-15T06:34:58.587938Z  INFO rzv_identify: Listening on /ip4/127.0.0.1/tcp/37627
2024-05-15T06:34:58.587976Z  INFO rzv_identify: Listening on /ip4/192.168.1.59/tcp/37627
2024-05-15T06:34:58.675236Z ERROR rzv_identify: Failed to register: We don't know about any externally reachable addresses of ours

Possible Solution

As suggested in this post, we could use the observed address as a potential ExternalAddress.
Then we could either use it directly or use autonat to probe it and obtain a ConfirmedExternalAddress

Version

libp2p version 0.53.2

Would you like to work on fixing this bug ?

Yes

@drHuangMHT
Copy link
Contributor

Local addresses aren't considered external addresses unless manually added, so this is kind of expected.

@caementarius
Copy link
Author

Local addresses aren't considered external addresses unless manually added, so this is kind of expected.

Still wouldn't it be easier to understand in the example if we explicitly register the address instead of vaguely suggest that having the protocol Identify is sufficient ?

@jxs
Copy link
Member

jxs commented May 22, 2024

Hi @caementarius and thanks for the interest! Want to submit a PR addressing that?

@caementarius
Copy link
Author

If it seems relevant enough yes why not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants