-
Notifications
You must be signed in to change notification settings - Fork 672
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
Migration logic for 09-localhost removal #1201
Comments
The migration logic should iterate through all client states and check if the clientID matches "localhost". The idea is to remove any existing localhost client (if it was created). Note there can only be one localhost client, so the could may break early if it is found and deleted. Upgrade handler migationThe consensus version needs to be incremented to indicate that upgrade migrations should be ran. Register the migration. Add the migrator. In 02-client as well. Write the migration code. Iterate over the clients, when localhost is found, delete the client/consensus state for it. Please write good tests. Genesis migrationI question whether we need genesis migrations, since there is only 1 localhost. The chain doing a dump state/restart could manually remove the localhost and its associated consensus states (this is assuming a chain ever enabled a localhost client that doesn't function). If we do decide to support genesis migrations. They should be done in a similar way to v1 migrations. Here is the entry point (note, I'd name the directory v5 (or whatever migration this is for) instead of v500. There should be a corresponding function called in 02-client. This should iterate over all the clients and look for a client with the name exported.Localhost. Note, we will need the old localhost proto files generated into this folder and it needs to implement the ClientState interface, in the same way I did for the solomachine. Once you find the localhost, delete it from the genesis and delete all of its consensus states. You'll need to find the consensus states as well Good tests should be written. I ran into many subtle bugs writing the previous migration code for v1 |
Flagged with |
Summary
As part of the removal of
09-localhost
light client implementation, we need to add migration logic in order to delete any localhost existing in the client store.The following should be done in two separate PRs:
For Admin Use
The text was updated successfully, but these errors were encountered: