Commit Graph

5811 Commits

Author SHA1 Message Date
Marco Munizaga
da810a1764 feat: Migrate to log/slog (#3364) 2025-08-25 14:00:01 -07:00
web3-bot
83d77757a2 ci: uci/update-go (#3371) 2025-08-20 14:18:56 -07:00
sukun
90b841260e basichost: move observed address manager to basichost (#3332) 2025-08-18 12:16:16 -07:00
Marco Munizaga
78f84c40c8 chore: support Go 1.24 & 1.25 (#3366) 2025-08-18 19:09:23 +05:30
Marco Munizaga
9f5945e189 feat(simlibp2p): Simulated libp2p Networks (#3262) 2025-08-15 09:44:03 -07:00
Carlos Peliciari
8e10f84961 bandwidthcounter: add Reset and TrimIdle methods to reporter interface (#3343) 2025-08-11 19:23:50 +05:30
sukun
0d37934033 network: rename NAT Types (#3331) 2025-08-11 19:21:00 +05:30
crStiv
62b9468d0c refactor(quicreuse): use errors.Join in Close method (#3363) 2025-08-08 17:14:09 -07:00
sukun
fc4a618881 swarm: move AddCertHashes to swarm (#3330) 2025-08-07 22:41:24 +05:30
Probot
02e583d319 quicreuse: clean up associations for closed listeners. (#3306)
Co-authored-by: Prithvi Shahi <shahi.prithvi@gmail.com>
Co-authored-by: sukun <sukunrt@gmail.com>
2025-08-07 22:39:44 +05:30
sukun
b75e678e64 Release v0.43 (#3353) v0.43.0 2025-08-07 21:02:01 +05:30
sukun
f6c14a215b chore: upgrade quic-go to v0.54.0 (#3351) 2025-07-31 11:46:38 -07:00
sukun
26a5710d35 basichost: fix deadlock with addrs_manager (#3348) 2025-07-30 17:08:12 +05:30
sukun
8e8f76abf6 basichost: fix Addrs docstring (#3341) 2025-07-28 20:04:04 +05:30
sukun
7b7c3ed4ce quic: upgrade quic-go to v0.53 (#3323) 2025-07-02 23:24:16 +02:00
sukun
000582cf2c Release v0.42.0 (#3318) v0.42.0 2025-06-18 21:48:03 +05:30
sukun
150f67b07c chore: update deps (#3312) v0.42.0-alpha-3 2025-06-17 18:46:23 +05:30
Piotr Galar
b0cc6503e5 ci: use go-check for golangci-lint (#3309) 2025-06-16 14:12:04 +05:30
sukun
90633f6ab3 mocknet: notify listeners on listen (#3310) 2025-06-15 22:37:24 +05:30
sukun
2d45a88295 autonatv2: add metrics (#3308) 2025-06-12 21:48:16 +05:30
Piotr Galar
b06bfecfc6 Merge pull request #3295 from libp2p/uci-golangci-lint
chore: fix errors reported by golangci-lint
2025-06-11 18:37:53 +01:00
galargh
735a7f0984 fix: revive in p2p transport tcp 2025-06-11 14:34:35 +01:00
galargh
2d4d2ee903 fix: golangci lint configuration 2025-06-11 14:34:29 +01:00
galargh
198e27ff11 chore: run gofmt 2025-06-11 11:15:11 +01:00
Piotr Galar
335c75a398 Merge branch 'master' into uci-golangci-lint 2025-06-11 10:42:45 +01:00
galargh
50f065b4df chore: fix revive issues 2025-06-11 10:00:47 +01:00
galargh
a0c9fdf2b3 chore: report all the issues from golangci 2025-06-11 10:00:39 +01:00
sukun
dbf7e1b972 autonatv2: add Unknown addrs to event (#3305)
Providing unknown addresses to the user, helps them infer whether autonatv2 has any more addresses it might confirm.

There's no upside to not sending this information.

This also changes host.ConfirmedAddrs to return all the three categories, Reachable, Unreachable, and Unknown addrs.
v0.42.0-alpha
2025-06-10 21:02:18 +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
sukun
fb1d9512e8 basichost: use autonatv2 to verify reachability (#3231)
This introduces addrsReachabilityTracker that tracks reachability on
a set of addresses. It probes reachability for addresses periodically
and has an exponential backoff in case there are too many errors
or we don't have any valid autonatv2 peer.

There's no smartness in the address selection logic currently. We just
test all provided addresses. It also doesn't use the addresses provided
by `AddrsFactory`, so currently there's no way to get a user provided
address tested for reachability, something that would be a problem for
dns addresses. I intend to introduce an alternative to
`AddrsFactory`, something like, `AnnounceAddrs(addrs []ma.Multiaddr)`
that's just appended to the set of addresses that we have, and check
reachability for those addresses.

There's only one method exposed in the BasicHost right now that's
`ReachableAddrs() []ma.Multiadd`r that returns the host's reachable
addrs. Users can also use the event `EvtHostReachableAddrsChanged`
to be notified when any addrs reachability changes.
2025-06-03 17:13:56 +05:30
galargh
6c15a3f3ff Revert "wip: testing uci golangci-lint support"
This reverts commit a96c3e14a7.
2025-06-03 11:56:05 +01:00
galargh
88d1e102f8 chore: fix golangci-lint errors 2025-06-02 09:51:53 +01:00
galargh
f702751935 chore: disable unused-param rule 2025-06-02 09:51:53 +01:00
galargh
3578f30176 chore: fix golangci-lint errors 2025-06-02 09:17:29 +01:00
galargh
2023a2707e chore: disable errcheck 2025-06-01 22:44:41 +01:00
Piotr Galar
a96c3e14a7 wip: testing uci golangci-lint support 2025-06-01 22:32:17 +01:00
Guillaume Michel
31c8c83308 chore: Revert "go-clock migration" (#3303) 2025-05-30 17:57:47 +05:30
web3-bot
4c254930f0 ci: update golangci-lint version (#3282)
Co-authored-by: Piotr Galar <piotr.galar@gmail.com>
2025-05-30 17:33:06 +05:30
GarmashAlex
853011ae73 tcp: ensure tcpGatedMaListener wrapping happens always (#3275) 2025-05-26 15:27:25 +05:30
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