Skip to content
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

[Bug]: Forks are fail when objects get changes (number OR name of the properties of an object) #17103

Closed
golnar-m opened this issue Jul 24, 2023 · 2 comments
Labels

Comments

@golnar-m
Copy link

golnar-m commented Jul 24, 2023

Summary of Bug

We have an issue. We've stored some objects in the kvstore and in our testnet some clients started to use our blockchain.

Now we changed 2 of the objects, for one of them we increased the number of the properties and the second object we changed the name of a property.

Now, we have a problem with already registered clients, we can not Get Client Object after these changes. Because they are forked from the previous client object.

Version

v0.45.5

Steps to Reproduce

1- Pull the new code
2- Build the binary
3- The new binary will be replaced with the old one
4- And when we do soarchaind start again the new binary will run with the already saved data which is a "hard fork" basically.
5-Because object is changed (for example the name of the object changed from index ---> pubkey ) we got error for fetching the data.

@golnar-m golnar-m added the T:Bug label Jul 24, 2023
@facundomedica
Copy link
Member

I'm not 100% sure I understood the problem here, but it sounds like you are missing a migration.
Every time you do a state breaking change, you must do a migration in which you basically go through your previous version's data and re-write it in the new version format. See here https://docs.cosmos.network/main/core/upgrade

If this is not what you are looking for, please add more details (like actual examples of the objects you've changed and the error you are getting)

@golnar-m
Copy link
Author

@facundomedica Thank you. That was the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants