Skip to content

Commit

Permalink
feat(cosmos): Next upgrade is agoric-upgrade-18 (#10361)
Browse files Browse the repository at this point in the history
## Description
Bumps the upgrade handler in golang/cosmos and renames
a3p-integration/proposals/n:upgrade-next ->
a3p-integration/proposals/a:upgrade-18 as per the [naming
conventions](https://github.com/Agoric/agoric-3-proposals#naming).
`agoricSyntheticChain` already points to `use-upgrade-17` and not sure
about `s:stake-bld` and `z:acceptance` so have left them as is.

### Security Considerations
n/a

### Scaling Considerations
n/a

### Documentation Considerations
Will be provided with full release

### Testing Considerations
a3p-integration tests already included

### Upgrade Considerations
next chain software upgrade
  • Loading branch information
mujahidkay authored Oct 31, 2024
1 parent a0f4883 commit 6ddbef0
Show file tree
Hide file tree
Showing 24 changed files with 31 additions and 39 deletions.
9 changes: 9 additions & 0 deletions a3p-integration/proposals/a:upgrade-18/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Proposal to upgrade the chain software

This holds the draft proposal for agoric-upgrade-18, which will be added to
[agoric-3-proposals](https://github.com/Agoric/agoric-3-proposals) after it
passes.

The "binaries" property of `upgradeInfo` is now required since Cosmos SDK 0.46,
however it cannot be computed for an unreleased upgrade. To disable the check,
`releaseNotes` is set to `false`.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
"agoricProposal": {
"releaseNotes": false,
"sdkImageTag": "unreleased",
"planName": "UNRELEASED_A3P_INTEGRATION",
"planName": "agoric-upgrade-18-a3p",
"upgradeInfo": {
"coreProposals": []
"coreProposals": [],
"releaseNotes": false
},
"type": "Software Upgrade Proposal"
},
Expand Down
14 changes: 0 additions & 14 deletions a3p-integration/proposals/n:upgrade-next/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion golang/cosmos/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ func NewAgoricApp(
for _, name := range upgradeNamesOfThisVersion {
app.UpgradeKeeper.SetUpgradeHandler(
name,
unreleasedUpgradeHandler(app, name),
upgrade18Handler(app, name),
)
}

Expand Down
40 changes: 18 additions & 22 deletions golang/cosmos/app/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ import (
)

var upgradeNamesOfThisVersion = []string{
"UNRELEASED_BASIC", // no-frills
"UNRELEASED_A3P_INTEGRATION",
"UNRELEASED_main",
"UNRELEASED_devnet",
"UNRELEASED_emerynet",
"UNRELEASED_REAPPLY",
"agoric-upgrade-18-mainnet",
"agoric-upgrade-18-devnet",
"agoric-upgrade-18-emerynet",
"agoric-upgrade-18-basic",
"agoric-upgrade-18-a3p",
}

// isUpgradeNameOfThisVersion returns whether the provided plan name is a
Expand Down Expand Up @@ -53,14 +52,12 @@ func isPrimaryUpgradeName(name string) bool {
return false
}
switch name {
case validUpgradeName("UNRELEASED_BASIC"),
validUpgradeName("UNRELEASED_A3P_INTEGRATION"),
validUpgradeName("UNRELEASED_main"),
validUpgradeName("UNRELEASED_devnet"),
validUpgradeName("UNRELEASED_emerynet"):
case validUpgradeName("agoric-upgrade-18-mainnet"),
validUpgradeName("agoric-upgrade-18-devnet"),
validUpgradeName("agoric-upgrade-18-emerynet"),
validUpgradeName("agoric-upgrade-18-basic"),
validUpgradeName("agoric-upgrade-18-a3p"):
return true
case validUpgradeName("UNRELEASED_REAPPLY"):
return false
default:
panic(fmt.Errorf("unexpected upgrade name %s", validUpgradeName(name)))
}
Expand Down Expand Up @@ -109,17 +106,16 @@ func buildProposalStepWithArgs(moduleName string, entrypoint string, opts map[st

func getVariantFromUpgradeName(upgradeName string) string {
switch upgradeName {
case "UNRELEASED_A3P_INTEGRATION":
return "A3P_INTEGRATION"
case "UNRELEASED_main":
case "agoric-upgrade-18-mainnet":
return "MAINNET"
case "UNRELEASED_devnet":
case "agoric-upgrade-18-devnet":
return "DEVNET"
case "UNRELEASED_emerynet":
case "agoric-upgrade-18-emerynet":
return "EMERYNET"
// Noupgrade for this version.
case "UNRELEASED_BASIC":
case "agoric-upgrade-18-basic":
return ""
case "agoric-upgrade-18-a3p":
return "A3P_INTEGRATION"
default:
return ""
}
Expand Down Expand Up @@ -157,8 +153,8 @@ func replacePriceFeedsCoreProposal(upgradeName string) (vm.CoreProposalStep, err
)
}

// unreleasedUpgradeHandler performs standard upgrade actions plus custom actions for the unreleased upgrade.
func unreleasedUpgradeHandler(app *GaiaApp, targetUpgrade string) func(sdk.Context, upgradetypes.Plan, module.VersionMap) (module.VersionMap, error) {
// upgrade18Handler performs standard upgrade actions plus custom actions for upgrade-18.
func upgrade18Handler(app *GaiaApp, targetUpgrade string) func(sdk.Context, upgradetypes.Plan, module.VersionMap) (module.VersionMap, error) {
return func(ctx sdk.Context, plan upgradetypes.Plan, fromVm module.VersionMap) (module.VersionMap, error) {
app.CheckControllerInited(false)

Expand Down

0 comments on commit 6ddbef0

Please sign in to comment.