This patch updates go-libp2p for the stream interface changes in go-libp2p-core
0.7.0. This is a _significant_ breaking change to streams and all users should
read https://github.com/libp2p/go-libp2p-core/releases/tag/v0.7.0. In practice,
this change should remove a significant footgun.
TL;DR:
* `Stream.Close` now behaves like `net.TCPConn.Close`.
* There is a new `Stream.CloseWrite` (send an EOF) and `Stream.CloseRead` (close
for reading), behaving like their counterparts in `net.TCPConn`.
This is a backwards incompatible change and will require a major version bump
plus an announcement. Users can choose to re-enable SECIO by passing
`libp2p.Security(secio.ID, secio.New)` to the constructor.
1. Fix tests on go 1.15 by avoiding `string(i)`.
2. Fix the autorelay test by making relays announce fake "public" addresses. I'm
not sure how this worked before.
Previously, we'd construct addresses like `/ip4/.../udp/...` instead of
`/ip4/.../udp/.../quic` because we'd use mapped addr (ip + transport + port)
instead of the full external address (ip + transport + port + other
transports...).
* fix: use all interface addresses when we can't find the default route
* fix: don't add advertise unspecified addresses
* fix: resolve addresses before looking up observed addresses
* fix: only advertise global unicast
* fix: filter link-local addresses from advertisement
* test: fix basic host addr tests
Before, we would:
1. Receive a "listen close" event from an event handler, after the teardown started.
2. Try to add a child process to handle the event. This would block because we
were in the teardown.
3. In the teardown, try to unregister the event handler and deadlock
I've now:
* Removed the teardown.
* Switched to a single event loop.
Ideally, we'd remove goprocess entirely. But we'd need to refactor natmgr.
fixes#933
We switched `listenAddrs` from the _interface_ addresses to the raw addresses we
were listening on. Unfortunately, we needed the resolved addresses later in the
function when resolving port mappings.