Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move go-libp2p-resource-manager to p2p/host/resource-manager #1677

Merged
merged 232 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
232 commits
Select commit Hold shift + click to select a range
278b243
Initial commit
vyzo Dec 22, 2021
2e81771
basic resource scopes
vyzo Dec 22, 2021
24b3716
improve memory checking, adjust GrowBuffer signatures
vyzo Dec 22, 2021
de657ac
add helper method to release all buffers
vyzo Dec 22, 2021
4e55640
sanity check ReleaseMemory as well
vyzo Dec 22, 2021
c2e7a71
add nil receiver safety to basic resource scopes
vyzo Dec 22, 2021
58ae61e
refactor scopes, introduce constrained scopes
vyzo Dec 23, 2021
bd2bb39
rename BasicResourceScope to Resources
vyzo Dec 23, 2021
6e65ae0
fix comment typo
vyzo Dec 23, 2021
80c3099
release buffer map at done
vyzo Dec 23, 2021
d45f325
embed mutex in scope impl, add constructors
vyzo Dec 23, 2021
eb5f7c9
flesh out concrete scopes
vyzo Dec 23, 2021
52cdfe2
fix brainfart
vyzo Dec 23, 2021
c573fa1
stream service cannot be set before peer
vyzo Dec 23, 2021
e3a6a34
only count fds if the connection actually uses an fd
vyzo Dec 23, 2021
65a1bd2
only allocate buffer map if the application requests a buffer, sanity…
vyzo Dec 23, 2021
01fff37
update scope stat definition
vyzo Dec 23, 2021
8e7a848
flesh out resource manager
vyzo Dec 23, 2021
8772601
add ResourceManager constructor and peer/protocol scope gc
vyzo Dec 23, 2021
14acd96
implement scope viewers
vyzo Dec 23, 2021
f3f7e3d
move ref counting to resource scopes
vyzo Dec 23, 2021
5dbbabd
make connection/stream Done idempotent
vyzo Dec 23, 2021
01d64c5
add missing done checks in ForChild methods
vyzo Dec 23, 2021
04d4aa1
more descriptive invalid buffer error in Grow
vyzo Dec 23, 2021
baf6ad9
update implementation for interface changes
vyzo Dec 24, 2021
113489e
consistent ref counting
vyzo Dec 24, 2021
20f097a
static limits
vyzo Dec 24, 2021
417238a
some cleanup for rcmgr scopes
vyzo Dec 26, 2021
b2ce04e
consolidate Rerve/ReleaseForChild in aggregate method
vyzo Dec 26, 2021
56ab2fb
implement buffers
vyzo Dec 27, 2021
521a1dc
add resources test
vyzo Dec 27, 2021
5552fe1
simplify stream/conn direction management
vyzo Dec 27, 2021
2b3b064
more robust handling of transactions
vyzo Dec 27, 2021
d6089cb
fix test
vyzo Dec 27, 2021
396d023
add comment for the distinction between DAG and txn scopes
vyzo Dec 27, 2021
1610a85
nil data when the scope is done
vyzo Dec 27, 2021
6117c3d
basic resource scope tests
vyzo Dec 27, 2021
ce0f370
basic txn test, fix bugz
vyzo Dec 27, 2021
7b0520a
moar txn tests
vyzo Dec 28, 2021
f49d150
add resource scope DAG test
vyzo Dec 28, 2021
aa30e69
more resource scope tests, fix bug
vyzo Dec 28, 2021
4a97e8f
resource manager test, fix bugz
vyzo Dec 28, 2021
b554ca8
fix typo
vyzo Dec 28, 2021
5ac5d3a
remove unneded casts
vyzo Dec 28, 2021
4f15a44
unexport resources
vyzo Dec 28, 2021
3c45b73
update for interface changes; RIP buffers.
vyzo Dec 28, 2021
8dcde0e
fix tests
vyzo Dec 28, 2021
3299f62
alias the interface errors instead of redefining them
vyzo Dec 29, 2021
1ee66e5
Update scope.go
vyzo Dec 29, 2021
fd5775c
Update scope.go
vyzo Dec 29, 2021
a1fb79e
use network.ErrResource*
vyzo Dec 29, 2021
5ded751
embed resources to avoid pointer indirection
vyzo Dec 29, 2021
31badda
manage fds together with connss
vyzo Dec 29, 2021
5e62203
fix tests
vyzo Dec 29, 2021
341dda8
unexport implementation types
vyzo Dec 30, 2021
1bc9c45
fix tests
vyzo Dec 30, 2021
53f1490
proper mutex hat
vyzo Dec 30, 2021
b89ffbd
update for interface changes
vyzo Dec 31, 2021
d9aa866
REAMDE
vyzo Jan 3, 2022
9c4ff8d
update for memory status indicator
vyzo Jan 5, 2022
60407b6
fix tests
vyzo Jan 5, 2022
718bfcc
default limiter
vyzo Jan 5, 2022
ade4119
implement dynamic limiter
vyzo Jan 5, 2022
bc8f88f
fix tests
vyzo Jan 5, 2022
2194576
Update README.md
vyzo Jan 5, 2022
4453817
Update README.md
vyzo Jan 5, 2022
6b92e15
Update README.md
vyzo Jan 5, 2022
4392e6e
Update README.md
vyzo Jan 5, 2022
ca26241
update for reservation interface changes
vyzo Jan 6, 2022
33b7c93
fix tests
vyzo Jan 6, 2022
e67feb9
add checks for reservation levels
vyzo Jan 6, 2022
23f4f4f
refactor limiters
vyzo Jan 6, 2022
94509ac
add appropriate build tags for dynamic limiter
vyzo Jan 6, 2022
3e000a9
fix build tags for v1.16 toolchain
vyzo Jan 6, 2022
ec3a962
named scopes for better errors to aid debugging resource allocation f…
vyzo Jan 6, 2022
e0fb6ee
move resource from protocol to service when a service for a stream is…
vyzo Jan 6, 2022
e633958
update REAMDE
vyzo Jan 6, 2022
a3f73ae
fix formatting
vyzo Jan 6, 2022
890b9c2
add fluid copy constructors for limits
vyzo Jan 8, 2022
4072c31
add support for per service peer limits
vyzo Jan 8, 2022
7d5d92c
add test for per service peer limits
vyzo Jan 8, 2022
3aac185
RIP gosigar
vyzo Jan 9, 2022
aa783b6
adjust memory limit multipliers for the default limiters
vyzo Jan 11, 2022
8ab6818
adjust default limits
vyzo Jan 13, 2022
9f591e7
Update README.md
vyzo Jan 13, 2022
e681818
rename txn to span
vyzo Jan 14, 2022
ca8f8d3
introduce per protocol peer limits, don't transfer resources out of p…
vyzo Jan 14, 2022
b5cfa05
fix tests
vyzo Jan 14, 2022
e959e1d
rename constraints to edges
vyzo Jan 14, 2022
47f96bc
log, don't panic on resource release bugs
vyzo Jan 14, 2022
d539db3
add logging around blocked reservations/conns/streams
vyzo Jan 14, 2022
6742c64
add total stream and conn limit
vyzo Jan 14, 2022
6bd3161
extensions api
vyzo Jan 14, 2022
e1a67dc
add options to NewResourceManager constructor
vyzo Jan 14, 2022
f83004f
fix test
vyzo Jan 14, 2022
22f06bd
tracing instrumentation
vyzo Jan 15, 2022
f922424
implement tracer
vyzo Jan 15, 2022
bf1254e
fix omit empty decl
vyzo Jan 15, 2022
79d1d26
short circuit write/flush if there are no pending events
vyzo Jan 15, 2022
34dafb3
emit start event to trace with the limiter
vyzo Jan 15, 2022
b3e1eae
add limit json config parser
vyzo Jan 16, 2022
0a41e9f
add limit config parsing unit test
vyzo Jan 16, 2022
a21682d
refactor limit defaults for easy access and user manipulation
vyzo Jan 16, 2022
6750d54
update README
vyzo Jan 17, 2022
11cfdcc
normalize limiter constructors
vyzo Jan 17, 2022
b9f0231
sort results in List* api methods
vyzo Jan 17, 2022
1bc2ef3
Merge pull request #1 from libp2p/implementation
vyzo Jan 17, 2022
6f70ba3
downgrade BUG log to warning
vyzo Jan 18, 2022
39e3bd3
Merge pull request #5 from libp2p/fix/bug-log
vyzo Jan 18, 2022
cd4dbe6
make protocols and peers sticky when setting their limit
vyzo Jan 19, 2022
e03ee6f
Merge pull request #7 from libp2p/feat/sticky-limits
vyzo Jan 19, 2022
475599e
avoid the nil is not nil footgun
vyzo Feb 3, 2022
4f7a0ba
Merge pull request #9 from libp2p/fix/nil-is-not-nil
vyzo Feb 3, 2022
9bb2231
metrics collection support
vyzo Feb 11, 2022
ed84e41
simplify metrics method names
vyzo Feb 12, 2022
a1ce806
blocked memory reservation metrics
vyzo Feb 12, 2022
c57dae0
fix test
vyzo Feb 12, 2022
bafade0
add Allow metrics
vyzo Feb 14, 2022
5c7642d
Merge pull request #11 from libp2p/feat/metrics
vyzo Feb 14, 2022
6b14800
improve debug logging
vyzo Mar 10, 2022
56d9997
Merge pull request #12 from libp2p/feat/improve-debug-log
vyzo Mar 10, 2022
8ec1aac
use a string for trace events (#15)
marten-seemann Apr 8, 2022
65fb3af
fix sign of delta of release_memory tracer event (#16)
marten-seemann Apr 10, 2022
69b6171
fix: decode peer IDs from limits.json (#19)
guseggert Apr 18, 2022
0f8edb9
fix: typos in config err msgs
guseggert Apr 19, 2022
b9c597f
feat: export basic limiter config
guseggert Apr 21, 2022
5d31004
Merge pull request #21 from libp2p/feat/export-limiter-config
vyzo Apr 21, 2022
6eb28aa
add a timestamp to trace events (#34)
marten-seemann Jun 1, 2022
5043807
fix shadowing of service name (#37)
marten-seemann Jun 3, 2022
91b0b82
fix typos in MetricsReporter docs
marten-seemann Jun 3, 2022
2647b00
skip events that don't change anything in tracer (#38)
marten-seemann Jun 4, 2022
9ffb8ad
trace exact timestamps (#39)
marten-seemann Jun 4, 2022
771cfe8
export the TraceEvt (#40)
marten-seemann Jun 4, 2022
6e563a8
add a DefaultLimitConfig with infinite limits (#41)
marten-seemann Jun 6, 2022
4730d83
include the current limits in stream allocation errors
marten-seemann Jun 6, 2022
ddaa354
include the current limits in conn allocation errors
marten-seemann Jun 6, 2022
14e0aa8
include the current limits in memory allocation errors
marten-seemann Jun 6, 2022
f80857c
Add design doc
MarcoPolo Jun 8, 2022
2c18d9e
Add allowlist impl
MarcoPolo Jun 10, 2022
e797c0b
Add allowlist to rcmgr
MarcoPolo Jun 10, 2022
b3f6f1f
Simplify by removing ip addr, only networks. Adds a benchmark
MarcoPolo Jun 13, 2022
1f9890a
Add comment
MarcoPolo Jun 13, 2022
3750832
Cleanup
MarcoPolo Jun 13, 2022
b92ccf7
Fix comment
MarcoPolo Jun 13, 2022
f8a3fbc
PR comments
MarcoPolo Jun 14, 2022
288aa7b
Use the same standard limits for the allowlistedSystem and allowliste…
MarcoPolo Jun 14, 2022
28e911c
Fix allowlist system instantiation
MarcoPolo Jun 15, 2022
ba386ae
Persist endpoint
MarcoPolo Jun 15, 2022
a984205
include the resource stat in the debug output
marten-seemann Jun 19, 2022
ef2df30
add an ID to spans (#44)
marten-seemann Jun 19, 2022
cdb49b2
move assembling of log values into separate functions
marten-seemann Jun 19, 2022
21d93c0
move errors to a separate file
marten-seemann Jun 19, 2022
14be950
Merge pull request #42 from libp2p/rework-errors
marten-seemann Jun 19, 2022
40b3d23
trace the scope as a JSON object (#52)
marten-seemann Jun 20, 2022
63bb42e
Fuse with if above
MarcoPolo Jun 27, 2022
1dad553
Protect inner data with RWMutex
MarcoPolo Jun 27, 2022
9b3d3d7
Only use allowlist if the normal resource scopes would have failed
MarcoPolo Jun 27, 2022
d873a5a
Update comment
MarcoPolo Jun 27, 2022
2ca5528
Allowlist test with rcmgr
MarcoPolo Jun 27, 2022
8143be2
Export Allowlist type
MarcoPolo Jun 27, 2022
a4d3114
Add GetAllowlist()
MarcoPolo Jun 27, 2022
df92887
Add WithAllowlistedMultiaddr option
MarcoPolo Jun 27, 2022
00eb8d5
Update allowlist design doc with no extra cost for happy path
MarcoPolo Jun 27, 2022
4d13598
PR nits
MarcoPolo Jun 30, 2022
b4f626c
Remove branch
MarcoPolo Jun 30, 2022
d36981c
Merge pull request #47 from libp2p/marco/allowlist
MarcoPolo Jul 1, 2022
3e94d03
Add multimetrics reporter
MarcoPolo Jun 15, 2022
d76fbd7
Add trace reporter to expose traces to users
MarcoPolo Jun 17, 2022
ff4e52e
Flip sign of delta
MarcoPolo Jun 20, 2022
cd177ba
Add scope name helpers
MarcoPolo Jun 20, 2022
f44c86d
Add obs to resource manager
MarcoPolo Jun 20, 2022
007d9d5
Revert "Add multimetrics reporter"
MarcoPolo Jun 21, 2022
2fe978a
Remove connid from scopename in blocked conns
MarcoPolo Jun 21, 2022
67d3e5c
Add Grafana dashboard
MarcoPolo Jun 21, 2022
08b5966
Fix merge conflicts
MarcoPolo Jun 21, 2022
93dc672
Update dashboard json
MarcoPolo Jun 21, 2022
faef8c2
Update dashboard blocked resources
MarcoPolo Jun 23, 2022
0ea2e33
Update bucket distribution and blocked resources
MarcoPolo Jun 23, 2022
3957877
Use bytes rather than decbytes (power of 2)
MarcoPolo Jun 23, 2022
bf29645
Unexport tag names, remove unused var
MarcoPolo Jun 27, 2022
9f99e28
Filter out spans
MarcoPolo Jun 30, 2022
cc577a0
Rewrite constants to be more obvious
MarcoPolo Jun 30, 2022
e5140e1
Don't add reporter twice
MarcoPolo Jun 30, 2022
8450852
Update help text
MarcoPolo Jul 1, 2022
c27b0df
Remove unused var
MarcoPolo Jul 1, 2022
90a31e0
Fix go vet issue
MarcoPolo Jul 1, 2022
290ca99
Merge pull request #54 from libp2p/marco/50-obs
MarcoPolo Jul 1, 2022
bf0b758
remove support for parsing limit configs from JSON
marten-seemann Jun 10, 2022
616be72
remove support for dynamic limits
marten-seemann Jun 10, 2022
1b82fba
implement scaling of limits
marten-seemann Jun 10, 2022
62aa2a7
add a function to automatically scale limits to system memory / FDs
marten-seemann Jun 10, 2022
bc5e192
reimplement parsing of JSON limit configs
marten-seemann Jun 12, 2022
85ba429
log the values that the limiter is initialized with
marten-seemann Jun 12, 2022
d21aa7c
expose BaseLimitIncrease.Apply
marten-seemann Jun 19, 2022
17faef4
Merge pull request #48 from libp2p/rework-limits
marten-seemann Jul 2, 2022
976187f
Add allowlist limit config option
MarcoPolo Jul 1, 2022
77aebd5
Fix less check on my machine
MarcoPolo Jul 1, 2022
0d6589e
Update limit_defaults.go
MarcoPolo Jul 2, 2022
c2b0eb0
Merge pull request #57 from libp2p/marco/allowlist-config
MarcoPolo Jul 2, 2022
e5db550
don't limit the number of FDs on Windows (#58)
marten-seemann Jul 3, 2022
ceb8e33
docs: describe how the limiter is configured, and how limits are scal…
marten-seemann Jul 3, 2022
9036147
fix marshalling of allowlisted scopes
marten-seemann Jul 3, 2022
f1e381d
Merge pull request #62 from libp2p/fix-allowlist-marshalling
MarcoPolo Jul 3, 2022
50c7eb7
Add docs around WithAllowlistedMultiaddrs. Expose allowlist
MarcoPolo Jul 3, 2022
0a1e1ea
Update allowlist_test.go
MarcoPolo Jul 3, 2022
9176f63
Merge pull request #63 from libp2p/marco/docs-and-expose-allowlist
MarcoPolo Jul 3, 2022
392771e
Don't wait for a chan that will never close
MarcoPolo Jul 6, 2022
a0be99e
Merge pull request #65 from libp2p/marco-fix-trace-close
MarcoPolo Jul 6, 2022
369cc5e
Implement `json.Marshaler` interface for LimitConfig
MarcoPolo Jul 6, 2022
5ba3f91
Merge pull request #67 from libp2p/marco-marshal-limit-config-properly
MarcoPolo Jul 7, 2022
728a72c
Use templated version of grafana dashboard json
MarcoPolo Jul 7, 2022
40d71c4
Merge pull request #69 from libp2p/marco/update-grafana-json
MarcoPolo Jul 7, 2022
55a7225
Handle multiple instances in metrics
MarcoPolo Jul 7, 2022
6a2fd1b
Merge pull request #70 from libp2p/marco/grafana-multiple-instances
MarcoPolo Jul 7, 2022
0c240c1
Record which direction the resource was blocked
MarcoPolo Jul 8, 2022
54eff3d
Simplify memory graphs in stock grafana dashboard
MarcoPolo Jul 8, 2022
562d88f
Merge pull request #73 from libp2p/marco/grafana-aggregate-mem-stats-…
MarcoPolo Jul 26, 2022
a32c7a3
Add size hint to slice to hopefully have the tag slice allocated on t…
MarcoPolo Jul 27, 2022
ba3117d
Merge pull request #72 from libp2p/marco/record-block-resource-dir
MarcoPolo Jul 27, 2022
00c2520
Add docs in the godoc
MarcoPolo Jul 28, 2022
8497c2e
Merge new docs into readme
MarcoPolo Aug 9, 2022
b886f63
Nits
MarcoPolo Aug 9, 2022
e218381
Add section about allowlist
MarcoPolo Aug 9, 2022
ab86eb7
Add example
MarcoPolo Aug 11, 2022
79dba76
Merge pull request #75 from libp2p/marco/docs
MarcoPolo Aug 11, 2022
b60dc21
Fix usage of make to reserve capacity, not values
MarcoPolo Aug 11, 2022
1869ebc
Merge pull request #76 from libp2p/marco/fix-null-pointer-err
MarcoPolo Aug 11, 2022
06006c3
Add namespace to metrics
MarcoPolo Aug 11, 2022
c277824
Update readme
MarcoPolo Aug 11, 2022
3587124
Merge pull request #79 from libp2p/marco/metrics-namespace
MarcoPolo Aug 12, 2022
115858f
move go-libp2p-resource-manager here
marten-seemann Aug 15, 2022
6bd5e04
switch from github.com/libp2p/go-libp2p-resource-manager to p2p/host/…
marten-seemann Aug 15, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"crypto/rand"

"github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem"
rcmgr "github.com/libp2p/go-libp2p/p2p/host/resource-manager"
"github.com/libp2p/go-libp2p/p2p/muxer/yamux"
"github.com/libp2p/go-libp2p/p2p/net/connmgr"
"github.com/libp2p/go-libp2p/p2p/security/noise"
Expand All @@ -16,7 +17,6 @@ import (

"github.com/libp2p/go-libp2p-core/crypto"

rcmgr "github.com/libp2p/go-libp2p-resource-manager"
"github.com/multiformats/go-multiaddr"
)

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ require (
github.com/libp2p/go-eventbus v0.2.1
github.com/libp2p/go-libp2p-asn-util v0.2.0
github.com/libp2p/go-libp2p-core v0.19.1
github.com/libp2p/go-libp2p-resource-manager v0.5.1
github.com/libp2p/go-libp2p-testing v0.11.0
github.com/libp2p/go-mplex v0.7.0
github.com/libp2p/go-msgio v0.2.0
Expand All @@ -42,9 +41,11 @@ require (
github.com/multiformats/go-multihash v0.2.0
github.com/multiformats/go-multistream v0.3.3
github.com/multiformats/go-varint v0.0.6
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58
github.com/prometheus/client_golang v1.12.1
github.com/raulk/go-watchdog v1.3.0
github.com/stretchr/testify v1.8.0
go.opencensus.io v0.23.0
go.uber.org/goleak v1.1.12
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
Expand Down Expand Up @@ -98,7 +99,6 @@ require (
github.com/nxadm/tail v1.4.8 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/opencontainers/runtime-spec v1.0.2 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY=
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E=
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
Expand Down Expand Up @@ -351,8 +352,6 @@ github.com/libp2p/go-libp2p-core v0.5.7/go.mod h1:txwbVEhHEXikXn9gfC7/UDDw7rkxuX
github.com/libp2p/go-libp2p-core v0.19.0/go.mod h1:AkA+FUKQfYt1FLNef5fOPlo/naAWjKy/RCjkcPjqzYg=
github.com/libp2p/go-libp2p-core v0.19.1 h1:zaZQQCeCrFMtxFa1wHy6AhsVynyNmZAvwgWqSSPT3WE=
github.com/libp2p/go-libp2p-core v0.19.1/go.mod h1:2uLhmmqDiFY+dw+70KkBLeKvvsJHGWUINRDdeV1ip7k=
github.com/libp2p/go-libp2p-resource-manager v0.5.1 h1:jm0mdqn7yfh7wbUzlj948BYZX0KZ3RW7OqerkGQ5rYY=
github.com/libp2p/go-libp2p-resource-manager v0.5.1/go.mod h1:CggtV6EZb+Y0dGh41q5ezO4udcVKyhcEFpydHD8EMe0=
github.com/libp2p/go-libp2p-testing v0.1.1/go.mod h1:xaZWMJrPUM5GlDBxCeGUi7kI4eqnjVyavGroI2nxEM0=
github.com/libp2p/go-libp2p-testing v0.11.0 h1:+R7FRl/U3Y00neyBSM2qgDzqz3HkWH24U9nMlascHL4=
github.com/libp2p/go-libp2p-testing v0.11.0/go.mod h1:qG4sF27dfKFoK9KlVzK2y52LQKhp0VEmLjV5aDqr1Hg=
Expand Down Expand Up @@ -611,6 +610,7 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M=
go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc=
Expand Down
3 changes: 1 addition & 2 deletions limits.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ import (
"github.com/libp2p/go-libp2p-core/protocol"

"github.com/libp2p/go-libp2p/p2p/host/autonat"
rcmgr "github.com/libp2p/go-libp2p/p2p/host/resource-manager"
relayv1 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv1/relay"
circuit "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/proto"
relayv2 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/relay"
"github.com/libp2p/go-libp2p/p2p/protocol/holepunch"
"github.com/libp2p/go-libp2p/p2p/protocol/identify"
"github.com/libp2p/go-libp2p/p2p/protocol/ping"

rcmgr "github.com/libp2p/go-libp2p-resource-manager"
)

// SetDefaultServiceLimits sets the default limits for bundled libp2p services
Expand Down
16 changes: 8 additions & 8 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ func EnableRelayService(opts ...relayv2.Option) Option {
// EnableAutoRelay configures libp2p to enable the AutoRelay subsystem.
//
// Dependencies:
// * Relay (enabled by default)
// * Routing (to find relays), or StaticRelays/DefaultStaticRelays.
// - Relay (enabled by default)
// - Routing (to find relays), or StaticRelays/DefaultStaticRelays.
//
// This subsystem performs automatic address rewriting to advertise relay addresses when it
// detects that the node is publicly unreachable (e.g. behind a NAT).
Expand Down Expand Up @@ -342,7 +342,7 @@ func ConnectionGater(cg connmgr.ConnectionGater) Option {
}

// ResourceManager configures libp2p to use the given ResourceManager.
// When using the go-libp2p-resource-manager implementation of the ResourceManager interface,
// When using the p2p/host/resource-manager implementation of the ResourceManager interface,
// it is recommended to set limits for libp2p protocol by calling SetDefaultServiceLimits.
func ResourceManager(rcmgr network.ResourceManager) Option {
return func(cfg *Config) error {
Expand Down Expand Up @@ -436,14 +436,14 @@ func MultiaddrResolver(rslv *madns.Resolver) Option {
// to create direct/NAT-traversed connections with other peers. (default: disabled)
//
// Dependencies:
// * Relay (enabled by default)
// - Relay (enabled by default)
//
// This subsystem performs two functions:
//
// 1. On receiving an inbound Relay connection, it attempts to create a direct connection with the remote peer
// by initiating and co-ordinating a hole punch over the Relayed connection.
// 2. If a peer sees a request to co-ordinate a hole punch on an outbound Relay connection,
// it will participate in the hole-punch to create a direct connection with the remote peer.
// 1. On receiving an inbound Relay connection, it attempts to create a direct connection with the remote peer
// by initiating and co-ordinating a hole punch over the Relayed connection.
// 2. If a peer sees a request to co-ordinate a hole punch on an outbound Relay connection,
// it will participate in the hole-punch to create a direct connection with the remote peer.
//
// If the hole punch is successful, all new streams will thereafter be created on the hole-punched connection.
// The Relayed connection will eventually be closed after a grace period.
Expand Down
1 change: 1 addition & 0 deletions p2p/host/peerstore/pstoremem/inmem_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@ func TestMain(m *testing.M) {
goleak.VerifyTestMain(
m,
goleak.IgnoreTopFunction("github.com/ipfs/go-log/v2/writer.(*MirrorWriter).logRoutine"),
goleak.IgnoreTopFunction("go.opencensus.io/stats/view.(*worker).start"),
)
}
Loading