-
Notifications
You must be signed in to change notification settings - Fork 116
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
feat: add zetaclientd-supervisor #2113
Conversation
4299c39
to
f167c6a
Compare
35f7a86
to
d8ad7df
Compare
!!!WARNING!!! Be very careful about using Only suppress a single rule (or a specific set of rules) within a section of code, while continuing to scan for other problems. To do this, you can list the rule(s) to be suppressed within the #nosec annotation, e.g: /* #nosec G401 */ or //#nosec G201 G202 G203 Pay extra attention to the way |
d8ad7df
to
ead518f
Compare
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 ,
NIT : comments before every function might be useful, not required but definitely good to have
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 good to me and will be very useful.
Regarding
cache the hotkey and tss password so that it only needs to be input once even if zetaclientd restarts/crashes
Caching here means it is kept as a local variable in the function and reused? Doesn't it bring some security concerns if someone can dump the memory?
ccing @CharlieMc0
9c8e14f
to
88aa40a
Compare
Today, you could just dump the zetaclient process memory. We make no efforts to zero the memory/variables we use to store the password in zetaclient. |
Yeah the risk of someone dumping memory already exists because zetaclient has to hold the key in memory unencrypted. It's already cached in memory while zetaclient is running. The only difference here is the supervisor also caches it between restarts. |
Description
Add a
zetaclientd-supervisor
process which will watch the version ofzetacored
and automatically restart zetaclient if the version changes. When the version has changed, cosmovisor will have already downloaded and symlinked in the newzetaclientd
binary so all we need to do is restart to pick up the new change.We are careful to do a few things:
zetaclientd-supervisor
tozetaclientd
zetaclientd
subprocess are not interleaved with thezetaclientd-supervisor
logs messagesIf we decide not to rely on cosmovisor autodownload for delivery of thezetaclientd
binary, we would have to add autodownload/upgrade functionality to this process as well. That logic isn't terribly complex but great care must be taken to ensure the download is performed correctly. We would retrieve the binaries by grabbing the current upgrade plan from zetacore via rpc.Automatic download and symlinking like cosmovisor has now been added. The new zetaclient binary will automatically be downloaded and loaded when the zetacored version changes.
This is functional in the localnet docker images and upgrade tests. Example with v16 -> v17 -> v18 (dummy release delivered via upgrade info binary urls):
Relates to DEVOP-642
Degraded without #2135
How Has This Been Tested?
Checklist: