5822 Commits

Author SHA1 Message Date
Guillaume Michel
97f29c5c20 Merge pull request #3293 from libp2p/go-clock-migration
go-clock migration
2025-05-22 10:23:35 +02:00
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
455a983b0e swarm_test: support more transports for GenSwarm (#3130) 2025-05-16 16:06:54 +05:30
sukun
a085837878 chore: use tcort/github-action-markdown-link-check (#3291)
The existing checker is consistently failing
2025-05-16 15:18:34 +05:30
Guillaume Michel
c1c77458c2 eventbus: change slow consumer event from error to warn (#3286)
Closes ipfs/kubo#10778
2025-05-15 23:41:34 +05:30
sukun
813d78c0ee quicreuse: add some documentation for the package (#3279)
This adds some helpful documentation for the package and explicitly specifies the reuse and association logic for ListenQUICAndAssociate and DialQUIC.
2025-05-15 14:40:35 +05:30
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
Ocenka
effdc6525c fix(pstoreds): add missing log for failed GC record unmarshalling in purgeStore() (#3273) 2025-04-21 11:10:54 -07:00
VolodymyrBg
054c96a0c8 nat: improve port mapping failure logging (#3261) 2025-04-14 15:24:32 +05:30
sukun
4b7997256e ci: add golangci-lint for linting (#3269) 2025-04-14 15:21:03 +05:30
levisyin
58d21ca241 build(test_analysis): use modernc.org/sqlite directly (#3227) 2025-04-10 21:15:27 -07:00
vladopajic
2aa0bca834 chore(certificate): update test vectors (#3242) 2025-04-07 09:36:41 -07:00
sukun
8d6ceabd74 rcmgr: use netip.Prefix as map key instead of string (#3264) 2025-04-04 14:56:20 +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
4c2639e7ce identify: reduce timeout to 5 seconds (#3259)
The max message size is about 100kB. 5 seconds are enough to transfer this.
2025-04-01 13:35:06 +05:30
b00f
88b1a70f24 fix(relay): fix data-race in relayFinder (#3258)
`relayFinder.relays` should only be accessed with the `relayMx` held
2025-03-31 19:50:49 +05:30
Piotr Galar
17fd61051d Merge pull request #3254 from libp2p/uci/copy-templates
ci: uci/copy-templates
2025-03-28 19:05:41 +01:00
Prithvi Shahi
f8c19263cf Merge branch 'master' into uci/copy-templates 2025-03-28 09:24:14 -07:00
Marcin Rataj
6bcefdc3d1 chore: update p2p-forge to v0.5.0 for autotls example (#3257) 2025-03-28 12:07:12 +05:30
web3-bot
96318bce3b chore: add or force update .github/workflows/generated-pr.yml 2025-03-27 02:06:46 +00:00
web3-bot
d0b5129827 chore: add or force update .github/workflows/stale.yml 2025-03-27 02:06:46 +00:00
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
argentpapa
92aa563331 chore: using t.TempDir() instead of os.MkdirTemp (#3222) 2025-03-26 00:41:33 +05:30
Marcin Rataj
2e810f7de4 chore(examples): p2p-forge/client v0.4.0 (#3211) 2025-03-26 00:40:36 +05:30
sukun
6249e685e9 transport: add GatedMaListener type (#3186)
This introduces a new GatedMaListener type which gates conns
accepted from a manet.Listener with a gater and creates the rcmgr
scope for it. Explicitly passing the scope allows for many guardrails
that the previous interface assertion didn't.

This breaks the previous responsibility of the upgradeListener method
into two, one gating the connection initially, and the other upgrading
the connection with a security and muxer selection.

This split makes it easy to gate the connection with the resource
manager as early as possible. This is especially true for websocket
because we want to gate the connection just after the TCP connection is
established, and not after the tls handshake + websocket upgrade is
completed.
2025-03-25 22:09:57 +05:30
sukun
8430ad3e2f autonatv2: explicitly handle dns addrs (#3249) 2025-03-24 23:43:37 +05:30
sukun
0682ad7c50 autonatv2: fix server dial data request policy (#3247) 2025-03-24 21:34:39 +05:30
Probot
1f6232db19 webtransport: wrap underlying transport error on stream resets (#3237) 2025-03-21 21:08:21 +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
7bdeeb494d connmgr: fix transport association bug (#3221)
reuse port didn't work for the second transport, either QUIC or 
WebTransport, that was used for listening. This change fixes 
it by calling associate on all paths. 

This impacted hole punching for some users since you cannot hole 
punch without reuse port. There's a test in holepunch package
to prevent regressions. 

Fixes #3165

Co-authored-by: Marco Munizaga <git@marcopolo.io>
2025-03-21 16:47:47 +05:30
sukun
2bad683f69 webrtc: fix memory leak with udpmux.muxedConnection context (#3243)
This context wasn't being cancelled on all code paths. In particular,
contexts for connections that didn't complete negotiation were not being
cancelled.

The change arranges for either `udpmux.muxedConnection.Close` or 
`RemoveConnByUfrag` to call the other.

Fixes: #3223
2025-03-20 22:22:35 +05:30
Pavel Zbitskiy
a743f9f88a fix(libp2phttp): bound NewStream timeout (#3225) 2025-03-19 11:33:12 -07:00
huochexizhan
b663d7b579 conngater: fix incorrect err return value (#3219) 2025-03-10 21:10:29 +05:30
sukun
5e6f217d84 addrsmanager: extract out addressing logic from basichost (#3075)
Benchmark for AllAddrs:

```
goos: linux
goarch: amd64
pkg: github.com/libp2p/go-libp2p
cpu: AMD Ryzen 7 7840U w/ Radeon  780M Graphics
BenchmarkAllAddrs-16               16737            122245 ns/op           21240 B/op        218 allocs/op
```
after:
```
goos: linux
goarch: amd64
pkg: github.com/libp2p/go-libp2p
cpu: AMD Ryzen 7 7840U w/ Radeon  780M Graphics
BenchmarkAllAddrs-16            11103236               105.7 ns/op           192 B/op          1 allocs/op
```
2025-02-27 22:24:57 +05:30
sukun
578af0c651 Release v0.41.0 (#3210) v0.41.0 2025-02-25 11:19:11 -08:00
sukun
e9a2fa57f5 chore: update deps for v0.41 (#3209) 2025-02-25 08:54:18 -08:00
Marco Munizaga
c250ce3326 fix(libp2phttp): Fix relative to absolute multiaddr URI logic (#3208) 2025-02-25 08:53:44 -08:00
Marco Munizaga
93014e1148 fix(dcutr): Fix end to end tests and add legacy behavior flag (default=true) (#3044) 2025-02-24 20:53:47 -08:00
Marco Munizaga
3e51326ff1 feat(libp2phttp): More ergonomic auth (#3188) 2025-02-24 16:12:19 -08:00
Marcin Rataj
93a1d3f593 chore(identify): move log to debug level (#3206) 2025-02-24 16:10:01 -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
8c6f0a7541 chore: move go-nat to internal package 2025-02-21 20:59:52 -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
f88beca8d5 basichost: add certhashes to addrs in place (#3200) 2025-02-18 13:19:00 -08:00
sukun
914331ba90 autorelay: send addresses on eventbus; dont wrap address factory (#3071) 2025-02-18 18:36:17 +05:30
web3-bot
fe11448914 chore: update ci for go1.24 (#3195)
Co-authored-by: Piotr Galar <piotr.galar@gmail.com>
2025-02-18 17:31:14 +05:30