-
Notifications
You must be signed in to change notification settings - Fork 58
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
chore(rln-relay): make account address optional #1258
Conversation
Jenkins BuildsClick to see older builds (6)
|
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.
LGTM.
ethClientAddr = conf.rlnRelayEthClientAddress | ||
ethMemContractAddress = web3.fromHex(web3.Address, conf.rlnRelayEthContractAddress) | ||
var ethAccountPrivKeyOpt = none(keys.PrivateKey) | ||
if conf.rlnRelayEthAccountPrivateKey != "": | ||
var ethAccountAddressOpt = none(Address) | ||
if conf.rlnRelayEthAccountPrivateKey != "" and conf.rlnRelayCredPath != "": |
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.
Why do you require rlnRelayCredPath to be non-empty to populate ethereum private and public keys?
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.
we don't need to populate those fields if the credential path is passed in. ideally we would do this check after verifying the contents of the credentials file.
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.
Based on what you said it should then be something like
if conf.rlnRelayCredPath == "":
if conf.rlnRelayEthAccountPrivateKey != "":
load key
else:
raise error
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.
Addressed in 42d0749. If the credential path is non empty, and the credentials are valid we do not make use of the private key.
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.
LGTM!
@@ -1052,7 +1053,7 @@ proc mountRlnRelayStatic*(node: WakuNode, | |||
|
|||
proc mountRlnRelayDynamic*(node: WakuNode, | |||
ethClientAddr: string = "", | |||
ethAccAddr: web3.Address, | |||
ethAccountAddress: Option[web3.Address] = none(web3.Address), |
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.
When an input is optional, it is good to add the Opt
suffix to its name.
Should resolve #1116 and by extension #1221
This PR removes the need to always pass in an account address. While it can be derived from the private
key, we use field temporarily. It will be removed in a subsequent PR.
Now, while restarting chat2/wakunode2 with persisted credentials, you can omit
rln-relay-eth-account-address
andrln-relay-eth-private-key
.Additionally, some consistent naming has been introduced.