only enable rcmgr by default in full nodes

opt-in with envvar for other nodes, as there are still some issues
with markets related protocols
This commit is contained in:
vyzo
2022-05-31 12:03:03 +03:00
parent 000b932cac
commit a313dcba74
4 changed files with 14 additions and 1 deletions
+3 -1
View File
@@ -27,8 +27,10 @@ import (
func ResourceManager(connMgrHi uint) func(lc fx.Lifecycle, repo repo.LockedRepo) (network.ResourceManager, error) {
return func(lc fx.Lifecycle, repo repo.LockedRepo) (network.ResourceManager, error) {
isFullNode := repo.RepoType().Type() == "FullNode"
envvar := os.Getenv("LOTUS_RCMGR")
if envvar == "0" {
if (isFullNode && envvar == "0") || // enable by default for full nodes
(!isFullNode && envvar != "1") { // otherwise, opt-in with envvar
// this is enabled by default; specify LOTUS_RCMGR=0 to disable
log.Info("libp2p resource manager is disabled")
return network.NullResourceManager, nil