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

V17 upgrade handler #1029

Merged
merged 26 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d546f72
added shell for upgrade handler
sampocs Dec 14, 2023
dc60756
first pass at upgrade handler
sampocs Dec 14, 2023
9fc442b
first pass at upgrade handler
sampocs Dec 14, 2023
f2e1fff
Merge branch 'main' into v17-upgrade-handler
sampocs Dec 14, 2023
9b7bf0d
Merge branch 'v17-upgrade-handler' of github.com:Stride-Labs/stride i…
sampocs Dec 14, 2023
040d093
added unit tests
sampocs Dec 19, 2023
d5648a8
add unit test for full upgrade
sampocs Dec 19, 2023
9ced924
updated rate limits
sampocs Dec 19, 2023
e95161d
nit comments
sampocs Dec 20, 2023
70ce965
Update app/upgrades/v17/upgrades.go
sampocs Jan 9, 2024
4871a9c
updated rate limits
sampocs Jan 9, 2024
1926074
Merge branch 'v17-upgrade-handler' of github.com:Stride-Labs/stride i…
sampocs Jan 9, 2024
71e9917
removed inner RR updates
sampocs Jan 9, 2024
9424189
nit
sampocs Jan 9, 2024
d7204b8
added param migration
sampocs Jan 9, 2024
6d9b9ab
Merge branch 'main' into v17-upgrade-handler
sampocs Jan 9, 2024
e8f2d0a
Add Prop 225 to v17 Upgrade Handler (#1044)
shellvish Jan 9, 2024
f65bae9
send disable tokenization tx for delegation account on hub (#1045)
ethan-stride Jan 11, 2024
4c199dc
fixed unit test
sampocs Jan 11, 2024
ccedebe
Merge branch 'v17-upgrade-handler' of github.com:Stride-Labs/stride i…
sampocs Jan 11, 2024
d52d789
Merge branch 'main' into v17-upgrade-handler
sampocs Jan 11, 2024
8fbd60a
added pfm store key
sampocs Jan 11, 2024
6e92ff0
addressed aidan PR comments
sampocs Jan 11, 2024
5f546ec
nit
sampocs Jan 11, 2024
37251be
fixed upgrade handler unit tests
sampocs Jan 11, 2024
ba8e948
Merge branch 'main' into v17-upgrade-handler
sampocs Jan 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/apptesting/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ func (s *AppTestHelper) SetupIBCChains(hostChainID string) {

// Call InitGenesis on the consumer
s.StrideChain.App.(*app.StrideApp).GetConsumerKeeper().InitGenesis(s.StrideChain.GetContext(), &strideConsumerGenesis)
s.StrideChain.NextBlock()

// Update coordinator
s.Coordinator.Chains = map[string]*ibctesting.TestChain{
Expand Down Expand Up @@ -526,7 +527,11 @@ func (s *AppTestHelper) MockICAChannel(connectionId, channelId, owner, address s

func (s *AppTestHelper) ConfirmUpgradeSucceededs(upgradeName string, upgradeHeight int64) {
s.Ctx = s.Ctx.WithBlockHeight(upgradeHeight - 1)
plan := upgradetypes.Plan{Name: upgradeName, Height: upgradeHeight}
plan := upgradetypes.Plan{
Name: upgradeName,
Height: upgradeHeight,
}

err := s.App.UpgradeKeeper.ScheduleUpgrade(s.Ctx, plan)
s.Require().NoError(err)
_, exists := s.App.UpgradeKeeper.GetUpgradePlan(s.Ctx)
Expand Down
27 changes: 21 additions & 6 deletions app/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
crisistypes "github.com/cosmos/cosmos-sdk/x/crisis/types"
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types"
consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types"
evmosvestingtypes "github.com/evmos/vesting/x/vesting/types"

Expand All @@ -20,6 +21,7 @@ import (
v14 "github.com/Stride-Labs/stride/v16/app/upgrades/v14"
v15 "github.com/Stride-Labs/stride/v16/app/upgrades/v15"
v16 "github.com/Stride-Labs/stride/v16/app/upgrades/v16"
v17 "github.com/Stride-Labs/stride/v16/app/upgrades/v17"
v2 "github.com/Stride-Labs/stride/v16/app/upgrades/v2"
v3 "github.com/Stride-Labs/stride/v16/app/upgrades/v3"
v4 "github.com/Stride-Labs/stride/v16/app/upgrades/v4"
Expand Down Expand Up @@ -216,6 +218,20 @@ func (app *StrideApp) setupUpgradeHandlers(appOpts servertypes.AppOptions) {
),
)

// v17 upgrade handler
app.UpgradeKeeper.SetUpgradeHandler(
asalzmann marked this conversation as resolved.
Show resolved Hide resolved
v17.UpgradeName,
v17.CreateUpgradeHandler(
app.mm,
app.configurator,
app.BankKeeper,
app.DistrKeeper,
app.InterchainqueryKeeper,
app.RatelimitKeeper,
app.StakeibcKeeper,
),
)

upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
if err != nil {
panic(fmt.Errorf("Failed to read upgrade info from disk: %w", err))
Expand Down Expand Up @@ -256,13 +272,12 @@ func (app *StrideApp) setupUpgradeHandlers(appOpts servertypes.AppOptions) {
storeUpgrades = &storetypes.StoreUpgrades{
Added: []string{evmosvestingtypes.ModuleName},
}
case "v17":
storeUpgrades = &storetypes.StoreUpgrades{
// Add PFM store key
Added: []string{packetforwardtypes.ModuleName},
}
}
// TODO: uncomment when v17 upgrade is ready
// case "v17":
// storeUpgrades = &storetypes.StoreUpgrades{
// // Add PFM store key
// Added: []string{packetforwardtypes.ModuleName},
// }

if storeUpgrades != nil {
app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, storeUpgrades))
Expand Down
Loading
Loading