Skip to content

Subsequent dial with multiaddr not in the previous dialTarget #805

Closed
@vasco-santos

Description

@vasco-santos
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium: Good to have, but can wait until someone steps upstatus/readyReady to be worked

    Type

    No type

    Projects

    Status

    🎉Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions