Commit Graph

45 Commits

Author SHA1 Message Date
Adin Schmahmann
5a47a90938 feat(tcpreuse): add options for sharing TCP listeners amongst TCP, WS and WSS transports (#2984)
Allows the same socket to be shared amongst TCP,WS,WSS transports.

---------

Co-authored-by: sukun <sukunrt@gmail.com>
Co-authored-by: Marco Munizaga <git@marcopolo.io>
2024-11-04 09:41:32 -08:00
Marco Munizaga
e8b6685edb fix: swarm: refactor address resolution (#2990)
* Remove unused resolver in basic host

* Refactor Swarm.resolveAddrs

Refactors how DNS Address resolution works.

* lint

* Move MultiaddrDNSResolver interface to core

* Reserve output space for addresses left to resolve

* feat: core/transport: Add SkipResolver interface (#2989)

* Rebase on top of resolveAddrs refactor

* Add comments

* Sanitize address inputs when returning a reservation message (#3006)
2024-10-16 12:20:21 -07:00
Marco Munizaga
65bc28b80f fix: QUIC/Webtransport Transports now will prefer their owned listeners for dialing out (#2936) 2024-08-28 13:16:39 -07:00
Marco Munizaga
6c12e2237a ci: Out of the tarpit (#2923)
* Lint fixes

* Use latest go version for go-check

Fixes nil pointer issue in staticcheck

* Add test_analysis helper script

* Use custom go-test-template

* Add some tests to the test_analysis script

* Always upload test_results db

* Attempt to fix test on windows

* Better if statement

* Try to fix flaky test

* Disable caching setup-go on Windows

* Better if statement

* Tweak

* Always upload summary and artifact

* Close db

* No extra newline
2024-08-20 11:13:32 -07:00
sukun
8a11b7c8e4 basic_host: close swarm on Close (#2916)
Using the `BasicHost` constructor transfers the ownership of the swarm.
This is similar to how using `libp2p.New` transfers the ownership of
user provided config options like `ResourceManager`, all of which are
closed on `host.Close`
2024-08-15 18:18:35 +05:30
Marco Munizaga
db41da3b26 feat: WebRTC reuse QUIC conn (#2889)
* feat: WebRTC reuse QUIC conn

* Fix transport constructor in test

* Move provide to where the transports are
2024-08-01 07:36:46 -07:00
sukun
cb81b3e48c webrtc: remove experimental tag, enable by default (#2887) 2024-07-31 16:57:32 +05:30
sukun
f80d18f24c config: fix AddrFactory for AutoNAT (#2868)
---------

Co-authored-by: Marco Munizaga <git@marcopolo.io>
2024-07-31 16:56:32 +05:30
sukun
87c435512c autonatv2: implement autonatv2 spec (#2469) 2024-06-21 14:55:22 +05:30
sukun
9f854e2a7c config: fix Insecure security constructor (#2810) 2024-05-23 19:52:22 +05:30
Marco Munizaga
62ebf06cb6 rcmgr: Backwards compatibility if you wrap default impl (#2805) 2024-05-23 19:50:31 +05:30
sukun
6861cecb3c identify: refactor observed address manager to do address mapping at thin waist(IP+TCP/UDP) layer (#2793)
* refactor observed address manager to do mapping at thin waist layer

---------

Co-authored-by: Marco Munizaga <git@marcopolo.io>

* restrict output message size, add top level option to disable address
discovery

* Comment nit

* Increase maxPeerRecordSize

---------

Co-authored-by: Marco Munizaga <git@marcopolo.io>
2024-05-15 20:17:25 -07:00
Marco Munizaga
86a6720a62 autonat: Clean up after close (#2749)
* Clean up after autonat

* Close
2024-03-27 20:14:32 -07:00
Marten Seemann
9d149fa3cb use Fx to start and stop the host, swarm, autorelay and quicreuse (#2118)
* config: refactor AutoNAT construction into separate method

* config: use a lifecycle hook to start listening on swarm addresses

* use Fx to construct the host

* add a test for constructing a routed host

* use Fx hooks to start the host

* config: use Fx lifecycle hooks to start AutoRelay and for PeerRouting

* basichost: don't close the swarm

The swarm is not constructed by the basic host, thus is shouldn't be
closed by it.

* config: use Fx hook to close the quicreuse connection manager

* test for goroutine leaks when starting/stopping fx

To do this, I've had to move a few leaky tests into a separate package.
I've filed a bug for the AutoNAT issue (#2743) but the "error on
startup" issue is going to require some pretty invasive changes (we need
to construct _then_ start).

* go fmt

* Ignore one more top function

* Typo

* Ignore any not top

---------

Co-authored-by: Sukun <sukunrt@gmail.com>
Co-authored-by: Steven Allen <steven@stebalien.com>
Co-authored-by: Marco Munizaga <git@marcopolo.io>
2024-03-21 10:18:34 -07:00
dozyio
e3b0a86e86 chore: testify fix got, expected transpositions (#2666)
* chore: testify lint fixes

* chore: revert t.error replacements

* chore: revert errNotWebSocketAddress

---------

Co-authored-by: Sukun <sukunrt@gmail.com>
2024-02-14 14:35:19 +05:30
Marco Munizaga
9edef5a939 quic: drop support for QUIC draft-29 (#2487) 2023-08-15 18:15:02 -07:00
Marten Seemann
b456165430 webtransport: only add cert hashes if we already started listening (#2271) 2023-05-05 11:09:12 -07:00
Marco Munizaga
3b3f8baf93 correctly handle WebTransport addresses without certhashes (#2239)
* Add helpers to transform webtransport multiaddrs in AddrsFactory

* Remove unused line

* PR nits

* Add wrapper around AddrsFactory to fill in missing certhash

* PR nits

* Handle WebTransport multiaddrs in observed addr manager

* Remove unneccessary change

* Remove unused func

* Use SplitLast

* Add comment

* Clone multiaddr before splitting last

* Revert "Clone multiaddr before splitting last"

This reverts commit f168a8e8b6.

* Wait for certmanager to be instantiated

* Copy addrs slice before modifying

* Fix stalled test
2023-04-05 23:45:54 -07: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
Marten Seemann
b90b74f3a5 check the options passed to transport constructor match 2022-11-10 12:42:10 +00:00
Marten Seemann
7d0b6ba933 refactor the transport constructor code to remove TransportWithOptions 2022-11-10 10:09:48 +00:00
Marten Seemann
cbe50095f3 config: use fx to construct security transports 2022-11-10 10:09:45 +00:00
Marten Seemann
8df365bf45 add default listen addresses for QUIC (#1615) 2022-08-22 08:06:10 -07:00
Marten Seemann
4623690009 switch from github.com/libp2p/go-libp2p-core to core 2022-08-17 17:13:02 +03:00
Marten Seemann
2b69671cb9 remove flaky TestTcpSimultaneousConnect (#1425) 2022-04-22 09:19:32 -07:00
Marten Seemann
dfc3a3f24a switch from github.com/libp2p/go-tcp-transport to p2p/transport/tcp 2022-04-22 14:48:25 +01:00
Marten Seemann
4268804809 make go-libp2p build when using the resource manager dependencies 2022-01-18 12:25:31 +04:00
Marten Seemann
0f0cc4e4a0 use the transport.Upgrader interface 2022-01-04 13:20:59 +04:00
Marten Seemann
d01b892679 update go-libp2p-swarm to v0.7.0 2021-10-19 10:39:32 +02:00
Marten Seemann
b7bee3855c remove the context from the libp2p and from the Host contructor 2021-09-18 14:06:56 +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
Steven Allen
46b58740de fix: fix connection gater in transport constructor 2020-05-20 11:09:00 -07:00
Steven Allen
1359013f39 fix: set the private key when constructing the autonat service
Otherwise, it the node fails to build.
2020-03-24 16:49:24 -07:00
Raúl Kripalani
d87f89314c Consolidate abstractions and core types into go-libp2p-core (#601) 2019-05-26 22:55:46 +01:00
Steven Allen
262b35f272 chore: improve nil option tests 2019-04-17 18:05:08 -07:00
Steven Allen
cff9cb577c constructor: allow nil options
This can make it significantly easier to configure libp2p with optional options.
2019-04-17 17:08:50 -07:00
vyzo
0600392e23 enable relay by default in New 2018-09-28 11:30:45 +03:00
Steven Allen
a36d383413 add tests for NoTransports and NoListen 2018-08-21 14:40:18 -07:00
Abhishek Upperwal
9e952be412 modified regex for ipv6 2018-07-28 02:48:09 +05:30
Abhishek Upperwal
ecf27b599f strict DefaultListenAddrs test w/ regex 2018-07-28 02:08:45 +05:30
Abhishek Upperwal
6372f928d4 Correct behaviour test for DefaultListenAddrs 2018-07-27 02:26:29 +05:30
Abhishek Upperwal
29af134a71 corrected transport init 2018-07-26 01:14:09 +05:30
Abhishek Upperwal
fb4019575d Added test for DefaultListenAddrs 2018-07-26 01:08:20 +05:30
Steven Allen
41c6834850 refactor for transport changes
Also, make the libp2p constructor fully useful. There should now be no need to
manually construct a swarm/host.
2018-06-04 21:22:24 -07:00
Jamie Steiner
acd4dd9a89 added NAT traversal option and constructor test 2018-03-04 10:35:49 +02:00