Commit Graph

3003 Commits

Author SHA1 Message Date
Marco Munizaga 5811309d22
Start host in mocknet (#2078) 2023-02-09 15:55:27 -08:00
Marten Seemann 5f8fe94f90
identify: add some basic metrics (#2069) 2023-02-09 16:33:35 +11:00
Marten Seemann a8d6111ba9
p2p/test/quic: use contexts with a timeout for Connect calls (#2070) 2023-02-09 16:32:27 +11:00
Marco Munizaga f4fc85de03
feat!: rcmgr: Change LimitConfig to use LimitVal type (#2000)
* rcmgr: Change LimitConfig to use LimitVal type

* Nits

* Remove DefaultReifiedLimits

* Use pointers for optional ResourceLimits

* Reify a nil pointer with defaults

* Fix maxints

* Move helper

* Return nil if everything is default

* Check for nil pointer

* Change terms

* Add IsDefault helper

* Use values instead of pointers for PartialLimitConfig

* Remove references to reify

* Unmarshal 0 limits as block all

* ResourceLimits can build on Limits interface objs

* Convert max int to unlimited

* Remove ToLimitConfigWithDefaults

* Rename to ToPartialLimitConfig
2023-02-08 17:48:58 -08:00
Marten Seemann 235f25b487
identify: refactor sending of Identify pushes (#1984)
* identify: cache the snapshot

* identify: refactor sending of Identify pushes

* identify: fix concurrency when sending pushes

* identify: fix timestamp handling

* identify: remove unneeded pushSemaphore

* identify: improve logging

* identify: use a sequence number instead of a timestamp

* identify: start with an empty snapshot

* identify: wait until we've actually finished setting up
2023-02-08 14:44:33 -08:00
Marten Seemann 313b080ea4
rcmgr: add libp2p prefix to all metrics (#2063) 2023-02-06 19:58:12 -08:00
Marco Munizaga 27cce4fa78
websocket: Replace gorilla websocket transport with nhooyr websocket transport (#1982)
* Replace gorilla websocket transport with nhooyr websocket transport

* Bound read retry attempts

* Nit

* Go mod tidy

* Add comment
2023-02-06 19:35:07 -08:00
Marco Munizaga 97af39a2ed
rcmgr: Use prometheus SDK for rcmgr metrics (#2044)
* Replace OpenCensus with Prometheus Go SDK

Allows for much more efficient metric collecting

* PR comments

* Try a different way of testing noallocs

* CI fiddling

* CI fiddling

* Undo debug change

* Return early

* Debug

* Try AllocsPerRun

* Try gosched in noop

* Use AllocsPerRun

* Try without cover

* Use tag

* Revert "Try without cover"

This reverts commit e91b1e8f0d0ffbe6842a37925eb72e0177bf0773.

* Cleanup debug code

* Use global string slice pool
2023-02-06 19:29:58 -08:00
Sukun f9c02c1e46
autorelay: Split libp2p.EnableAutoRelay into 2 functions (#2022)
* Split libp2p.EnableAutoRelay into 2 functions

Provide two specific ways to enable the autorelay subsystem
libp2p.EnableAutoRelayWithStaticRelays
libp2p.EnableAutoRelayWithPeerSource

* remove minInterval from WithPeerSource

* Use PeerSource type

* Fix typo

* Update p2p/host/autorelay/options.go

Co-authored-by: Marten Seemann <martenseemann@gmail.com>

---------

Co-authored-by: Marco Munizaga <git@marcopolo.io>
Co-authored-by: Marco Munizaga <marco@marcopolo.io>
Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2023-02-06 19:26:56 -08:00
Marten Seemann e847002522
set names for eventbus event subscriptions (#2057) 2023-02-06 16:27:49 -08:00
Marco Munizaga b1a6822f1c
Test cleanup (#2053) 2023-02-06 16:25:08 -08:00
Marten Seemann 31966fbb05
metrics: use a single slice pool for all metrics tracer (#2054) 2023-02-07 09:18:54 +13:00
Sukun 3598171505
eventbus: add metrics (#2038)
* add events emitted metric to eventbus

* properly export grafana dashboard

* Add eventbus subscriber and notification time metrics

* expose name in subscription

* use atomic.AddInt64 for backwards compatibility

* make metrics optin

* update dashboard json

* follow options constructor pattern for eventbus

* remove unused type

* Review comments

* remove event name

* remove whitespace diff

* address review changes. remove notification time

* fix subscribers count

* make subscriber queue state timeline

* allow custom registerer. Make queue length gauge

* eventbus: remove package version from subscriber metrics

* eventbus: minor dashboard tweaks

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2023-02-04 14:13:30 -08:00
Marten Seemann 5da84975bf
quic: disable sending of Version Negotiation packets (#2015) 2023-02-03 17:13:56 -08:00
Marten Seemann 079dbfa364
p2p/test: fix flaky notification test (#2051) 2023-02-02 22:42:51 -08:00
Marten Seemann 8c198c6720
Merge pull request #1971 from libp2p/prometheus-registration
quic, tcp: only register Prometheus counters when metrics are enabled
2023-02-02 19:08:05 -08:00
Marten Seemann 5a5296ae19
p2p/test: add test for EvtLocalAddressesUpdated event (#2016) 2023-02-02 19:03:04 -08:00
Marten Seemann d5a3fb16e2
quic / webtransport: extend test to test dialing draft-29 and v1 (#1957) 2023-02-02 19:02:50 -08:00
Marten Seemann 6ebdb174eb
holepunch: fix flaky by not remove holepunch protocol handler (#1948) 2023-02-02 19:02:29 -08:00
Marten Seemann 8ae7a37916
use quic-go and webtransport-go from quic-go organization (#2040) 2023-02-02 18:08:44 -08:00
Marten Seemann 20c975e992
chore: remove license files from the eventbus package (#2042) 2023-02-01 23:51:18 -08:00
Marco Munizaga 753e48e5ce
rcmgr: *: Always close connscope (#2037)
* rcmgr: Fix connection accounting

* Always close conn scope in the case of errors

* circuitv2: fix resource accounting when connection upgrading fails

---------

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2023-02-01 09:59:30 -08:00
Marco Munizaga 34dc11547a
swarm metrics: fix datasource for dashboard (#2024) 2023-01-27 14:38:21 -08:00
Sukun 6b9c11680e
consistently use protocol.ID instead of strings (#2004)
* Change PeerStore interface to use protocol.ID

This reduces the string to protocol.ID translations happening
at various places in the code

* Fix misc cases of protocol.ID conversion

* Merge multistream changes

* Use protocol.ID in network.ConnectionState

* don't update examples

* fix error message tests

* merge new go-multistream changes

* update test-plans go mod

* change transport back to string
2023-01-27 01:39:59 -08:00
Marten Seemann 3919359872
swarm: add a basic metrics tracer (#1973)
* 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
2023-01-26 16:18:55 -08:00
Adin Schmahmann d5a280e6f6
Expose muxer ids (#2012)
* docs: remove documentation indicating that mplex is enabled by default

* feat: expose yamux ID as a constant

* feat: expose mplex ID as a constant

* reword muxer config documentation

Co-authored-by: Marten Seemann <martenseemann@gmail.com>
2023-01-25 15:53:43 -08:00
Sukun 084de0692a
Clean addresses with peer id before adding to addrbook (#2007)
* Clean addresses with peer id before adding to addrbook

Fixes: https://github.com/libp2p/go-libp2p/issues/2001

* Filter p2p addresses with invalid peerid

Add error reporting from Host.Connect

* Nits

Co-authored-by: Marco Munizaga <git@marcopolo.io>
2023-01-25 15:53:08 -08:00
Marco Munizaga faddf1aa41
Export resource manager errors (#2008) 2023-01-23 18:28:21 -08:00
Marten Seemann e004bd3fc5
peerstore: make it possible to use an empty peer ID (#2006) 2023-01-22 20:28:57 +13:00
Antonio Navarro Perez 9760794920
rcmgr: fix: Ignore zero values when marshalling Limits. (#1998) 2023-01-17 17:51:31 -08:00
Marten Seemann bdbef49cdb
ci: run go generate as part of the go-check workflow (#1986) 2023-01-11 20:34:34 -08:00
Marten Seemann f1109c59c1 use Google's Protobuf library instead of GoGo 2023-01-12 16:43:50 +13:00
Marten Seemann 8baf05b71d peerstore: remove gogo-specific Protobuf magic 2023-01-09 09:46:30 +13:00
Marten Seemann 6e2f434578 peerstore: move the protobuf to pstoreds 2023-01-08 16:20:51 +13:00
Marten Seemann 4ad3734091
circuitv2: correctly set the transport in the ConnectionState (#1972) 2023-01-06 21:48:12 -08:00
Marten Seemann 5095f44da2 identify: remove snapshot handling 2023-01-07 14:41:29 +13:00
Marten Seemann 56078a18f7 identify: simply stream handling logic when sending pushes 2023-01-07 14:41:29 +13:00
Marten Seemann aa1f32484a identify: remove support for Identify Delta 2023-01-07 14:41:27 +13:00
Marten Seemann 0e9abdf228 identify: emit EvtPeerProtocolsUpdated for Identify Push as well 2023-01-07 14:39:56 +13:00
Marten Seemann 1943c649cd
identify: remove old code targeting Go 1.17 (#1964) 2023-01-06 17:23:04 -08:00
muXxer 09c59cbbfb
chore: use generic LRU cache (#1980) 2023-01-05 12:19:53 -08:00
Marten Seemann fac76291e0 tcp: only register Prometheus counters when metrics are enabled 2023-01-02 13:24:00 +13:00
Marten Seemann e37ca354f1 quic: only register Prometheus counters when metrics are enabled 2023-01-02 13:18:06 +13:00
Marten Seemann e59aba2d09
webtransport: initialize a NullResourceManager if none is provided (#1962) 2022-12-29 15:28:09 -08:00
Marten Seemann 735891d229
routed host: return Connect error if FindPeer doesn't yield new addresses (#1946) 2022-12-11 16:59:38 -08:00
Marten Seemann 3ecf0b9aa9
webtransport: fix flaky accept queue test (#1938) 2022-12-09 17:00:17 -08:00
Marten Seemann 2c82176c35
quic: fix race condition in TestClientCanDialDifferentQUICVersions (#1937) 2022-12-08 14:46:07 -08:00
Marten Seemann e368799d18
quic: update quic-go to v0.31.1 (#1942) 2022-12-08 13:14:31 -08:00
Marco Munizaga 5d22740c38
Disable support for signed/static TLS certificates in WebTransport (#1927) 2022-12-05 13:27:12 -08:00
Marten Seemann cefbf97aa6
webtransport: add PSK to constructor, and fail if it is used (#1929)
That way, it won't be possible to construct a host with a PSK
when WebTransport is enabled. This is desireable since WebTransport doesn't
support private network (same as QUIC).
2022-12-05 12:44:15 -08:00