Commit Graph

5130 Commits

Author SHA1 Message Date
Marten Seemann cefbf97aa6
webtransport: add PSK to constructor, and fail if it is used (#1929)
That way, it won't be possible to construct a host with a PSK
when WebTransport is enabled. This is desireable since WebTransport doesn't
support private network (same as QUIC).
2022-12-05 12:44:15 -08:00
Oleg 2cc4de5126
use a different set of default transports when PSK is enabled (#1921)
Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>

Signed-off-by: Oleg <97077423+RobotSail@users.noreply.github.com>
2022-12-02 20:18:26 +13:00
Marco Munizaga 1c8eaabfd3
transport.Listener,quic: Support multiple QUIC versions with the same Listener. Only return a single multiaddr per listener. (#1923)
* Revert "transport.Listener  returns a list of multiaddrs"

This reverts commit 8962b2ae33.

* Support multiple QUIC versions on the same listener

* No long running accept loop

* Don't use a goroutine

* PR comments
2022-12-01 14:06:13 -08:00
Marco Munizaga dc7f64e480
chore: update webtransport-go to get fix (#1924) 2022-11-29 11:53:25 -08:00
Marten Seemann f73205096f
quic / webtransport: make it possible to listen on the same address / port (#1905)
* quic: add an integration test for QUIC version support

* quic: refactor the stateless reset test

* quic: simplify the interface of the noreuseConn

DecreaseCount now closes the underlying UDP conn, so that callers don't
need to pay attention if they're dealing with a reuseConn or a
noreuseConn.

* implement a quicreuse to manage QUIC connections

* quicreuse: introduce options

* config: construct the quicreuse.ConnManager using fx

* webtransport: use the quicreuse

* add integration test for QUIC and WebTranport sharing the same UDP addr

* Handle errors in accept loop goroutine

* Add comment

* Remove todo

* Rename mutexes

* Cleanup extra close

* Only log on err

* Use webtransport-go 0.4.0

* Fix expected error

Co-authored-by: Marco Munizaga <git@marcopolo.io>
2022-11-28 15:55:38 -08:00
Marco Munizaga 9fad5b06dd
autorelay: fix flaky TestReconnectToStaticRelays (#1903)
* Block on events to make this test less flaky

* Check against delta rather than just pull from chan

* Don't check relay count twice

* Use deltas rather than eventuall numRelays

* Nits
2022-11-22 15:24:37 -07:00
Marco Munizaga 9c9122df67
swarm / rcmgr: synchronize the concurrent outbound dials with limits (#1898)
* Synchronize the concurrent outbound dials with limits

* Add comment
2022-11-22 15:24:22 -07:00
Marten Seemann 6a7141e2ad
add QUIC v1 addresses to the default listen addresses (#1914) 2022-11-22 14:53:39 -07:00
Marten Seemann 26a5edf765
webtransport: update webtransport-go to v0.3.0 (#1895) 2022-11-21 18:59:45 -08:00
Marten Seemann 683bc67a37
tls: fix flaky TestHandshakeConnectionCancellations test (#1896) 2022-11-21 18:45:49 -08:00
Marten Seemann 23bef30d34
holepunch: disable the resource manager in tests (#1897) 2022-11-21 18:37:48 -08:00
Marten Seemann 14ca991a41
transports: expose the name of the transport in the ConnectionState (#1911) 2022-11-21 17:34:02 -08:00
Marten Seemann ee5def5bcb
Merge pull request #1912 from libp2p/security-protocol-order
respect the user's security protocol preference order
2022-11-22 11:55:41 +13:00
Marten Seemann 75a0d4288b
circuitv2: disable the resource manager in tests (#1899) 2022-11-21 13:54:14 -08:00
Marten Seemann d72d35c025 add an integration test for the ordering of security protocols 2022-11-22 10:46:32 +13:00
Marten Seemann 1ecf340f51 config: respect the user's security protocol preference order 2022-11-22 10:46:32 +13:00
Marten Seemann 6d3926394d
Merge pull request #1907 from libp2p/expose-security
expose the security protocol on the ConnectionState
2022-11-22 10:45:22 +13:00
Marten Seemann 83b4e3cf9c expose the security protocol on the ConnectionState 2022-11-20 18:36:01 +13:00
Marten Seemann e2a246d5b6 upgrader: absorb SSMuxer into the upgrader 2022-11-20 18:30:00 +13:00
Marten Seemann 9e136c2531 swarm: move the additional peer ID check to the swarm
Only a subset of the transports use the ugprader (which uses the
SSMuxer). It's better to perform this check for every transport.
2022-11-20 14:29:49 +13:00
Marten Seemann 8dea194261 core/network: rename ConnectionState.NextProto to StreamMultiplexer 2022-11-20 13:23:45 +13:00
Marco Munizaga 86d5a5643e
Update go-netroute so that we get the correct priority of routes (#1902) 2022-11-18 13:10:32 -08:00
Marco Munizaga 8e90ed8c2c
fix: autorelay: treat static relays as just another peer source (#1875)
* Treat static relays as just another peer source

* Actually call the options in WithStaticRelays

* Increase timeout for CI
2022-11-17 13:09:36 -08:00
Marco Munizaga 0b4867c117
feat: quic,webtransport: enable both quic-draft29 and quic-v1 addrs on quic. only quic-v1 on webtransport (#1881)
* transport.Listener  returns a list of multiaddrs

* Support both QUIC versions in QUIC transport

* Support only QUIC v1 in webtransport

* Update dialMatcher

* Update tests

* Only use draft 29 when dialing if the server is a draft 29 server

* Removes QUIC draft 29 addrs if we have a QUIC v1 addr

* Lint fix

* Add changes to deterministic certhashes after rebase

* Update p2p/transport/quic/options.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* Update p2p/transport/quic/listener.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* Update p2p/transport/quic/quic_multiaddr.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* Stylize QUIC correctly

* Update doc around ListenClose

* Preallocate a bit extra to avoid paying for an allocation later

* Keep a list of multiaddrs, then join

* PR nits

* Close transport or listener just once

* Update go-multiaddr

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2022-11-17 10:01:19 -08:00
Dennis Trautwein f4ddf5933a
holepunch: add multiaddress filter (#1839)
* feat: add holepunch address filter option

* fix: exit early if all addresses were filtered out

* incorporate PR feedback

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

* remove: holepunch default filter

* fix: hole punch failing test

* holepunch: fix race condition in test when adding holepunch service

* improve holepunch filter interface comments

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2022-11-17 02:58:46 -08:00
Marten Seemann 84ded7d47a
README: remove broken links from table of contents (#1893) 2022-11-16 18:55:10 -08:00
Marten Seemann 8a05c48665
quic: update quic-go to v0.31.0 (#1882) 2022-11-16 16:26:31 -08:00
Marten Seemann da9005d783
Merge pull request #1887 from libp2p/muxer-integration-test
add an integration test for muxer selection
2022-11-16 18:23:40 -06:00
Marten Seemann d813808745 upgrader: pass values through a channel instead of sharing state 2022-11-17 12:42:54 +13:00
Michele Mastrogiovanni 7357a00623
core/network: fix typo 2022-11-16 15:24:05 -08:00
Marten Seemann 4b74c6553f add an integration test for muxer selection 2022-11-17 12:03:28 +13:00
Marten Seemann 9a5faceca1 upgrader: expose the negotiated stream muxer via the ConnState 2022-11-17 12:03:28 +13:00
Marten Seemann 133f002117 config: supply the host ID to fx
This is needed to construct the insecure transport.
2022-11-17 12:03:28 +13:00
Marten Seemann 090a084aea
Merge pull request #1888 from libp2p/early-muxer-negotiation-preferences
tls / noise: prefer the client's muxer preferences
2022-11-16 17:02:11 -06:00
Marten Seemann 0957a9d212 noise: prefer the client's muxer preference 2022-11-17 11:10:50 +13:00
Marten Seemann c1e0c7b757 tls: prefer the client's muxer preference 2022-11-17 11:10:49 +13:00
Marten Seemann 04a43b13a9
upgrader: absorb the muxer_multistream.Transport into the upgrader (#1885) 2022-11-16 14:09:21 -08:00
Neel Virdy d8d2efafdd
Apply service peer default (#1878) 2022-11-15 14:56:58 -08:00
Marco Munizaga a0432e70af
webtransport: use deterministic TLS certificates (#1833)
* Use deterministic TLS certificates for webtransport

* Update test to work with buckets

* Make sure to overlap and use a random offset

* Fixup mistaken change in other test

* Add QuickCheck tests for cert behavior

* Lint fix

* Add more tests

* Add webtransport integration test

* Use same key

* Actually offset by at least clockSkew

* Use seeded key for certs after reboot test

* PR comments

* Remove debug code

* Fix calculation for cert having been valid

Fixes the logic that a cert has been valid for a clockSkew by
subtracting the clockSkew from the start time rather than incorporating
it into the offset. The offset should be used to shift the buckets.

* Update comment

* Lint fix

* Update TestGetCurrentBucketStartTimeIsWithinBounds to include clockSkew calculation

* Rebase fixes
2022-11-14 07:44:25 -08:00
Marten Seemann c48e78f073
remove deprecated StaticRelays option (#1868) 2022-11-11 00:23:28 -08:00
Marten Seemann bdb840fba2
autorelay: remove the default static relay option (#1867)
These relays were decomissioned recently.
2022-11-10 23:30:49 -08:00
Marten Seemann 8a43c6b1ae
core/protocol: remove deprecated Negotiator.NegotiateLazy (#1869) 2022-11-10 23:30:13 -08:00
Marten Seemann e538b40615
Merge pull request #1858 from libp2p/fx
config: use fx dependency injection to construct transports
2022-11-10 18:50:19 +00:00
Marten Seemann b90b74f3a5 check the options passed to transport constructor match 2022-11-10 12:42:10 +00:00
Marten Seemann d0704fdc7e config: forward fx output to the logger 2022-11-10 10:09:50 +00:00
Marten Seemann 7d0b6ba933 refactor the transport constructor code to remove TransportWithOptions 2022-11-10 10:09:48 +00:00
Marten Seemann 479dbb93c4 restrict the Muxer option to already constructed network.Multiplexers 2022-11-10 10:09:47 +00:00
Marten Seemann cbe50095f3 config: use fx to construct security transports 2022-11-10 10:09:45 +00:00
Marten Seemann f7c8c0247b config: use fx to construct the transport upgrader 2022-11-10 10:09:38 +00:00
Marten Seemann 30e59560d3 upgrader: simplify the constructor 2022-11-10 10:07:17 +00:00