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

Closed
ghost opened this issue May 15, 2024 · 4 comments · Fixed by #5496
Closed

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

ghost opened this issue May 15, 2024 · 4 comments · Fixed by #5496

Comments

@ghost
Copy link

ghost commented May 15, 2024

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.

@ghost
Copy link
Author

ghost commented May 17, 2024

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?

@ghost
Copy link
Author

ghost commented May 24, 2024

If it seems relevant enough yes why not.

@mergify mergify bot closed this as completed in #5496 Jul 16, 2024
@mergify mergify bot closed this as completed in e2e98ad Jul 16, 2024
TimTinkers pushed a commit to unattended-backpack/rust-libp2p that referenced this issue Sep 14, 2024
This pr closes libp2p#5388 by explicitly adding the local observed address, noting this is out of protocol behaviour in non-example cases

Pull-Request: libp2p#5496.
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

Successfully merging a pull request may close this issue.

2 participants