Skip to content

Commit

Permalink
fix: remove internal relay discovery
Browse files Browse the repository at this point in the history
This logic collects a list of known relays by testing every new connection.

It exists so we can dial /p2p-circuit/p2p/QmFoobar addresses (circuit addresses
that don't specify the relay). However, this kind of address is useless outside
of basic demos as a random relay is practically guaranteed to not be connected
to the target peer. Picking a random relay to connect to some peer is almost
_never_ the desired behavior.
  • Loading branch information
Stebalien committed Mar 31, 2020
1 parent f7a6d5d commit 06ba6d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/node/libp2p/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ func Relay(disable, enableHop bool) func() (opts Libp2pOpts, err error) {
// Enabled by default.
opts.Opts = append(opts.Opts, libp2p.DisableRelay())
} else {
relayOpts := []relay.RelayOpt{relay.OptDiscovery}
relayOpts := []relay.RelayOpt{}
if enableHop {
relayOpts = append(relayOpts, relay.OptHop)
}
Expand Down
2 changes: 1 addition & 1 deletion test/sharness/t0182-circuit-relay.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ test_expect_success 'peer ids' '
'

test_expect_success 'connect A <-Relay-> B' '
ipfsi 0 swarm connect /p2p-circuit/p2p/$PEERID_2 > peers_out
ipfsi 0 swarm connect /p2p/$PEERID_1/p2p-circuit/p2p/$PEERID_2 > peers_out
'

test_expect_success 'output looks good' '
Expand Down

0 comments on commit 06ba6d0

Please sign in to comment.