-
Notifications
You must be signed in to change notification settings - Fork 57
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
Fix nim-waku config inconsistencies #543
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me, thanks! I'd like to hear what Nimbus people think though, as it'd probably be a good idea to have this be roughly consistent across nim-waku, nimbus, nim-libp2p etc
Requesting review from @kdeme as he looked into this before, but @zah or @dryajov might also have some thoughts here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know much Nim, but the name changes make sense to me.
|
||
staticnodes* {. | ||
desc: "Multiaddr of peer to directly connect with. Argument may be repeated" | ||
name: "staticnodes" }: seq[string] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use this singular typically because of the way it works in confutils. At CLI it expects the usage as such --staticnode:... --staticnode:...
for multiple staticnodes.
The actual variable can be plural as it holds the full provided list in a seq
.
So to me it makes more sense like this from a UX PoV. It would be different when the CLI would expect a comma separated list. I've seen some users making that error in the past actually, trying to provide the comma separated list when it was called --staticnodes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good point. As long as --help
clearly indicates that it can be used multiple times.
It would also match how flags like these are named in Nimbus:
https://github.com/status-im/nimbus-eth2/blob/e1a8049e/beacon_chain/conf.nim#L109-L111
https://github.com/status-im/nimbus-eth2/blob/e1a8049e/beacon_chain/conf.nim#L314-L316
waku/common/config_bridge.nim
Outdated
|
||
staticnodesV1* {. | ||
desc: "Enode URL to directly connect with. Argument may be repeated" | ||
name: "staticnodes-v1" .}: seq[string] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem above
waku/common/config_bridge.nim
Outdated
|
||
staticnodesV2* {. | ||
desc: "Multiaddr of peer to directly connect with. Argument may be repeated" | ||
name: "staticnodes-v2" }: seq[string] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem
waku/v2/node/config.nim
Outdated
|
||
staticnodes* {. | ||
desc: "Peer multiaddr to directly connect with. Argument may be repeated." | ||
name: "staticnodes" }: seq[string] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem
I agree with most of this, as being cleaner & nicer looking. Except probably point 3., see review. For reference, in nimbus-eth2 we are also mostly following these rules I think. But for 3. we also keep it in singular. I quickly checked nimbus-eth1, story is a bit different there as rule 2 is not really followed. This probably stems from taking over most cli arguments from geth. |
Update: I've reverted changing |
Background
This PR partially addresses #540. It fixes some inconsistencies in the naming of Waku v2 config items. It is the first of three steps necessary to change CLI parameters without breaking existing deployments.
Step 1 (this PR):
Add new, consistent config items in such a way that we still support the current items. In other words, keep the old CLI parameters intact. Refactor existing field names by postfixing them with
_depr
. This will mark them for removal inStep 3
.Step 2:
Propagate changes to existing deployments:
prod
andtest
fleetsnim-waku
clients, such as WalletConnectStep 3:
Remove deprecated config items from the codebase.
Conventions followed
I've tried adhering to the following conventions:
persist-peers
should look similar topersist-messages
)staticnodes
tostaticnode
)log-metrics
tometrics-logging
to be consistent with othermetrics
config items)Summary of changes
The following CLI parameters have changed. The old parameters will be deprecated and removed in
Step 3
:For
wakunode2
,chat2
andchat2bridge
UPDATE: this would make it inconsistent with Waku v1. Reverted in 455edeanodekey
changed tonode-key
dbpath
changed todb-path
peerpersist
changed topersist-peers
rlnrelay
changed torln-relay
UPDATE: reverted in f4dd214. Reasoning herestaticnode
changed tostaticnodes
log-metrics
changed tometrics-logging
For
wakubridge
All items overlapping with the above list, with the following additions
fleetv1
changed tofleet-v1
staticnodev1
changed tostaticnode-v1
nodekeyv1
changed tonode-key-v1
staticnodev2
changed tostaticnode-v2
nodekeyv2
changed tonode-key-v2
What has not changed?
The concepts
staticnodes
,filternode
andstorenode
are such tight concepts that I did not consider them as composites of two words. In other words, the config parameters were not changed tofilter-node
,store-node
orstatic-nodes
.