-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Feature]: Have multiple upgrades in upgrade-info.json and support it in Cosmovisor #20630
Comments
Apps currently set store loaders like this: for _, upgrade := range Upgrades {
if upgradeInfo.Name == upgrade.UpgradeName {
storeUpgrades := upgrade.StoreUpgrades
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades))
}
} which needs to be changed if we were to not restart the binary. We need to set the next upgrade's store loader after the previous upgrade is complete. Additionally, we would need to modify the pre-mature handler check in the upgrade module // if we have a pending upgrade, but it is not yet time, make sure we did not
// set the handler already
if k.HasHandler(plan.Name) {
downgradeMsg := fmt.Sprintf("BINARY UPDATED BEFORE TRIGGER! UPGRADE \"%s\" - in binary but not executed on chain. Downgrade your binary", plan.Name)
ctx.Logger().Error(downgradeMsg)
panic(downgradeMsg)
} to allow setting upgrade handlers before their upgrade heights (as an option). |
Seeing as this is currently unassigned, I'd be willing to take this on. |
Changing the I'd say we actually shouldn't change the |
That makes sense to me. Would it be preferable to change the
Or would it be better to add a new command entirely? Something like |
I like |
Yep, I'm willing to take this on. |
Hello, I spent some time trying to map out a way to implement this feature and wrote some prototype code, here's how I see it:
|
Summary
It would be lovely to have upgrade-info.json as an array of objects instead of a single object, storing the info on multiple upcoming upgrades.
Problem Definition
Imagine a life of a person maintaining an archive node and willing to sync it from scratch, and a case when there are multiple consequent non-governance upgrade via halt-height. For simplicity let's say there's a chain which only had 2 halt-height upgrades and 0 governance ones.
Here's the sequence of steps that a person willing to sync an archive node from scratch should do (with Cosmovisor latest version:
If this person forgets to do step 4 or fails to do so because of any reason (for example, the window between two upgrades being too small), then their node would result in AppHash error due to consensus mismatch.
Therefore, it'd be nice to be able to allow to stage multiple upgrades on upgrade-info.json.
As a result of this, a node operator would be able to build and stage all upgrades at once and then just chill and wait until the node is synced without any need to do anything extra during the sync process.
Proposed Feature
This is how I see it:
The text was updated successfully, but these errors were encountered: