* pass an event bus to the swarm constructor
* make the eventbus parameter a required swarm constructor parameter
* emit Connectedness notifications from the swarm
* remove peer connectedness watchers from hosts
* swarm: emit connectedness events when holding the mutex
* Refactor relay_finder and start autorelay after identify
* Clock fork
* Remove multiple timers and use a single rate limiting chan for findNodes
* Remove clock fork
* Rename
* Use scheduledWork.nextAllowedCallToPeerSource.Add(rf.conf.minInterval)
* Fix flaky test that relied on time
* add autonat metrics
* add benchmarks
* use increase instead of sum by with rate in dashboard
* add interface assertion
* add no alloc test
* update dashboard
* autonat: minor dashboard tweaks
---------
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
* swarm: add very basic metrics for opening and closing connections
* swarm: use a sync.Pool to make metrics collection allocation-free
* swarm: introduce a MetricsTracer interface
* swarm: add the transport to the dial error metric
* swarm: add Grafana dashboard
* swarm: use the prometheus namespace option
* 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>
* Muxer selection in TLS handshake first cut
* Clean up some part of the code
* Change earlydata to ConnectionState for security connection.
* resolve merging conflicts
* Add stubs for noise
* clean up code
* Switch over to passing muxers to security transport constructors
* Address feedback points
* Update p2p/net/upgrader/upgrader.go
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
* clean up accidental checked file.
* Review points round 2
* Address some go nit points
* Update tls transport test to address review points
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
* Add Resolver interface to transport
* Move resolve test to swarm_dial_test
* Use proper peer id in test
* Only import go-multiaddr once
* Cleanup
* Use SNI in websocket
* Update go-multiaddr
* Update p2p/net/swarm/swarm.go
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
* PR comments on websocket.go
* Use unresolved/resolved map
* Set sni
* Refactor websocket multiaddr parsing code, add server test
* Delete superflous helpers
* Update callsites
* Fix typo in p2p/transport/websocket/websocket.go
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
* Configure protocolVersion for Identify protocol
Allows the protocolVersion field of the Idenfity protocol to be
configured on the host. The current value is fixed for what appears to
be for backwards compatibility with IPFS which makes it difficult for
non-IPFS protocols to use the library.
References:
- https://github.com/libp2p/go-libp2p/issues/714
- https://github.com/libp2p/go-libp2p/pull/1137
- 6855ab943b/protocols/identify/src/identify.rs (L125-L127)
* Fix protocol version assignment
Fix an issue where the protocolVersion string for the Identify protocol
was wrongly being assigned the agentVersion string.
* Delete trailing whitespace