350 Commits

Author SHA1 Message Date
Marco Munizaga 418cf8ff40 refactor(webtransport): Use keygen package for deterministic ecdsa key
generation.
2026-03-17 12:06:33 -07:00
sukun 7198ad347f webrtc: upgrade pion deps (#3469)
Co-authored-by: Alex Wu <dindinw@users.noreply.github.com>
2026-02-27 16:25:49 +05:30
Marco Munizaga 92c6f0eac2 update go-netroute dependency
Co-Authored-By: gammazero <11790789+gammazero@users.noreply.github.com>
2026-01-26 17:22:51 -05:00
Marten Seemann dd26469c52 update webtransport-go to v0.10.0 and quic-go to v0.59.0 (#3452)f
Co-authored-by: Marco Munizaga <git@marcopolo.io>
2026-01-22 14:28:08 -05:00
Marten Seemann 2bed14540f update quic-go to v0.58.0 2026-01-08 11:02:44 -08:00
Marco Munizaga 6c4273f47e update simnet dependency 2026-01-07 11:25:11 -08:00
sukun f96852745c chore: update quic-go to v0.57.1 (#3439) 2025-12-12 01:36:21 +05:30
sukun aefe38980c chore: update quic-go to v0.56.0 (#3425) 2025-11-13 11:08:46 -08:00
Marco Munizaga fc35662e54 quicreuse: update libp2p/go-netroute (#3405) 2025-10-07 13:52:41 +05:30
Marco Munizaga bcf636ebcc chore: update quic-go to v0.55.0 2025-10-06 11:28:04 -07:00
Marco Munizaga da810a1764 feat: Migrate to log/slog (#3364) 2025-08-25 14:00:01 -07:00
Marco Munizaga 9f5945e189 feat(simlibp2p): Simulated libp2p Networks (#3262) 2025-08-15 09:44:03 -07:00
sukun f6c14a215b chore: upgrade quic-go to v0.54.0 (#3351) 2025-07-31 11:46:38 -07:00
sukun 7b7c3ed4ce quic: upgrade quic-go to v0.53 (#3323) 2025-07-02 23:24:16 +02:00
sukun 150f67b07c chore: update deps (#3312) 2025-06-17 18:46:23 +05:30
sukun b82a39cb89 transport: rate limit new connections (#3283)
This rate limits new connections to prevent DoS attacks. 

For effectively rate limiting QUIC connections, we now gate QUIC connection attempts before the handshake, so that we don't spend compute on handshakes for connections that will eventually be cancelled. 

We can only set a single ConnContext per quic-go Transport, as there's only 1 listener per quic-go Transport. So we cannot set a different ConnContext for listeners on the same address. 

As we're now gating QUIC connections before the handshake, we use source address verification to ensure that spoofed IPs cannot DoS new connections from a particular IP. This is done by ensuring that some of the connection attempts always verify the source address. We get DoS protection at the expense of increased latency of source address verification.
2025-06-05 02:16:32 +05:30
Guillaume Michel 31c8c83308 chore: Revert "go-clock migration" (#3303) 2025-05-30 17:57:47 +05:30
guillaumemichel ea3a161aa8 bump go-flow-metrics 2025-05-22 10:10:24 +02:00
guillaumemichel dd80260b70 go-clock migration 2025-05-21 10:07:42 +02:00
sukun 50d714c94c identify: rate limit id push protocol (#3266)
The rate limits id pushes from peers to one every five second with an allowed burst of 10 pushes. This should be enough for all but malfunctioning and malicious peers.

We can use the exact same code for autonat, autonatv2, circuit v2, etc.

Introducing limits to identify separately to get some feedback for #3265. For this PR, I'd like to ignore issues regarding where should this piece of code go, and focus on how specifically it should behave. See the long comment in rateLimiter.allow for example. 

Part of: #3265
2025-05-01 22:32:38 +05:30
sukun 803505d734 webrtc: support receiving 256kB messages (#3255)
In experiments with js we've found that increasing the message size
increases throughput. See: libp2p/specs#628 (comment)
for details. 

This changes the protobuf reader for the stream to read 256kB messages.
This also forces a change to the connection SCTP read buffer to be
increased to about 2.5 MB, to support 1 message being buffered for 10
streams.

This isn't enough to support larger messages. We most likely need to
change the inferred SDP of the server to use 256kB maxMessageSize, and
need some backwards compatible mechanism in the handshake to opt in to
large messages. See: libp2p/specs#628 for
details
2025-04-01 16:18:42 +05:30
sukun 74e6e2c9ed peerstore: remove leveldb tests (#3260)
This also removes the go-leveldb-datastore dependency. There's no
reason to test with levelDB. This code should work with any compliant
go-datastore.

Bumps go-datastore to latest as it removes the go-process dependency.

Fixes: #3250
2025-04-01 13:35:31 +05:30
sukun 61f03f45a4 peerstore: remove unused badger tests (#3252)
We were testing with both badger and LevelDB. Removing badger as just testing with LevelDB should be enough. Not sure if we need LevelDB either, but for now just removing badger as it is any way unused.

See: #3250
2025-03-26 13:50:53 +05:30
sukun 9a2a542a80 connmgr: remove WithEmergencyTrim (#3217)
This option, `WithEmergencyTrim`, intended to trim connections where there
was a memory emergency. The API was very confusing. To use it correctly 
you had to use the `WithEmergencyTrim` option and then do

`watchdog.HeapDriven(...)` to run the goroutine that would trigger this 
in time of a memory emergency. 

As there's no correct usage of this
API(https://github.com/search?q=WithEmergencyTrim&type=code&p=1), 
I'm removing this and exporting a ForceTrim method that users can call 
using any watchdog style memory tracking implementation.
2025-03-21 17:01:35 +05:30
sukun e9a2fa57f5 chore: update deps for v0.41 (#3209) 2025-02-25 08:54:18 -08:00
Marco Munizaga 785181fbb8 chore: Update go-multiaddr to v0.15 (#3145) 2025-02-24 14:21:47 -08:00
Marco Munizaga 90bb5efc7e chore: update quic-go to v0.50.0 (#3204) 2025-02-22 10:31:30 -08:00
Marco Munizaga 928252c319 Merge branch 'master' into marco/bring-go-nat-home 2025-02-21 20:23:09 -08:00
Marco Munizaga 3c079e6363 refactor(nat): make changes to internal nat library 2025-02-18 13:39:31 -08:00
sukun 5f9b8f4239 chore: bump deps for v0.40.0 (#3191) 2025-02-15 18:13:55 +05:30
sukun 02ab795c92 Implement error codes spec (#2927) 2025-02-09 21:39:18 +05:30
Alex Potsides 4957d357e0 chore: update pion/ice to v4 (#3175) 2025-02-06 23:56:53 +05:30
Marco Munizaga b9383b9c31 chore: update dependencies (#3173) 2025-02-05 16:22:09 -08:00
Marco Munizaga fde0e3a487 Update quic-go to v0.49.0 (#3153) 2025-01-24 11:03:26 -08:00
Yuttakhan B. 8f6d98d74c webrtc: upgrade pion/webrtc to v4 (#3098)
Co-authored-by: sukun <sukunrt@gmail.com>
2024-12-25 13:17:51 +00:00
Marco Munizaga 88ae97914e chore: Release v0.38.0 (#3106) 2024-12-18 11:22:30 -08:00
sukun f421202456 chore: bump go-multiaddr-dns (#3066) 2024-11-26 20:25:11 +05:30
Marco Munizaga 23b4283149 chore: bump quic-go to v0.48.2 (#3064)
Co-authored-by: sukun <sukunrt@gmail.com>
2024-11-26 19:41:55 +05:30
Marco Munizaga 7b6cc6b8b2 chore: update go-multistream to v0.6.0 (#3041)
Brings from go-multistream that lets us wait for a handshake to finish before closing the stream.
2024-11-18 14:38:22 -08:00
Marco Munizaga f120c6d66a chore: update quic-go to v0.48.1 (#3016) 2024-10-22 09:10:17 -07:00
Marco Munizaga ed0d8c9671 chore: bump deps in preparation for v0.37.0 (#3011)
* chore: bump deps

* chore: bump deps in test-plans

* Downgrade quic-go to v0.47.0 while we update WebTransport

* Fork webtransport-go

This lets us update quic-go to v0.48.0

* Revert "Fork webtransport-go"

This reverts commit fddad1c95b.

* Revert "Downgrade quic-go to v0.47.0 while we update WebTransport"

This reverts commit 094221dddb.

* Update webtransport-go

* Update webtransport-go usage

* Update go generate
2024-10-18 10:43:41 -07:00
Marco Munizaga fa09c6c99b chore: update quic-go to v0.47.0 (#2998) 2024-10-09 12:24:18 +05:30
Marco Munizaga 222a908783 chore: update go-multiaddr-dns to v0.4.0 (#2994) 2024-10-03 21:58:39 -07:00
sukun fda0ecaa58 webrtc: close connection when remote closes (#2914) 2024-08-15 21:23:19 +05:30
sukun e2e0d2917f chore: update pion/sctp (#2906) 2024-08-04 19:54:23 +05:30
Marco Munizaga 5ec59646e9 Chore: bump deps (#2902)
* Chore: bump deps

* Mod tidy test-plans

* Mod tidy
2024-08-01 18:21:43 -07:00
sukun 475cb47cae quic: add support for quic-go metrics (#2823) 2024-07-31 18:03:31 +05:30
Marco Munizaga d84736f704 feat: libp2phttp /http-path (#2850)
* Bump go-multiaddr dep

* Add support for http-path

* Support redirects

* Don't split at p2p, split at P_HTTP_PATH

* fixup

* Fill in host if missing

* mod tidy

* Fix test

* Add MultiaddrURIRedirect

* Only alloc err once
2024-07-16 15:03:06 -07:00
Marco Munizaga e433d07405 chore: Bump gorilla/websocket to 1.5.3
This change has some history. Originally there was v1.5.0, then the
project stalled and eventually the repo got archived. Some new
maintainers stepped up and released v1.5.1. That version had some
controversial changes including excessive logging (see
https://github.com/gorilla/websocket/issues/880). This caused us to
downgrade this dep back to v1.5.0 (see #2762). The change was short
lived as I bumped this dep back up to v1.5.1 without remembering this
context.

Since then the maintainers of gorilla/websocket have released a new
version v1.5.3 that brings the project back to the state of when it got
archived (minus a README edit). Bumping to this version should solve our
issues with v1.5.1 without having to downgrade back down to v1.5.0.
2024-07-03 18:43:24 -07:00
Marco Munizaga ad7da3b5bf chore: Bump fx to v1.22.1 (#2857) 2024-07-02 16:01:32 +05:30