Repository navigation
keep the staking keys and client wallet of the previous node version on plugin update - #73
Merged
Merged
Conversation
28 of 44 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Each node version runs from its own folder (
node-massa/MAIN.5.0,node-massa/DEVN.30.0, …), which also holds the node staking keys (massa-node/config/staking_wallets) and the client wallet (massa-client/wallets). When the plugin is updated with new node versions, Station unzips the new folders next to the old ones, and the plugin deletes the old ones at startup (RemoveOldNodeVersionsArtifacts). So after every update:cleanAddressesNotInNodeButInDBdeletes the rolls targets of these addresses from the database;All stakers go through this with the MAIN.5.1 release (#72): nodes not on MAIN.5.1 stop following mainnet at MIP-0002 activation.
What
MigrateNodeVersionsDataruns at startup, before the old version folders are removed. For each network, it copiesmassa-node/config/staking_walletsandmassa-client/walletsfrom the highest previous version folder of that network (MAIN.*orDEVN.*) into the current one.The files stay encrypted with the node password, so the node keeps staking the same addresses with the same password, and the rolls targets in the database are kept.
Tests
MAIN.4.10>MAIN.4.2).DEVN.30.0) with a client wallet, the same key in the node staking wallets, and a rolls target of 3 in the database. The DEVN.30.0 node itself no longer runs on buildnet: it bootstraps, then stops with "Please update your Massa node to support MIP version 2".DEVN.30.2folder unzipped next toDEVN.30.0.DEVN.30.2andDEVN.30.0is removed. The node starts with the previous password, bootstraps,node_get_staking_addressesreturns the address, andGET /api/stakingAddresseslists it withtarget_rolls: 3.