-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Resource Manager: ipfs swarm limit <scope> --reset
is setting to zero all other scopes.
#9559
Comments
Tentative fix at go-libp2p side: libp2p/go-libp2p#1998 |
Does this fix anything besides making the output less verbose? The missing values still get parsed as 0. |
@MarcoPolo it is making it less verbose and less confusing for the final user. Now that we know zero values mean default values if the limit is obtained from the config, but real zero if you see that from the final parsed value sent to CM, that change makes even more sense. Example: "Transient": {
"Conns": 0,
"ConnsInbound": 0,
"ConnsOutbound": 0,
"FD": 0,
"Memory": 0,
"Streams": 0,
"StreamsInbound": 0,
"StreamsOutbound": 0
} But when executing {
"Conns": 1000000000,
"ConnsInbound": 157,
"ConnsOutbound": 1000000000,
"FD": 131072,
"Memory": 1083441152,
"Streams": 1000000000,
"StreamsInbound": 1129,
"StreamsOutbound": 1000000000
} Also if for any reason after executing {
"Conns": 0,
"ConnsInbound": 0,
"ConnsOutbound": 0,
"FD": 0,
"Memory": 0,
"Streams": 0,
"StreamsInbound": 0,
"StreamsOutbound": 0
} That means a totally different thing than the values we can see from the configuration because in that case, they are real zeroes, not undefined. |
Also consider that a use case that went into the design of those commands was to be able to copy-and-paste between the commands. |
We're going to remove this command as part of #9621 . As a result closing as not planned. |
Checklist
Installation method
ipfs-desktop
Version
Config
-
Description
When executing
ipfs swarm limit <scope> --reset
the expected output configuration should be:Bit it is:
To fix this we have to use a new Limit struct that ignores zero values when encoding to JSON, this will avoid all unwanted zero values on our config file.
This can be done at libp2p level, adding the
json:"omitempty"
tag, or duplicating the struct on kubo side wrapping the actual one but adding these JSON tags.The text was updated successfully, but these errors were encountered: