Commit Graph

241 Commits

Author SHA1 Message Date
Marten Seemann 263a1a6a7f move the go-libp2p-connmgr here 2022-01-17 18:44:37 +04:00
Marten Seemann 56643040e1
Merge pull request #1291 from libp2p/discovery
move go-libp2p-discovery here
2022-01-16 22:04:35 -08:00
Marten Seemann 4269c5f7b2 stop using go-libp2p-discovery 2022-01-16 15:32:30 +04:00
Marten Seemann 4280c73cae
use the netutil package that was moved to go-libp2p-testing (#1263) 2022-01-10 01:14:15 -08:00
Marten Seemann d5f4910af7 rename p2p/discovery/routing package, run go mod tidy 2022-01-09 22:17:04 +04:00
Marten Seemann 7c0be24a4c rename p2p/discovery/backoff package, run go mod tidy 2022-01-09 21:37:28 +04:00
Marten Seemann bfde26dd30
chore: update go-log to v2.5.0 (#1286) 2022-01-09 01:40:45 -08:00
Marten Seemann 0f0cc4e4a0 use the transport.Upgrader interface 2022-01-04 13:20:59 +04:00
Marten Seemann 161f1c73fd remove direct dependency on libp2p/go-addr-util 2022-01-03 12:47:46 +04:00
Marten Seemann 741348ec9c update import paths to use p2p/host/autonat 2021-12-22 13:26:20 +04:00
Marten Seemann e7ea19f358 remove goprocess from mock conn and link 2021-12-14 14:21:20 +04:00
Marten Seemann 2a15c304fa chore: update deps 2021-12-13 17:37:53 +04:00
Marten Seemann 56bcd81a3f use the new network.ConnStats 2021-12-13 17:26:07 +04:00
Marten Seemann a4e2a94e7b move the peerstoremanager to the host 2021-12-10 12:47:36 +04:00
Marten Seemann c31aa236fb chore: update go-libp2p-tls to v0.3.1 2021-11-24 18:17:37 +04:00
Marten Seemann a61e386c51 chore: update yamux and QUIC 2021-11-20 13:57:07 +04:00
Gus Eggert 7a35d0df97
feat: plumb through peerstore context changes (#1237) 2021-11-12 13:43:02 -05:00
Marten Seemann 72f0a64180 chore: update deps 2021-10-19 14:49:47 +02:00
Marten Seemann d01b892679 update go-libp2p-swarm to v0.7.0 2021-10-19 10:39:32 +02:00
Marten Seemann adb93ce704 chore: update zeroconf to v2.1.1 2021-10-05 21:58:27 +01:00
Marten Seemann 79a210072d
Merge pull request #1193 from libp2p/natmgr-remove-goprocess
remove goprocess from the NATManager
2021-09-29 13:47:44 +01:00
Marten Seemann 20f296f2e9 chore: update go-tcp-transport to v0.3.0 2021-09-27 13:30:40 +01:00
Marten Seemann 4028c3c578 remove goprocess from the NATManager 2021-09-25 15:15:35 +01:00
Marten Seemann 4975f0abe5 remove dependency on github.com/ipfs/go-detect-race 2021-09-25 14:29:26 +01:00
vyzo 22b62cfd65
autorelay support for circuitv2 relays (#1198)
* move host/relay to host/autorelay

* move autorelay wrapper host to package

* support v2 relays in autorelay

* test autorelay with both v1 and v2 relays

* fix test race

* go mod tidy examples/pubsub/chat

static checker complains; sigh.

* refactor reservation refresh loop

* merge background and refresh goroutines

* handle pushes synchronously from reservation refresh failures

* make connmanager tag a package level constant

* dont sleep to wait for identify, use IdentifyWait

* make relay protocol ids package-level constants

* add comment about v1 relays not having reservations

* use errgrp instead of WaitGroup with atomic int

* fix variable capture bug

* go get x/sync
2021-09-25 05:47:39 -07:00
Marten Seemann 29da01af70 update go-libp2p-core to v0.10.0 2021-09-17 18:50:15 +02:00
Steven Allen 2c69c99b23 fix: remove v1 go-log dep 2021-09-15 20:01:07 +02:00
Marten Seemann 3c25b386d9 merge branch 'hole-punching' 2021-09-08 18:23:13 +01:00
Marten Seemann 964880b872
Merge pull request #1174 from libp2p/circuitv2
move the circuit v2 code here
2021-09-07 14:24:30 +01:00
Marten Seemann 659ded50e1
Merge pull request #1128 from libp2p/quic-default-transport
make QUIC a default transport
2021-09-07 14:21:11 +01:00
Marten Seemann b25e0b1274 stop using jbenet/go-cienv 2021-09-05 19:12:58 +01:00
Marten Seemann 2d07a0d973 chore: update go-libp2p-autonat to v0.5.0 2021-08-30 10:57:52 +01:00
Marten Seemann e86c4ed31f make QUIC a default transport 2021-08-28 15:25:35 +01:00
web3-bot 0741d17496
sync: update CI config files (#1166) 2021-08-21 11:00:06 +00:00
Marten Seemann ec3c9cbf49
implement the new mDNS spec, move the old mDNS implementation (#1161)
* move the current mdns discovery implementation to discovery_legacy

* use libp2p/zeroconf for mDNS discovery

* rename the discovery package to mdns

* don't store the context

* use a wait group for clean shutdown of the mdns resolver

* add comment about port numbers

* move the mdns packages p2p/discovery
2021-08-18 09:15:56 -07:00
Marten Seemann 650a77b7ff update dependencies 2021-08-17 13:15:00 +02:00
Marten Seemann 366bdea5a4 chore: update deps 2021-07-28 14:28:57 +02:00
Marten Seemann 255eb5dfd8 update go-tcp-transport to v0.2.4 2021-07-16 18:37:13 +02:00
vyzo 7872bd5a44 p2p-circuit v2 (#125)
* v2 client scaffolding

* gomod: go-libp2p-core and go-libp2p-transport-upgrader feature dependencies

* Conn implements network.ConnStat

* add reservation stub

* utilities

* dial scaffolding and v1 compat dialing

* stream handling scaffolding and v1 incoming connection handling

* implement hop tagging

* export timeout variables

* v2 protobuf

* v2 client protocol implementation

* implement Reserve

* go get go-libp2p-swarm@feat/transient-conns

* implement client.New

* rework pb status codes

* client responds with UNEXPECTED_MESSAGE when it's actually an unexpected message

* relay scaffolding, reservation implementation

* implement relaying

* implement missing details

* add options for resources/limit

* gc idle conn counts

* fix clown shoes in cancellation check

* end to end relay test

* untag peers with expired reservations

* add time limit test

* better debug log for accepted conns

* add data limit test

* add v2-v1 compatibility tests

* godocs

* add WithACL relay option

* only return public relay addrs in reservation record

* remove the refresh restriction madness

* set default limit Data to 128K

* fix typo in AllowReserve godoc

* fix some small issues

- remove context from constructor
- remove stream handler when closing the host
- remove the awkward cancellation check from handleStream

* fix tests

* address review comments

- Add deadline for Reserve calls
- Add deadline for dials
- Add some comments for things that confuse aarsh.

* humor aarsh and add initializers for slices

* comment nitpicks

* fix bug in slice pre-allocations

* add deadline to connectV1

* make Relay.Close thread-safe

* untag peers with reservations when closing the relay

* gomod: get go-libp2p-asn-util

* add IP/ASN reservation constraints

* gomod: update deps

* fix e2e test

* increase default limit duration to 2min

* update protocol for vouched relay addrs; provide absolute expiration time instead of TTL

* update for reservation changes

* add voucher to the reservation pb

* TODO about reservation vouchers

* deduplicate protocol ID definitions between relay and client

* add reservation vouchers

* emit and consume reservation vouchers

* improve limit data test

* deduplicate concurrent relay dials to the samke peer

* improve dialer deduplication

* add a short timeout to dialing the relay in order to aid deduplication

* gomod: fix go1.16 madness

* spec compliance: don't include p2p-circuit in reservation addrs

* spec compliance: refuse reservation and connection attempts over relayed connections

* test shim: add empty file in test directory

* spec compliance: update protobuf

* spec compliance: use libp2p envelopes for reservation vouchers

* fix staticcheck

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2021-09-02 20:25:16 +01:00
Marten Seemann 0d8dd216b7 update go-tcp-transport to v0.2.3 and go-multiaddr to v0.3.3 2021-06-23 19:08:23 -07:00
Steven Allen dadeeeacac chore: update yamux to v0.5.4
This fixes a backwards incompatible change in a previous version.
2021-05-31 13:59:57 -07:00
Steven Allen 45cbfc1fdf chore(deps): update yamux 2021-05-10 13:01:48 -07:00
Steven Allen 4fa48655bb chore: update yamux 2021-05-04 21:43:48 -07:00
Steven Allen 7ab7b978b7 chore: update deps 2021-05-04 19:56:06 -07:00
Steven Allen 0a1044392a chore: update go-libp2p-peerstore
Fixes an issue where, when using peerstore.UpdateAddrs to set the "TTL"
to 0, the specified addresses might subsequently be returned from
peerstore.Addrs.
2021-04-29 20:39:51 -07:00
web3-bot 252fd257d4 set Go version to 1.15 and run go mod tidy 2021-04-29 21:35:37 +00:00
Steven Allen 2ad02f79b2 chore: update to go-log v2 2021-04-29 14:15:17 -07:00
Steven Allen 2a72777ef9 fix: address review feedback 2021-04-29 14:13:54 -07:00
Steven Allen 58b40c1ca8 chore: update deps
- update go-libp2p-swarm to fix some dialing issues.
- update go-netroute/go-sockaddr to fix some (theoretical) memory safety
  issues on windows.
2021-04-26 12:32:31 -07:00
vyzo b313b4af98 option for custom dns resolver 2021-04-12 12:42:56 +03:00
Steven Allen 6c0336634a chore: update deps
* update go-log & zap.
* update golang.org/x deps to pull in bug fixes.
* update autonat to simplify some logic
2021-03-18 17:02:28 -07:00
Steven Allen c39da30592 chore: update deps 2021-03-08 13:35:26 -08:00
Aarsh Shah 69916ed465
Emit event for User's NAT Type i.e. Hard NAT or Easy NAT (#1042)
* emit NAT device type
2021-02-19 15:14:03 +05:30
vyzo 8ea7ba4a88 gomod: update deps 2021-02-17 12:38:11 +02:00
Aarsh Shah c575ec40e1
Finish and Test the simultaneous connect problem in libp2p peers (#1041)
* Implement support for SimOpen.
2021-02-17 13:36:40 +05:30
Marten Seemann 7e81b7e411 update yamux and mplex, to actually use the context passed to OpenStream 2020-12-19 15:56:29 +07:00
Marten Seemann 34eb40850b use a context when opening streams 2020-12-19 12:05:19 +07: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 868f975b78 gomod: go-datastore dependency 2020-09-14 15:58:25 +03:00
Adin Schmahmann fb3179e617 chore: update go-multiaddr 2020-08-25 15:32:03 -04: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
Adin Schmahmann 6b509be0eb chore: update deps 2020-08-19 02:54:41 -04: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
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
Raúl Kripalani 985120b6f9
upgrade swarm; add ID() on mock conns and streams. (#970) 2020-06-16 19:45:28 +01: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
vyzo 2ca365a944 gomod: update go-libp2p-circuit 2020-06-04 14:42:53 +03:00
Aarsh Shah 1b36fd8697 first draft 2020-06-03 15:27:01 -07:00
vyzo ae7645ce85 gomod: update dependencies
go-libp2p-core@v0.5.7
go-libp2p-connmgr@v0.2.4 [indirect]
go-eventbus@v0.2.1
2020-06-03 22:44:35 +03:00
Aarsh Shah 3a1d20b748
Filter Interface Addresses (#936)
* Filter Host Addresses
2020-05-29 19:46:58 +05:30
Raúl Kripalani 7abe2e4c63
release v0.9.0: upgrade dependencies. (#937) 2020-05-19 13:23:26 +01:00
Aarsh Shah 887f2c40cf
implement connection gating at the top level (#881) 2020-05-15 17:31:03 +01:00
Aarsh Shah 973933ad7d
Remove race between ID, Push & Delta (#907)
* Solve races between Identify, Push and Delta.
2020-05-13 10:50:37 +05:30
Steven Allen c833e2c9fc
Merge pull request #876 from libp2p/dependabot/go_modules/github.com/libp2p/go-libp2p-peerstore-0.2.3
build(deps): bump github.com/libp2p/go-libp2p-peerstore from 0.2.2 to 0.2.3
2020-04-27 19:46:37 -07:00
Steven Allen 9cc9d5c201
Merge pull request #893 from libp2p/dependabot/go_modules/github.com/libp2p/go-stream-muxer-multistream-0.3.0
build(deps): bump github.com/libp2p/go-stream-muxer-multistream from 0.2.0 to 0.3.0
2020-04-27 19:46:13 -07:00
Steven Allen 6dc5d50fc5
Merge pull request #892 from libp2p/dependabot/go_modules/github.com/libp2p/go-conn-security-multistream-0.2.0
build(deps): bump github.com/libp2p/go-conn-security-multistream from 0.1.0 to 0.2.0
2020-04-27 19:45:51 -07:00
Steven Allen 34867586a3
Merge pull request #895 from libp2p/dependabot/go_modules/github.com/libp2p/go-ws-transport-0.3.1
build(deps): bump github.com/libp2p/go-ws-transport from 0.3.0 to 0.3.1
2020-04-27 19:45:42 -07:00
Steven Allen 75a12253a3
Merge pull request #896 from libp2p/dependabot/go_modules/github.com/libp2p/go-libp2p-discovery-0.4.0
build(deps): bump github.com/libp2p/go-libp2p-discovery from 0.3.0 to 0.4.0
2020-04-27 19:45:31 -07:00
dependabot-preview[bot] 408e4d1286
build(deps): bump github.com/libp2p/go-libp2p-circuit
Bumps [github.com/libp2p/go-libp2p-circuit](https://github.com/libp2p/go-libp2p-circuit) from 0.2.1 to 0.2.2.
- [Release notes](https://github.com/libp2p/go-libp2p-circuit/releases)
- [Commits](https://github.com/libp2p/go-libp2p-circuit/compare/v0.2.1...v0.2.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-27 11:27:49 +00:00
dependabot-preview[bot] a276aade96
build(deps): bump github.com/libp2p/go-libp2p-discovery
Bumps [github.com/libp2p/go-libp2p-discovery](https://github.com/libp2p/go-libp2p-discovery) from 0.3.0 to 0.4.0.
- [Release notes](https://github.com/libp2p/go-libp2p-discovery/releases)
- [Commits](https://github.com/libp2p/go-libp2p-discovery/compare/v0.3.0...v0.4.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-25 03:12:09 +00:00
Steven Allen af58b8095d
Merge pull request #898 from libp2p/fix/set-protocols-race
fix: refactor logic for identifying connections
2020-04-24 20:08:24 -07:00
Steven Allen bd040ba050 fix: refactor logic for identifying connections
0. NEVER call `peerstore.SetProtocols(p)` (clear the protocol set). Given the
   new identify events, if someone looked in the peerstore at the wrong time, they
   could decide that the peer no longer speaks some protocol.
1. Reliably wait for identify before trying to open a stream. The old logic was
   _really_ racy.
2. Avoids potentially calling identify on the same connection multiple times.
3. Calls identify as early as possible. Previously, we'd invoke identify on
   inbound connections using an event that was only invoked _after_ all `Connected`
   event handlers completed. Now we invoke identify from a `Connected` handler.
2020-04-24 19:05:22 -07:00
dependabot-preview[bot] c1d75c13d1
build(deps): bump github.com/libp2p/go-ws-transport from 0.3.0 to 0.3.1
Bumps [github.com/libp2p/go-ws-transport](https://github.com/libp2p/go-ws-transport) from 0.3.0 to 0.3.1.
- [Release notes](https://github.com/libp2p/go-ws-transport/releases)
- [Commits](https://github.com/libp2p/go-ws-transport/compare/v0.3.0...v0.3.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-23 11:22:13 +00:00
dependabot-preview[bot] 0dd75aff91
build(deps): bump github.com/libp2p/go-stream-muxer-multistream
Bumps [github.com/libp2p/go-stream-muxer-multistream](https://github.com/libp2p/go-stream-muxer-multistream) from 0.2.0 to 0.3.0.
- [Release notes](https://github.com/libp2p/go-stream-muxer-multistream/releases)
- [Commits](https://github.com/libp2p/go-stream-muxer-multistream/compare/v0.2.0...v0.3.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-22 11:20:59 +00:00
dependabot-preview[bot] dde9d47473
build(deps): bump github.com/libp2p/go-conn-security-multistream
Bumps [github.com/libp2p/go-conn-security-multistream](https://github.com/libp2p/go-conn-security-multistream) from 0.1.0 to 0.2.0.
- [Release notes](https://github.com/libp2p/go-conn-security-multistream/releases)
- [Commits](https://github.com/libp2p/go-conn-security-multistream/compare/v0.1.0...v0.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-22 11:20:36 +00:00
dependabot-preview[bot] f650f4b3df
build(deps): bump github.com/ipfs/go-log from 1.0.3 to 1.0.4
Bumps [github.com/ipfs/go-log](https://github.com/ipfs/go-log) from 1.0.3 to 1.0.4.
- [Release notes](https://github.com/ipfs/go-log/releases)
- [Commits](https://github.com/ipfs/go-log/compare/v1.0.3...v1.0.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-21 17:21:30 +00:00
Steven Allen eb76a02251 feat: support TLS by default
But don't make it the default per https://github.com/libp2p/go-libp2p/pull/710#pullrequestreview-382182995.
2020-04-13 11:16:09 -07:00
dependabot-preview[bot] 70b242b685
build(deps): bump github.com/libp2p/go-libp2p-autonat
Bumps [github.com/libp2p/go-libp2p-autonat](https://github.com/libp2p/go-libp2p-autonat) from 0.2.1 to 0.2.2.
- [Release notes](https://github.com/libp2p/go-libp2p-autonat/releases)
- [Commits](https://github.com/libp2p/go-libp2p-autonat/compare/v0.2.1...v0.2.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-09 11:20:22 +00:00
dependabot-preview[bot] a9e9654f0a
build(deps): bump github.com/libp2p/go-libp2p-peerstore
Bumps [github.com/libp2p/go-libp2p-peerstore](https://github.com/libp2p/go-libp2p-peerstore) from 0.2.2 to 0.2.3.
- [Release notes](https://github.com/libp2p/go-libp2p-peerstore/releases)
- [Commits](https://github.com/libp2p/go-libp2p-peerstore/compare/v0.2.2...v0.2.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-07 11:20:37 +00:00
dependabot-preview[bot] 8ffd6a94e2
build(deps): bump github.com/stretchr/testify from 1.4.0 to 1.5.1
Bumps [github.com/stretchr/testify](https://github.com/stretchr/testify) from 1.4.0 to 1.5.1.
- [Release notes](https://github.com/stretchr/testify/releases)
- [Commits](https://github.com/stretchr/testify/compare/v1.4.0...v1.5.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-06 11:22:03 +00:00
Aarsh Shah 615f125342
Remove goprocess from Host (#865)
* remove goprocess from Host
2020-04-06 11:34:45 +05:30
Steven Allen d14fdba1ef chore: update deps again
One final time.
2020-04-02 23:11:50 -07:00
Steven Allen 79f13c024f chore: update the rest of the deps 2020-04-02 17:04:28 -07:00
Will Scott ec2907ed95
disable write coalescing 2020-04-02 16:42:40 -07:00
dependabot-preview[bot] f8e12fcb8e
build(deps): bump github.com/libp2p/go-libp2p-peerstore
Bumps [github.com/libp2p/go-libp2p-peerstore](https://github.com/libp2p/go-libp2p-peerstore) from 0.2.1 to 0.2.2.
- [Release notes](https://github.com/libp2p/go-libp2p-peerstore/releases)
- [Commits](https://github.com/libp2p/go-libp2p-peerstore/compare/v0.2.1...v0.2.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-30 11:20:22 +00:00
dependabot-preview[bot] 82d957e31d
build(deps): bump github.com/libp2p/go-libp2p-yamux from 0.2.5 to 0.2.6
Bumps [github.com/libp2p/go-libp2p-yamux](https://github.com/libp2p/go-libp2p-yamux) from 0.2.5 to 0.2.6.
- [Release notes](https://github.com/libp2p/go-libp2p-yamux/releases)
- [Commits](https://github.com/libp2p/go-libp2p-yamux/compare/v0.2.5...v0.2.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-27 11:21:34 +00:00
Steven Allen 31e2e45f7f chore: update deps
* Update logging to fix logging on windows.
* Update autonat to improve filtering of potential AutoNAT peers.
2020-03-25 12:12:32 -07:00
Steven Allen aa30b1d124 fix: update goprocess to fix a test race 2020-03-24 14:23:42 -07:00
Steven Allen 1ce9b9980a chore(dep): update go-libp2p-peerstore
fixes psmem.Close()
2020-03-23 14:27:55 -07:00