Skip to content

Commit

Permalink
fix: add back to peerstore dns4 addresses removed by go-libp2p identify
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-ramos committed Sep 1, 2023
1 parent 215c7c4 commit a98efe8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions waku/v2/node/wakunode2.go
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,20 @@ func (w *WakuNode) connect(ctx context.Context, info peer.AddrInfo) error {
return err
}

for _, addr := range info.Addrs {
// TODO: this is a temporary fix
// host.Connect adds the addresses with a TempAddressTTL
// however, identify will filter out all non IP addresses
// and expire all temporary addrs. So in the meantime, let's
// store dns4 addresses with a connectedAddressTTL, otherwise
// it will have trouble with the status fleet circuit relay addresses
// See https://github.com/libp2p/go-libp2p/issues/2550
_, err := addr.ValueForProtocol(ma.P_DNS4)
if err == nil {
w.host.Peerstore().AddAddrs(info.ID, info.Addrs, peerstore.ConnectedAddrTTL)
}
}

w.host.Peerstore().(wps.WakuPeerstore).ResetConnFailures(info)

w.metrics.RecordDial()
Expand Down

0 comments on commit a98efe8

Please sign in to comment.