Skip to content

Subsequent dial with multiaddr not in the previous dialTarget #805

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

Closed
vasco-santos opened this issue Nov 20, 2020 · 3 comments
Closed

Subsequent dial with multiaddr not in the previous dialTarget #805

vasco-santos opened this issue Nov 20, 2020 · 3 comments
Labels
P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked

Comments

@vasco-santos
Copy link
Member

  • Version: 0.29
  • Platform: *
  • Subsystem: Dialer

Type: Bug

Description:

When a dial to a given peer is performed, if a dial to the same peer is currently in progress, this dial will just wait on the first to finish and return its connection.

A tricky scenario can happen with this flow. If the second dial uses an address that was not included in the first one, it will not be used. For instance, by using libp2p.dial(ma1) ... libp2p.dial(ma2), or by getting the multiaddrs from AddressBook and then dial from a not known multiaddr of a peer, the second multiaddrs will not be used.

Steps to reproduce the error:

  • libp2p.dial(serverMultiaddr)
    • (exchanged identify addresses (that do not announce the serverMultiaddr))
  • on reload, autoDial kicks in from peerStore
  • libp2p.dial(serverMultiaddr)

Reference: ipfs/js-ipfs#3400

@vasco-santos
Copy link
Member Author

On a sync conv with @jacobheun

this is where multiaddr confidence would be really nice. Maybe in the interim we could add on identify and prune known addresses when they fail a dial? This wouldn't be great for intermittent failures but we need a way to avoid storing hundreds of multiaddrs for a peer until we get confidence in place

@vasco-santos vasco-santos added the status/ready Ready to be worked label Nov 20, 2020
@vasco-santos vasco-santos changed the title Subsequent dial with multiaddr not in the PeerStore Subsequent dial with multiaddr not in the previous dialTarget Nov 20, 2020
@vasco-santos vasco-santos added the P2 Medium: Good to have, but can wait until someone steps up label Jun 24, 2021
@TinyTb TinyTb moved this to Backlog in js-libp2p Oct 11, 2022
@TinyTb TinyTb added this to js-libp2p Oct 11, 2022
@achingbrain
Copy link
Member

Since #1498 when passed a multiaddr, only that multiaddr is dialed so this is no longer possible.

There's a possible edge case where if you dial a peer id, then add a new address to the address book, then dial the peer id again it may join on the first dial promise rather than adding the new address to the dial target but this needs further investigation.

@maschad
Copy link
Member

maschad commented Sep 28, 2023

Closing as we currently only dial one peer at a time so this is not possible

@maschad maschad closed this as completed Sep 28, 2023
@github-project-automation github-project-automation bot moved this from 🪵Backlog to 🎉Done in js-libp2p Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Medium: Good to have, but can wait until someone steps up status/ready Ready to be worked
Projects
Archived in project
Development

No branches or pull requests

3 participants