Commit Graph

1571 Commits

Author SHA1 Message Date
Steven Allen 3155ff3089
Merge pull request #1029 from libp2p/fix/obey-timeout
fix: obey new stream timeout
2020-12-08 14:49:47 -08:00
Steven Allen 024f1af9ae fix: obey new stream timeout 2020-12-08 14:35:58 -08:00
Steven Allen fcf69647e9
Merge pull request #1001 from libp2p/feat/rw-stream
feat: update to go-libp2p-core 0.7.0 interface changes
2020-11-11 09:42:26 -08:00
Steven Allen 7a98f28856 feat: update to go-libp2p-core 0.7.0 interface changes
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`.
2020-11-11 09:35:37 -08:00
vyzo e046c95292
Merge pull request #1005 from libp2p/feat/conngater
Basic Connection Gater Implementation
2020-11-10 19:20:26 +02:00
vyzo 863439702d add note in godocs about non-closure of active connections to blocked entities. 2020-11-10 18:39:34 +02:00
vyzo e67928b576 word cosmetics 2020-11-10 16:08:28 +02:00
vyzo e6b6f9320b fix tests 2020-11-10 16:06:49 +02:00
vyzo 9ef1f9e49e propagate errors from datastore ops 2020-11-10 16:06:39 +02:00
vyzo 49cca12207 cosmetics 2020-11-10 15:54:42 +02:00
vyzo fd44d15e8d use a RWMutex 2020-11-10 15:53:30 +02:00
Alex Towle 636d0787c3
Fixed bug for inbound connections gated by the deprecated filter option (#1004)
* Fixed bug for inbound connections gated by the deprecated filter option
2020-09-16 10:37:36 +05:30
vyzo 122cdf31a6 turn off stupid codecov annotations 2020-09-14 19:35:21 +03:00
vyzo 868f975b78 gomod: go-datastore dependency 2020-09-14 15:58:25 +03:00
vyzo fd7f51887b add test 2020-09-14 15:56:50 +03:00
vyzo 9b78ee25e4 fix typos, add comment 2020-09-14 15:56:43 +03:00
vyzo d4be9c8028 add methods to list blocked entities 2020-09-14 15:25:46 +03:00
vyzo 9ca5c11a9e add support for persistence to datastore 2020-09-14 15:14:22 +03:00
vyzo aa8de6189d basic implementation of connection gater 2020-09-14 14:48:48 +03:00
Adin Schmahmann fb3179e617 chore: update go-multiaddr 2020-08-25 15:32:03 -04:00
Steven Allen b95d6ae6fd
Merge pull request #990 from fouge/feat/mdns-ipv6
Added parsing of IPv6 addresses for incoming mDNS requests
2020-08-20 09:55:50 -07:00
Cyril Fougeray 16d314cf30 Deduplicating code when parsing ipv4/ipv6 address; from the comment on the PR 2020-08-20 18:36:07 +02:00
Steven Allen c24d028099
Merge pull request #972 from libp2p/feat/default-transports
Switch from SECIO to Noise
2020-08-19 11:23:35 -07:00
Steven Allen db5f196114 feat: switch from SECIO to Noise as the default security transport
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.
2020-08-19 11:15:02 -07:00
Steven Allen 35c2dbd600
Merge pull request #995 from libp2p/fix/tests
fix tests
2020-08-19 11:14:42 -07:00
Steven Allen de10591dd8 fix tests
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.
2020-08-19 11:03:55 -07:00
Adin Schmahmann 6b509be0eb chore: update deps 2020-08-19 02:54:41 -04:00
Cyril Fougeray 3fa37a3452 Added parsing of IPv6 addresses for incomming mDNS requests 2020-08-11 15:04:54 +02:00
Raúl Kripalani eb4cca1b04 go mod tidy. 2020-08-04 10:25:36 +01:00
Will 7cfc4e645e
Bump Autonat version & validate fixed call loop in `.Addrs` (#988)
* add test for host address with attached autonat
* bump autonat release
2020-08-03 14:33:21 -04:00
Steven Allen fa07fcf03b
Merge pull request #987 from libp2p/fix/use-correct-ext-addr
fix: use the correct external address when NAT port-mapping
2020-08-03 10:50:59 -07:00
Steven Allen 717d9e7574 fix: use the correct external address when NAT port-mapping
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...).
2020-08-03 10:29:26 -07:00
Raúl Kripalani aae9c77cd8
upgrade go-libp2p-circuit to v0.3.1. (#986) 2020-07-30 13:03:22 +01:00
Raúl Kripalani a5786f0415
upgrade deps + interoperable uvarint delimited writer/reader. (#985) 2020-07-30 12:42:57 +01:00
Will 147acc7bf7
Merge pull request #983 from sandmanhome/feat/fix-host-lost-AutoNat-PublicAddr
fix host can be dialed by autonat public addr, but lost the public addr to announce
2020-07-24 14:57:25 -07:00
sandman d9a4e38ac4 fix to call PublicAddr interface of AutoNat 2020-07-24 10:12:58 +08:00
sandman a55891f71b add AutoNat PublicAddr when host can be dialed but not get public addr by net.InterfaceAddrs() 2020-07-23 15:19:47 +08:00
Steven Allen 9cd6aaa9ea
Fix address advertisement bugs (#974)
* 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
2020-07-07 16:41:45 -07:00
Steven Allen 6a3b138a57
Merge pull request #971 from libp2p/fix/close-deadlock
fix: avoid a close deadlock in the natmanager
2020-06-23 10:21:59 -07:00
Steven Allen 72770db2f6 fix: avoid a close deadlock in the natmanager
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
2020-06-22 16:33:19 -07:00
Raúl Kripalani 985120b6f9
upgrade swarm; add ID() on mock conns and streams. (#970) 2020-06-16 19:45:28 +01:00
Adin Schmahmann 14f4ff5e06
Merge pull request #966 from libp2p/fix/nat-port-mapping
fix(nat): use the right addresses when nat port mapping
2020-06-09 19:05:57 -04:00
Steven Allen f90bff546b
Merge pull request #967 from libp2p/chore/update-deps
chore: update deps
2020-06-09 15:59:43 -07:00
Steven Allen 1180b6fa1e fix(nat): use the right addresses when nat port mapping
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.
2020-06-09 15:55:15 -07:00
Steven Allen a5b6745ff9 chore: update deps
* Updates yamux to reduce lock contention.
* Updates the peerstore to remove an issue where we'd forget our peer's addresses instead of extending the TTL.
2020-06-09 15:37:17 -07:00
Steven Allen ed4bd39dda
Merge pull request #965 from libp2p/fix/panic
Fix peer handler race
2020-06-05 10:45:03 -07:00
Steven Allen 34e67e019e Fix peer handler race
Alternative to #963. Instead of using atomics, this patch ensures that all state
changes are performed on the main thread. It also:

* Threads the context through explicitly to make sure fields changed by the main
thread are never read by the handler goroutines. This isn't strictly necessary
but it makes it easier to reason about.
* Uses a callback to signal "on done". There may be cleaner ways to do this (I
hate callbacks), but this nicely decouples the peer handler from the main loop.

fixes #963
2020-06-05 10:20:28 -07:00
Steven Allen 5bfaf4df24
Merge pull request #960 from libp2p/fix/obs-perf
optimize numInbound count
2020-06-04 15:08:01 -07:00
Steven Allen 5ae0888629 fix(id): document observation struct 2020-06-04 14:57:07 -07:00
Steven Allen a03403fa64 fix: optimize numInbound count
We call this _very_ frequently when computing our local addresses.
2020-06-04 14:55:17 -07:00