ignite / cli

Ignite is a CLI tool and hub designed for constructing Proof of Stake Blockchains rooted in Cosmos-SDK
https://ignite.com
Other
1.26k stars 549 forks source link

Running an upgraded binary resets the state #1955

Open migueldingli1997 opened 2 years ago

migueldingli1997 commented 2 years ago

Describe the bug I'm trying to serve a chain with a proposed upgrade plan (x/upgrade module) which gets triggered and pauses the chain. After this I serve a new chain with an upgrade handler for the proposed upgrade, so that the upgrade gets fulfilled. However, serving the new chain without -r or -f flags specified still causes the state to be reset, with no error shown.

I would like my state to be kept so that the chain continues where it left off. If I bypass Starport and run the updated binary from my IDE, the upgrade goes through without issues.

To Reproduce Steps to reproduce the behavior:

  1. I set up a project with two Starport config files, two main modules, and two app.go's such that version 1 of the app uses the first main and app.go and version 2 of the app uses the second main and app.go. The only difference between the two Starport config files is the build.main entry, one of which points to the first main module and the other points to the second main module.
  2. starport chain serve --config config-1.yml --reset-once
  3. Submit a software upgrade proposal, vote yes, and wait for the upgrade height to be reached, which causes the chain to pause
  4. Stop the chain
  5. starport chain serve --config config-2.yml
  6. The output I get is:
Cosmos SDK's version is: stargate - v0.44.3

🔄 Resetting the app state...    # I would not like this to happen
🛠️  Building proto...
...

Please provide the version output

I'm running v0.18.6:

Starport version:       development
Starport build date:    2021-12-16T22:16:47
Starport source hash:   3bb9210c5aa7a9642f650b21c4a53e7b55279144
Your OS:                linux
Your arch:              amd64
Your go version:        go version go1.16.4 linux/amd64
Your uname -a:          //
Your cwd:               //
Is on Gitpod:           false
migueldingli1997 commented 2 years ago

I'm guessing the problem is just that starport resets the state if you run the chain using a different config file or one which is pointing to a different main.go