From 5d61e4d5b9e96ebe1d710c28508622484e32e912 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 11:47:36 +0000 Subject: [PATCH 01/34] replace rdk with local version --- go.mod | 2 ++ go.sum | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 0bfea21..506b724 100644 --- a/go.mod +++ b/go.mod @@ -366,3 +366,5 @@ replace ( github.com/osmosis-labs/osmosis/v15 => github.com/dymensionxyz/osmosis/v15 v15.2.0-dymension-v1.1.2 github.com/tendermint/tendermint => github.com/dymensionxyz/cometbft v0.34.29-0.20241128205759-2a9d5f015da5 ) + +replace github.com/dymensionxyz/dymension-rdk => /Users/danwt/Documents/dym/d-dymension-rdk diff --git a/go.sum b/go.sum index 82b2714..aea0fae 100644 --- a/go.sum +++ b/go.sum @@ -577,8 +577,6 @@ github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73 h1:A0O github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73/go.mod h1:VPUuzF+l+ekSGPV7VVB8m0OMQfwp3QdKWNZjvkU3A1U= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd h1:V89QyOFM84o9w0iFdctMU6So8SS/Xt32JWAXGqJduT0= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd/go.mod h1:3weqpVj/TqTFpC0LjEB3H+HZSpm7BrQ1QkEg1Ahy6KY= -github.com/dymensionxyz/dymension-rdk v1.8.0-rc02 h1:HLWcGucC0t325IsnTlgJDt0JuBqlfDLXFApj7JAvDjE= -github.com/dymensionxyz/dymension-rdk v1.8.0-rc02/go.mod h1:p9rl2xNsbubJcxGnTIVF9D8aKAM+oPkCVdQ6Z6PM2Tw= github.com/dymensionxyz/dymint v1.3.0-rc03 h1:JRAGrLDMdM642lbcnIgRp3iuHhvLkq0z6LWKZlWLQyI= github.com/dymensionxyz/dymint v1.3.0-rc03/go.mod h1:C3VbfePK85aRCdA1iHzB2AYD+n1gKR9Pw+wm3wQUXvE= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.5.0-rc02 h1:G6rtzFNnzeYOHN33rkw0kMQX+xRantRLTip1AMXYmBg= From f066ca375e5183960accc567c8aa19db2cc56314 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 11:49:44 +0000 Subject: [PATCH 02/34] adds a foo upgrade --- app/app.go | 7 ++++--- app/upgrades/foo/constants.go | 17 +++++++++++++++ app/upgrades/foo/upgrade.go | 39 +++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 app/upgrades/foo/constants.go create mode 100644 app/upgrades/foo/upgrade.go diff --git a/app/app.go b/app/app.go index e657721..4673883 100644 --- a/app/app.go +++ b/app/app.go @@ -164,6 +164,7 @@ import ( drs3 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-3" drs4 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-4" drs5 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-5" + foo "github.com/dymensionxyz/rollapp-evm/app/upgrades/foo" ) const ( @@ -189,7 +190,7 @@ var ( erc20types.StoreKey, } // Upgrades contains the upgrade handlers for the application - Upgrades = []upgrades.Upgrade{drs2.Upgrade, drs3.Upgrade, drs4.Upgrade, drs5.Upgrade} + Upgrades = []upgrades.Upgrade{drs2.Upgrade, drs3.Upgrade, drs4.Upgrade, drs5.Upgrade, foo.Upgrade} ) func getGovProposalHandlers() []govclient.ProposalHandler { @@ -463,7 +464,7 @@ func NewRollapp( ) app.MintKeeper.SetHooks( minttypes.NewMultiMintHooks( - // insert mint hooks receivers here + // insert mint hooks receivers here ), ) @@ -556,7 +557,7 @@ func NewRollapp( app.GovKeeper = *govKeeper.SetHooks( govtypes.NewMultiGovHooks( - // register the governance hooks + // register the governance hooks ), ) diff --git a/app/upgrades/foo/constants.go b/app/upgrades/foo/constants.go new file mode 100644 index 0000000..d702aa3 --- /dev/null +++ b/app/upgrades/foo/constants.go @@ -0,0 +1,17 @@ +package drs5 + +import ( + storetypes "github.com/cosmos/cosmos-sdk/store/types" + + "github.com/dymensionxyz/rollapp-evm/app/upgrades" +) + +const ( + UpgradeName = "foo" +) + +var Upgrade = upgrades.Upgrade{ + Name: UpgradeName, + CreateHandler: CreateUpgradeHandler, + StoreUpgrades: storetypes.StoreUpgrades{}, +} diff --git a/app/upgrades/foo/upgrade.go b/app/upgrades/foo/upgrade.go new file mode 100644 index 0000000..58f9fbc --- /dev/null +++ b/app/upgrades/foo/upgrade.go @@ -0,0 +1,39 @@ +package drs5 + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + rollappparamskeeper "github.com/dymensionxyz/dymension-rdk/x/rollappparams/keeper" + evmkeeper "github.com/evmos/evmos/v12/x/evm/keeper" + + drs4 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-4" +) + +func CreateUpgradeHandler( + rpKeeper rollappparamskeeper.Keeper, + evmKeeper *evmkeeper.Keeper, + mm *module.Manager, + configurator module.Configurator, +) upgradetypes.UpgradeHandler { + return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + if err := HandleUpgrade(ctx, rpKeeper, evmKeeper); err != nil { + return nil, err + } + return mm.RunMigrations(ctx, configurator, fromVM) + } +} + +func HandleUpgrade(ctx sdk.Context, rpKeeper rollappparamskeeper.Keeper, evmKeeper *evmkeeper.Keeper) error { + if rpKeeper.Version(ctx) < 4 { + // first run drs-4 migration + if err := drs4.HandleUpgrade(ctx, rpKeeper, evmKeeper); err != nil { + return err + } + } + // upgrade drs to 5 + if err := rpKeeper.SetVersion(ctx, uint32(5)); err != nil { + return err + } + return nil +} From 65569cc1306b419684831b0f05d2ffe2676d38c7 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 11:50:07 +0000 Subject: [PATCH 03/34] removes busted code --- app/app.go | 4 ++-- app/upgrades/foo/upgrade.go | 20 +------------------- 2 files changed, 3 insertions(+), 21 deletions(-) diff --git a/app/app.go b/app/app.go index 4673883..c971633 100644 --- a/app/app.go +++ b/app/app.go @@ -464,7 +464,7 @@ func NewRollapp( ) app.MintKeeper.SetHooks( minttypes.NewMultiMintHooks( - // insert mint hooks receivers here + // insert mint hooks receivers here ), ) @@ -557,7 +557,7 @@ func NewRollapp( app.GovKeeper = *govKeeper.SetHooks( govtypes.NewMultiGovHooks( - // register the governance hooks + // register the governance hooks ), ) diff --git a/app/upgrades/foo/upgrade.go b/app/upgrades/foo/upgrade.go index 58f9fbc..b18d632 100644 --- a/app/upgrades/foo/upgrade.go +++ b/app/upgrades/foo/upgrade.go @@ -6,8 +6,6 @@ import ( upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" rollappparamskeeper "github.com/dymensionxyz/dymension-rdk/x/rollappparams/keeper" evmkeeper "github.com/evmos/evmos/v12/x/evm/keeper" - - drs4 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-4" ) func CreateUpgradeHandler( @@ -17,23 +15,7 @@ func CreateUpgradeHandler( configurator module.Configurator, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - if err := HandleUpgrade(ctx, rpKeeper, evmKeeper); err != nil { - return nil, err - } - return mm.RunMigrations(ctx, configurator, fromVM) - } -} -func HandleUpgrade(ctx sdk.Context, rpKeeper rollappparamskeeper.Keeper, evmKeeper *evmkeeper.Keeper) error { - if rpKeeper.Version(ctx) < 4 { - // first run drs-4 migration - if err := drs4.HandleUpgrade(ctx, rpKeeper, evmKeeper); err != nil { - return err - } - } - // upgrade drs to 5 - if err := rpKeeper.SetVersion(ctx, uint32(5)); err != nil { - return err + return mm.RunMigrations(ctx, configurator, fromVM) } - return nil } From de4d041e1dafe10d21f30ad7dd7d879067f2b7a0 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 11:57:47 +0000 Subject: [PATCH 04/34] adds constants for store upgrades --- app/upgrades/foo/constants.go | 23 ++++++++++++++++++++++- app/upgrades/foo/upgrade.go | 1 + 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/app/upgrades/foo/constants.go b/app/upgrades/foo/constants.go index d702aa3..4627782 100644 --- a/app/upgrades/foo/constants.go +++ b/app/upgrades/foo/constants.go @@ -2,8 +2,15 @@ package drs5 import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" + authztypes "github.com/cosmos/cosmos-sdk/x/authz" + "github.com/cosmos/cosmos-sdk/x/feegrant" + hubgenesistypes "github.com/dymensionxyz/dymension-rdk/x/hub-genesis/types" + hubtypes "github.com/dymensionxyz/dymension-rdk/x/hub/types" + rollappparamstypes "github.com/dymensionxyz/dymension-rdk/x/rollappparams/types" + timeupgradetypes "github.com/dymensionxyz/dymension-rdk/x/timeupgrade/types" "github.com/dymensionxyz/rollapp-evm/app/upgrades" + claimstypes "github.com/evmos/evmos/v12/x/claims/types" ) const ( @@ -13,5 +20,19 @@ const ( var Upgrade = upgrades.Upgrade{ Name: UpgradeName, CreateHandler: CreateUpgradeHandler, - StoreUpgrades: storetypes.StoreUpgrades{}, + StoreUpgrades: storetypes.StoreUpgrades{ + Deleted: []string{ + claimstypes.ModuleName, + "denommetadata", // TODO: check + }, + Added: []string{ + authztypes.ModuleName, + feegrant.ModuleName, + timeupgradetypes.ModuleName, + hubtypes.ModuleName, + hubgenesistypes.ModuleName, + rollappparamstypes.ModuleName, + }, + Renamed: []storetypes.StoreRename{}, + }, } diff --git a/app/upgrades/foo/upgrade.go b/app/upgrades/foo/upgrade.go index b18d632..2eea05c 100644 --- a/app/upgrades/foo/upgrade.go +++ b/app/upgrades/foo/upgrade.go @@ -15,6 +15,7 @@ func CreateUpgradeHandler( configurator module.Configurator, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + l := ctx.Logger().With("upgrade", UpgradeName) return mm.RunMigrations(ctx, configurator, fromVM) } From 3ba96c88cf89b43f89d985eb684b7fcac47a5743 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 11:58:58 +0000 Subject: [PATCH 05/34] removes a todo --- app/upgrades/foo/constants.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/upgrades/foo/constants.go b/app/upgrades/foo/constants.go index 4627782..67e842d 100644 --- a/app/upgrades/foo/constants.go +++ b/app/upgrades/foo/constants.go @@ -23,7 +23,7 @@ var Upgrade = upgrades.Upgrade{ StoreUpgrades: storetypes.StoreUpgrades{ Deleted: []string{ claimstypes.ModuleName, - "denommetadata", // TODO: check + "denommetadata", }, Added: []string{ authztypes.ModuleName, From d0c782cd343bb540e5dc109790c6b26289931e1e Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 15:51:06 +0000 Subject: [PATCH 06/34] rename package to foo --- app/upgrades/foo/constants.go | 2 +- app/upgrades/foo/upgrade.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/upgrades/foo/constants.go b/app/upgrades/foo/constants.go index 67e842d..4df7b32 100644 --- a/app/upgrades/foo/constants.go +++ b/app/upgrades/foo/constants.go @@ -1,4 +1,4 @@ -package drs5 +package foo import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" diff --git a/app/upgrades/foo/upgrade.go b/app/upgrades/foo/upgrade.go index 2eea05c..968dfd3 100644 --- a/app/upgrades/foo/upgrade.go +++ b/app/upgrades/foo/upgrade.go @@ -1,4 +1,4 @@ -package drs5 +package foo import ( sdk "github.com/cosmos/cosmos-sdk/types" From 191c5e3b6dd68ecbbccc28d4b8068d7000f71a5c Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 15:54:12 +0000 Subject: [PATCH 07/34] removes renamed --- app/upgrades/foo/constants.go | 1 - 1 file changed, 1 deletion(-) diff --git a/app/upgrades/foo/constants.go b/app/upgrades/foo/constants.go index 4df7b32..d617eaf 100644 --- a/app/upgrades/foo/constants.go +++ b/app/upgrades/foo/constants.go @@ -33,6 +33,5 @@ var Upgrade = upgrades.Upgrade{ hubgenesistypes.ModuleName, rollappparamstypes.ModuleName, }, - Renamed: []storetypes.StoreRename{}, }, } From 8890b52209670574b27b82804f563da28005787e Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 15:56:47 +0000 Subject: [PATCH 08/34] pre change upgrade sig From 0323b5b83889d163c21cf4d6d9ce07b8ad5573cd Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:10:51 +0000 Subject: [PATCH 09/34] partially add new keeper params, and start implementing the hub genesis migration --- app/app.go | 17 ++++++++++------- app/upgrades/drs-2/upgrade.go | 2 -- app/upgrades/drs-3/upgrade.go | 6 +++--- app/upgrades/drs-4/upgrade.go | 3 +-- app/upgrades/drs-5/upgrade.go | 3 +-- app/upgrades/foo/upgrade.go | 14 ++++++++++---- app/upgrades/types.go | 10 ++++++++-- 7 files changed, 33 insertions(+), 22 deletions(-) diff --git a/app/app.go b/app/app.go index c971633..bb90d7c 100644 --- a/app/app.go +++ b/app/app.go @@ -1143,12 +1143,15 @@ func (app *App) setupUpgradeHandlers() { } } -func (app *App) setupUpgradeHandler(upgrade upgrades.Upgrade) { +func (app *App) setupUpgradeHandler(u upgrades.Upgrade) { app.UpgradeKeeper.SetUpgradeHandler( - upgrade.Name, - upgrade.CreateHandler( - app.RollappParamsKeeper, - app.EvmKeeper, + u.Name, + u.CreateHandler( + upgrades.UpgradeKeepers{ + RpKeeper: app.RollappParamsKeeper, + EvmKeeper: app.EvmKeeper, + HubgenK: app.HubGenesisKeeper, + }, app.mm, app.configurator, ), @@ -1159,8 +1162,8 @@ func (app *App) setupUpgradeHandler(upgrade upgrades.Upgrade) { panic(fmt.Errorf("failed to read upgrade info from disk: %w", err)) } - if upgradeInfo.Name == upgrade.Name && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + if upgradeInfo.Name == u.Name && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { // configure store loader with the store upgrades - app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &upgrade.StoreUpgrades)) + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &u.StoreUpgrades)) } } diff --git a/app/upgrades/drs-2/upgrade.go b/app/upgrades/drs-2/upgrade.go index e7b467e..b40749f 100644 --- a/app/upgrades/drs-2/upgrade.go +++ b/app/upgrades/drs-2/upgrade.go @@ -11,8 +11,6 @@ import ( ) func CreateUpgradeHandler( - rpKeeper rollappparamskeeper.Keeper, - evmKeeper *evmkeeper.Keeper, mm *module.Manager, configurator module.Configurator, ) upgradetypes.UpgradeHandler { diff --git a/app/upgrades/drs-3/upgrade.go b/app/upgrades/drs-3/upgrade.go index dc5769b..42ee1d3 100644 --- a/app/upgrades/drs-3/upgrade.go +++ b/app/upgrades/drs-3/upgrade.go @@ -5,19 +5,19 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" rollappparamskeeper "github.com/dymensionxyz/dymension-rdk/x/rollappparams/keeper" + "github.com/dymensionxyz/rollapp-evm/app/upgrades" evmkeeper "github.com/evmos/evmos/v12/x/evm/keeper" drs2 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-2" ) func CreateUpgradeHandler( - rpKeeper rollappparamskeeper.Keeper, - evmKeeper *evmkeeper.Keeper, + kk upgrades.UpgradeKeepers, mm *module.Manager, configurator module.Configurator, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - if err := HandleUpgrade(ctx, rpKeeper, evmKeeper); err != nil { + if err := HandleUpgrade(ctx, kk.RpKeeper, kk.EvmKeeper); err != nil { return nil, err } return mm.RunMigrations(ctx, configurator, fromVM) diff --git a/app/upgrades/drs-4/upgrade.go b/app/upgrades/drs-4/upgrade.go index 3864a2d..c2e9be9 100644 --- a/app/upgrades/drs-4/upgrade.go +++ b/app/upgrades/drs-4/upgrade.go @@ -11,8 +11,7 @@ import ( ) func CreateUpgradeHandler( - rpKeeper rollappparamskeeper.Keeper, - evmKeeper *evmkeeper.Keeper, + kk UpgradeKeepers, mm *module.Manager, configurator module.Configurator, ) upgradetypes.UpgradeHandler { diff --git a/app/upgrades/drs-5/upgrade.go b/app/upgrades/drs-5/upgrade.go index 58f9fbc..fac757a 100644 --- a/app/upgrades/drs-5/upgrade.go +++ b/app/upgrades/drs-5/upgrade.go @@ -11,8 +11,7 @@ import ( ) func CreateUpgradeHandler( - rpKeeper rollappparamskeeper.Keeper, - evmKeeper *evmkeeper.Keeper, + kk UpgradeKeepers, mm *module.Manager, configurator module.Configurator, ) upgradetypes.UpgradeHandler { diff --git a/app/upgrades/foo/upgrade.go b/app/upgrades/foo/upgrade.go index 968dfd3..97c7ad8 100644 --- a/app/upgrades/foo/upgrade.go +++ b/app/upgrades/foo/upgrade.go @@ -4,19 +4,25 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - rollappparamskeeper "github.com/dymensionxyz/dymension-rdk/x/rollappparams/keeper" - evmkeeper "github.com/evmos/evmos/v12/x/evm/keeper" + hubgenkeeper "github.com/dymensionxyz/dymension-rdk/x/hub-genesis/keeper" + "github.com/dymensionxyz/rollapp-evm/app/upgrades" + "github.com/tendermint/tendermint/libs/log" ) func CreateUpgradeHandler( - rpKeeper rollappparamskeeper.Keeper, - evmKeeper *evmkeeper.Keeper, + kk upgrades.UpgradeKeepers, mm *module.Manager, configurator module.Configurator, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { l := ctx.Logger().With("upgrade", UpgradeName) + migrateHubGenesis(ctx, l, kk.HubgenK) + return mm.RunMigrations(ctx, configurator, fromVM) } } + +func migrateHubGenesis(ctx sdk.Context, l log.Logger, k hubgenkeeper.Keeper) { + +} diff --git a/app/upgrades/types.go b/app/upgrades/types.go index a153c77..3ae9441 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -4,10 +4,17 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + hubgenkeeper "github.com/dymensionxyz/dymension-rdk/x/hub-genesis/keeper" rollappparamskeeper "github.com/dymensionxyz/dymension-rdk/x/rollappparams/keeper" evmkeeper "github.com/evmos/evmos/v12/x/evm/keeper" ) +type UpgradeKeepers struct { + RpKeeper rollappparamskeeper.Keeper + EvmKeeper *evmkeeper.Keeper + HubgenK hubgenkeeper.Keeper +} + // Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal // must have written, in order for the state migration to go smoothly. // An upgrade must implement this struct, and then set it in the app.go. @@ -18,8 +25,7 @@ type Upgrade struct { // CreateHandler defines the function that creates an upgrade handler CreateHandler func( - rpKeeper rollappparamskeeper.Keeper, - evmKeeper *evmkeeper.Keeper, + kk UpgradeKeepers, mm *module.Manager, configurator module.Configurator, ) upgradetypes.UpgradeHandler From f2c21962e60699621b127c855b064ae35ad8cfd2 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:17:33 +0000 Subject: [PATCH 10/34] pre remove logger --- app/upgrades/foo/upgrade.go | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/app/upgrades/foo/upgrade.go b/app/upgrades/foo/upgrade.go index 97c7ad8..6d381cb 100644 --- a/app/upgrades/foo/upgrade.go +++ b/app/upgrades/foo/upgrade.go @@ -1,10 +1,13 @@ package foo import ( + "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" hubgenkeeper "github.com/dymensionxyz/dymension-rdk/x/hub-genesis/keeper" + hubgenesistypes "github.com/dymensionxyz/dymension-rdk/x/hub-genesis/types" "github.com/dymensionxyz/rollapp-evm/app/upgrades" "github.com/tendermint/tendermint/libs/log" ) @@ -17,12 +20,22 @@ func CreateUpgradeHandler( return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { l := ctx.Logger().With("upgrade", UpgradeName) - migrateHubGenesis(ctx, l, kk.HubgenK) + if err := migrateHubGenesis(ctx, l, kk.HubgenK); err != nil { + return nil, fmt.Errorf("migrate hub genesis: %w", err) + } return mm.RunMigrations(ctx, configurator, fromVM) } } -func migrateHubGenesis(ctx sdk.Context, l log.Logger, k hubgenkeeper.Keeper) { - +func migrateHubGenesis(ctx sdk.Context, l log.Logger, k hubgenkeeper.Keeper) error { + s := k.GetState(ctx) + s.OutboundTransfersEnabled = true + s.InFlight = false + s.HubPortAndChannel = &hubgenesistypes.PortAndChannel{ + Port: "transfer", + Channel: "channel-0", + } + k.SetState(ctx, s) + return k.PopulateGenesisInfo(ctx, nil) } From 96a54dd817268f0ede154a09ae87244deb676f4d Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:17:47 +0000 Subject: [PATCH 11/34] remove logger --- app/upgrades/foo/upgrade.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/upgrades/foo/upgrade.go b/app/upgrades/foo/upgrade.go index 6d381cb..0d32065 100644 --- a/app/upgrades/foo/upgrade.go +++ b/app/upgrades/foo/upgrade.go @@ -9,7 +9,6 @@ import ( hubgenkeeper "github.com/dymensionxyz/dymension-rdk/x/hub-genesis/keeper" hubgenesistypes "github.com/dymensionxyz/dymension-rdk/x/hub-genesis/types" "github.com/dymensionxyz/rollapp-evm/app/upgrades" - "github.com/tendermint/tendermint/libs/log" ) func CreateUpgradeHandler( @@ -18,9 +17,8 @@ func CreateUpgradeHandler( configurator module.Configurator, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - l := ctx.Logger().With("upgrade", UpgradeName) - if err := migrateHubGenesis(ctx, l, kk.HubgenK); err != nil { + if err := migrateHubGenesis(ctx, kk.HubgenK); err != nil { return nil, fmt.Errorf("migrate hub genesis: %w", err) } @@ -28,7 +26,7 @@ func CreateUpgradeHandler( } } -func migrateHubGenesis(ctx sdk.Context, l log.Logger, k hubgenkeeper.Keeper) error { +func migrateHubGenesis(ctx sdk.Context, k hubgenkeeper.Keeper) error { s := k.GetState(ctx) s.OutboundTransfersEnabled = true s.InFlight = false From cba1439ecb4f6e85d4df04ba1c0eee174f4b6c2f Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:52:34 +0000 Subject: [PATCH 12/34] impl the rollapp params --- app/upgrades/foo/constants.go | 4 +++- app/upgrades/foo/upgrade.go | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/upgrades/foo/constants.go b/app/upgrades/foo/constants.go index d617eaf..e353856 100644 --- a/app/upgrades/foo/constants.go +++ b/app/upgrades/foo/constants.go @@ -14,7 +14,9 @@ import ( ) const ( - UpgradeName = "foo" + UpgradeName = "foo" + drs uint32 = 5 + da string = "celestia" ) var Upgrade = upgrades.Upgrade{ diff --git a/app/upgrades/foo/upgrade.go b/app/upgrades/foo/upgrade.go index 0d32065..ea9cd2d 100644 --- a/app/upgrades/foo/upgrade.go +++ b/app/upgrades/foo/upgrade.go @@ -8,6 +8,7 @@ import ( upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" hubgenkeeper "github.com/dymensionxyz/dymension-rdk/x/hub-genesis/keeper" hubgenesistypes "github.com/dymensionxyz/dymension-rdk/x/hub-genesis/types" + rollappparamskeeper "github.com/dymensionxyz/dymension-rdk/x/rollappparams/keeper" "github.com/dymensionxyz/rollapp-evm/app/upgrades" ) @@ -22,6 +23,10 @@ func CreateUpgradeHandler( return nil, fmt.Errorf("migrate hub genesis: %w", err) } + if err := migrateRollappParams(ctx, kk.RpKeeper); err != nil { + return nil, fmt.Errorf("migrate rollapp params: %w", err) + } + return mm.RunMigrations(ctx, configurator, fromVM) } } @@ -37,3 +42,14 @@ func migrateHubGenesis(ctx sdk.Context, k hubgenkeeper.Keeper) error { k.SetState(ctx, s) return k.PopulateGenesisInfo(ctx, nil) } + +func migrateRollappParams(ctx sdk.Context, k rollappparamskeeper.Keeper) error { + if err := k.SetVersion(ctx, drs); err != nil { + return fmt.Errorf("set version: %w", err) + } + if err := k.SetDA(ctx, da); err != nil { + return fmt.Errorf("set DA: %w", err) + } + // no need to set min gas prices, rollapp can do it when it likes + return nil +} From 122fca436ff71d60409e5e3bdbd6c1f3938ec40e Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 16:59:40 +0000 Subject: [PATCH 13/34] rename foo -> 3d --- app/app.go | 5 +++-- app/upgrades/drs-2/upgrade.go | 4 +++- app/upgrades/drs-4/upgrade.go | 5 +++-- app/upgrades/drs-5/upgrade.go | 5 +++-- app/upgrades/{foo => threed}/constants.go | 2 +- app/upgrades/threed/doc.go | 2 ++ app/upgrades/{foo => threed}/upgrade.go | 2 +- 7 files changed, 16 insertions(+), 9 deletions(-) rename app/upgrades/{foo => threed}/constants.go (98%) create mode 100644 app/upgrades/threed/doc.go rename app/upgrades/{foo => threed}/upgrade.go (99%) diff --git a/app/app.go b/app/app.go index bb90d7c..258e771 100644 --- a/app/app.go +++ b/app/app.go @@ -11,6 +11,7 @@ import ( authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" "github.com/dymensionxyz/dymension-rdk/server/proposal" + "github.com/dymensionxyz/rollapp-evm/app/upgrades/threed" "github.com/gogo/protobuf/proto" "github.com/gorilla/mux" "github.com/rakyll/statik/fs" @@ -164,7 +165,7 @@ import ( drs3 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-3" drs4 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-4" drs5 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-5" - foo "github.com/dymensionxyz/rollapp-evm/app/upgrades/foo" + threed "github.com/dymensionxyz/rollapp-evm/app/upgrades/threed" ) const ( @@ -190,7 +191,7 @@ var ( erc20types.StoreKey, } // Upgrades contains the upgrade handlers for the application - Upgrades = []upgrades.Upgrade{drs2.Upgrade, drs3.Upgrade, drs4.Upgrade, drs5.Upgrade, foo.Upgrade} + Upgrades = []upgrades.Upgrade{drs2.Upgrade, drs3.Upgrade, drs4.Upgrade, drs5.Upgrade, threed.Upgrade} ) func getGovProposalHandlers() []govclient.ProposalHandler { diff --git a/app/upgrades/drs-2/upgrade.go b/app/upgrades/drs-2/upgrade.go index b40749f..0c7be11 100644 --- a/app/upgrades/drs-2/upgrade.go +++ b/app/upgrades/drs-2/upgrade.go @@ -4,6 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + "github.com/dymensionxyz/rollapp-evm/app/upgrades" evmkeeper "github.com/evmos/evmos/v12/x/evm/keeper" rollappparamskeeper "github.com/dymensionxyz/dymension-rdk/x/rollappparams/keeper" @@ -11,11 +12,12 @@ import ( ) func CreateUpgradeHandler( + kk upgrades.UpgradeKeepers, mm *module.Manager, configurator module.Configurator, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - if err := HandleUpgrade(ctx, rpKeeper, evmKeeper); err != nil { + if err := HandleUpgrade(ctx, kk.RpKeeper, kk.EvmKeeper); err != nil { return nil, err } return mm.RunMigrations(ctx, configurator, fromVM) diff --git a/app/upgrades/drs-4/upgrade.go b/app/upgrades/drs-4/upgrade.go index c2e9be9..91c7101 100644 --- a/app/upgrades/drs-4/upgrade.go +++ b/app/upgrades/drs-4/upgrade.go @@ -5,18 +5,19 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" rollappparamskeeper "github.com/dymensionxyz/dymension-rdk/x/rollappparams/keeper" + "github.com/dymensionxyz/rollapp-evm/app/upgrades" evmkeeper "github.com/evmos/evmos/v12/x/evm/keeper" drs3 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-3" ) func CreateUpgradeHandler( - kk UpgradeKeepers, + kk upgrades.UpgradeKeepers, mm *module.Manager, configurator module.Configurator, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - if err := HandleUpgrade(ctx, rpKeeper, evmKeeper); err != nil { + if err := HandleUpgrade(ctx, kk.RpKeeper, kk.EvmKeeper); err != nil { return nil, err } return mm.RunMigrations(ctx, configurator, fromVM) diff --git a/app/upgrades/drs-5/upgrade.go b/app/upgrades/drs-5/upgrade.go index fac757a..06af5b8 100644 --- a/app/upgrades/drs-5/upgrade.go +++ b/app/upgrades/drs-5/upgrade.go @@ -5,18 +5,19 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" rollappparamskeeper "github.com/dymensionxyz/dymension-rdk/x/rollappparams/keeper" + "github.com/dymensionxyz/rollapp-evm/app/upgrades" evmkeeper "github.com/evmos/evmos/v12/x/evm/keeper" drs4 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-4" ) func CreateUpgradeHandler( - kk UpgradeKeepers, + kk upgrades.UpgradeKeepers, mm *module.Manager, configurator module.Configurator, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, plan upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - if err := HandleUpgrade(ctx, rpKeeper, evmKeeper); err != nil { + if err := HandleUpgrade(ctx, kk.RpKeeper, kk.EvmKeeper); err != nil { return nil, err } return mm.RunMigrations(ctx, configurator, fromVM) diff --git a/app/upgrades/foo/constants.go b/app/upgrades/threed/constants.go similarity index 98% rename from app/upgrades/foo/constants.go rename to app/upgrades/threed/constants.go index e353856..6f35688 100644 --- a/app/upgrades/foo/constants.go +++ b/app/upgrades/threed/constants.go @@ -1,4 +1,4 @@ -package foo +package threed import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" diff --git a/app/upgrades/threed/doc.go b/app/upgrades/threed/doc.go new file mode 100644 index 0000000..18382b2 --- /dev/null +++ b/app/upgrades/threed/doc.go @@ -0,0 +1,2 @@ +// Package threed (3D) provides a 3D upgrade for the apps Nim+Mande from mainnet (rollapp-evm v2.2.1) to a 3D compatible version. +package threed diff --git a/app/upgrades/foo/upgrade.go b/app/upgrades/threed/upgrade.go similarity index 99% rename from app/upgrades/foo/upgrade.go rename to app/upgrades/threed/upgrade.go index ea9cd2d..25a3488 100644 --- a/app/upgrades/foo/upgrade.go +++ b/app/upgrades/threed/upgrade.go @@ -1,4 +1,4 @@ -package foo +package threed import ( "fmt" From 95fe9a313264926b21c6566bded21f4263a36d27 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 17:08:38 +0000 Subject: [PATCH 14/34] in the middle of writing a test --- app/upgrades/threed/constants.go | 2 +- app/upgrades/threed/upgrade_test.go | 38 +++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 app/upgrades/threed/upgrade_test.go diff --git a/app/upgrades/threed/constants.go b/app/upgrades/threed/constants.go index 6f35688..4a2ae05 100644 --- a/app/upgrades/threed/constants.go +++ b/app/upgrades/threed/constants.go @@ -14,7 +14,7 @@ import ( ) const ( - UpgradeName = "foo" + UpgradeName = "3D" drs uint32 = 5 da string = "celestia" ) diff --git a/app/upgrades/threed/upgrade_test.go b/app/upgrades/threed/upgrade_test.go new file mode 100644 index 0000000..e3a9711 --- /dev/null +++ b/app/upgrades/threed/upgrade_test.go @@ -0,0 +1,38 @@ +package threed + +import ( + "testing" + "time" + + abci "github.com/cometbft/cometbft/abci/types" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + "github.com/dymensionxyz/rollapp-evm/app" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/proto/tendermint/types" +) + +func TestBeginBlocker(t *testing.T) { + app, _ := app.SetupWithOneValidator(t) + h := int64(42) + ctx := app.NewUncachedContext(true, types.Header{ + Height: h - 1, + ChainID: "testchain_9000-1", + }) + err := app.UpgradeKeeper.ScheduleUpgrade(ctx, upgradetypes.Plan{ + Name: UpgradeName, + Height: h, + }) + require.NoError(t, err) + + // simulate the upgrade process not panic. + require.NotPanics(t, func() { + defer func() { + if r := recover(); r != nil { + t.Fatalf("Upgrade panicked: %v", r) + } + }() + // simulate the upgrade process. + ctx = ctx.WithBlockHeight(h) + app.BeginBlocker(ctx, abci.RequestBeginBlock{}) + }) +} From 2c73d44675ca5f39fb96d782394b649637a7cd95 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 17:10:32 +0000 Subject: [PATCH 15/34] need to make the app importable --- app/app.go | 1 - app/upgrades/threed/upgrade_test.go | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/app.go b/app/app.go index 258e771..e7ab7ef 100644 --- a/app/app.go +++ b/app/app.go @@ -165,7 +165,6 @@ import ( drs3 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-3" drs4 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-4" drs5 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-5" - threed "github.com/dymensionxyz/rollapp-evm/app/upgrades/threed" ) const ( diff --git a/app/upgrades/threed/upgrade_test.go b/app/upgrades/threed/upgrade_test.go index e3a9711..35f968c 100644 --- a/app/upgrades/threed/upgrade_test.go +++ b/app/upgrades/threed/upgrade_test.go @@ -2,9 +2,9 @@ package threed import ( "testing" - "time" - abci "github.com/cometbft/cometbft/abci/types" + abci "github.com/tendermint/tendermint/abci/types" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" "github.com/dymensionxyz/rollapp-evm/app" "github.com/stretchr/testify/require" From b7c5c0484350c287cb9fd2ccf89f67d45f984e74 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 17:16:30 +0000 Subject: [PATCH 16/34] make the test runnable, but it fails due to wrong drs in dymint --- app/upgrades/threed/upgrade_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/upgrades/threed/upgrade_test.go b/app/upgrades/threed/upgrade_test.go index 35f968c..1dfe671 100644 --- a/app/upgrades/threed/upgrade_test.go +++ b/app/upgrades/threed/upgrade_test.go @@ -1,8 +1,9 @@ -package threed +package threed_test import ( "testing" + "github.com/dymensionxyz/rollapp-evm/app/upgrades/threed" abci "github.com/tendermint/tendermint/abci/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" @@ -19,7 +20,7 @@ func TestBeginBlocker(t *testing.T) { ChainID: "testchain_9000-1", }) err := app.UpgradeKeeper.ScheduleUpgrade(ctx, upgradetypes.Plan{ - Name: UpgradeName, + Name: threed.UpgradeName, Height: h, }) require.NoError(t, err) From e1f494f27db823ba2ae4fff5e7b3e27b544b8e5d Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 17:23:44 +0000 Subject: [PATCH 17/34] add a test which passes, but I commented out the drs panic --- app/app.go | 6 +-- .../{threed => drs-5-mainnet}/constants.go | 6 +-- app/upgrades/drs-5-mainnet/doc.go | 2 + .../{threed => drs-5-mainnet}/upgrade.go | 6 +-- app/upgrades/drs-5-mainnet/upgrade_test.go | 51 +++++++++++++++++++ app/upgrades/threed/doc.go | 2 - app/upgrades/threed/upgrade_test.go | 39 -------------- 7 files changed, 62 insertions(+), 50 deletions(-) rename app/upgrades/{threed => drs-5-mainnet}/constants.go (93%) create mode 100644 app/upgrades/drs-5-mainnet/doc.go rename app/upgrades/{threed => drs-5-mainnet}/upgrade.go (93%) create mode 100644 app/upgrades/drs-5-mainnet/upgrade_test.go delete mode 100644 app/upgrades/threed/doc.go delete mode 100644 app/upgrades/threed/upgrade_test.go diff --git a/app/app.go b/app/app.go index e7ab7ef..5beb2b6 100644 --- a/app/app.go +++ b/app/app.go @@ -11,7 +11,7 @@ import ( authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" "github.com/dymensionxyz/dymension-rdk/server/proposal" - "github.com/dymensionxyz/rollapp-evm/app/upgrades/threed" + drs5mainnet "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-5-mainnet" "github.com/gogo/protobuf/proto" "github.com/gorilla/mux" "github.com/rakyll/statik/fs" @@ -190,7 +190,7 @@ var ( erc20types.StoreKey, } // Upgrades contains the upgrade handlers for the application - Upgrades = []upgrades.Upgrade{drs2.Upgrade, drs3.Upgrade, drs4.Upgrade, drs5.Upgrade, threed.Upgrade} + Upgrades = []upgrades.Upgrade{drs2.Upgrade, drs3.Upgrade, drs4.Upgrade, drs5.Upgrade, drs5mainnet.Upgrade} ) func getGovProposalHandlers() []govclient.ProposalHandler { @@ -879,7 +879,7 @@ func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.R panic(fmt.Errorf("Unable to get DRS version from binary: %w", err)) } if drsVersion != app.RollappParamsKeeper.Version(ctx) { - panic(fmt.Errorf("DRS version mismatch. rollapp DRS version: %d binary DRS version:%d", app.RollappParamsKeeper.Version(ctx), drsVersion)) + //panic(fmt.Errorf("DRS version mismatch. rollapp DRS version: %d binary DRS version:%d", app.RollappParamsKeeper.Version(ctx), drsVersion)) } return resp } diff --git a/app/upgrades/threed/constants.go b/app/upgrades/drs-5-mainnet/constants.go similarity index 93% rename from app/upgrades/threed/constants.go rename to app/upgrades/drs-5-mainnet/constants.go index 4a2ae05..5d5ef05 100644 --- a/app/upgrades/threed/constants.go +++ b/app/upgrades/drs-5-mainnet/constants.go @@ -1,4 +1,4 @@ -package threed +package drs5mainnet import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -15,8 +15,8 @@ import ( const ( UpgradeName = "3D" - drs uint32 = 5 - da string = "celestia" + DRS uint32 = 5 + DA string = "celestia" ) var Upgrade = upgrades.Upgrade{ diff --git a/app/upgrades/drs-5-mainnet/doc.go b/app/upgrades/drs-5-mainnet/doc.go new file mode 100644 index 0000000..6e624e8 --- /dev/null +++ b/app/upgrades/drs-5-mainnet/doc.go @@ -0,0 +1,2 @@ +// Package drs5mainnet (3D) provides a 3D upgrade for the apps Nim+Mande from mainnet (rollapp-evm v2.2.1) to a 3D compatible version. +package drs5mainnet diff --git a/app/upgrades/threed/upgrade.go b/app/upgrades/drs-5-mainnet/upgrade.go similarity index 93% rename from app/upgrades/threed/upgrade.go rename to app/upgrades/drs-5-mainnet/upgrade.go index 25a3488..78d40c8 100644 --- a/app/upgrades/threed/upgrade.go +++ b/app/upgrades/drs-5-mainnet/upgrade.go @@ -1,4 +1,4 @@ -package threed +package drs5mainnet import ( "fmt" @@ -44,10 +44,10 @@ func migrateHubGenesis(ctx sdk.Context, k hubgenkeeper.Keeper) error { } func migrateRollappParams(ctx sdk.Context, k rollappparamskeeper.Keeper) error { - if err := k.SetVersion(ctx, drs); err != nil { + if err := k.SetVersion(ctx, DRS); err != nil { return fmt.Errorf("set version: %w", err) } - if err := k.SetDA(ctx, da); err != nil { + if err := k.SetDA(ctx, DA); err != nil { return fmt.Errorf("set DA: %w", err) } // no need to set min gas prices, rollapp can do it when it likes diff --git a/app/upgrades/drs-5-mainnet/upgrade_test.go b/app/upgrades/drs-5-mainnet/upgrade_test.go new file mode 100644 index 0000000..b94e273 --- /dev/null +++ b/app/upgrades/drs-5-mainnet/upgrade_test.go @@ -0,0 +1,51 @@ +package drs5mainnet_test + +import ( + "testing" + + drs5mainnet "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-5-mainnet" + abci "github.com/tendermint/tendermint/abci/types" + + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + "github.com/dymensionxyz/rollapp-evm/app" + "github.com/stretchr/testify/require" + "github.com/tendermint/tendermint/proto/tendermint/types" +) + +func TestBeginBlocker(t *testing.T) { + app, _ := app.SetupWithOneValidator(t) + h := int64(42) + ctx := app.NewUncachedContext(true, types.Header{ + Height: h - 1, + ChainID: "testchain_9000-1", + }) + err := app.UpgradeKeeper.ScheduleUpgrade(ctx, upgradetypes.Plan{ + Name: drs5mainnet.UpgradeName, + Height: h, + }) + require.NoError(t, err) + + // simulate the upgrade process not panic. + require.NotPanics(t, func() { + defer func() { + if r := recover(); r != nil { + t.Fatalf("Upgrade panicked: %v", r) + } + }() + // simulate the upgrade process + ctx = ctx.WithBlockHeight(h) + app.BeginBlocker(ctx, abci.RequestBeginBlock{}) + }) + + // Check if the upgrade was applied correctly + state := app.HubGenesisKeeper.GetState(ctx) + require.True(t, state.OutboundTransfersEnabled, "OutboundTransfersEnabled should be true") + require.False(t, state.InFlight, "InFlight should be false") + require.NotNil(t, state.HubPortAndChannel, "HubPortAndChannel should not be nil") + require.Equal(t, "transfer", state.HubPortAndChannel.Port, "Port should be 'transfer'") + require.Equal(t, "channel-0", state.HubPortAndChannel.Channel, "Channel should be 'channel-0'") + + p := app.RollappParamsKeeper.GetParams(ctx) + require.Equal(t, drs5mainnet.DRS, p.DrsVersion, "Version should be set to DRS") + require.Equal(t, drs5mainnet.DA, p.Da, "Version should be set to DRS") +} diff --git a/app/upgrades/threed/doc.go b/app/upgrades/threed/doc.go deleted file mode 100644 index 18382b2..0000000 --- a/app/upgrades/threed/doc.go +++ /dev/null @@ -1,2 +0,0 @@ -// Package threed (3D) provides a 3D upgrade for the apps Nim+Mande from mainnet (rollapp-evm v2.2.1) to a 3D compatible version. -package threed diff --git a/app/upgrades/threed/upgrade_test.go b/app/upgrades/threed/upgrade_test.go deleted file mode 100644 index 1dfe671..0000000 --- a/app/upgrades/threed/upgrade_test.go +++ /dev/null @@ -1,39 +0,0 @@ -package threed_test - -import ( - "testing" - - "github.com/dymensionxyz/rollapp-evm/app/upgrades/threed" - abci "github.com/tendermint/tendermint/abci/types" - - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/dymensionxyz/rollapp-evm/app" - "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/proto/tendermint/types" -) - -func TestBeginBlocker(t *testing.T) { - app, _ := app.SetupWithOneValidator(t) - h := int64(42) - ctx := app.NewUncachedContext(true, types.Header{ - Height: h - 1, - ChainID: "testchain_9000-1", - }) - err := app.UpgradeKeeper.ScheduleUpgrade(ctx, upgradetypes.Plan{ - Name: threed.UpgradeName, - Height: h, - }) - require.NoError(t, err) - - // simulate the upgrade process not panic. - require.NotPanics(t, func() { - defer func() { - if r := recover(); r != nil { - t.Fatalf("Upgrade panicked: %v", r) - } - }() - // simulate the upgrade process. - ctx = ctx.WithBlockHeight(h) - app.BeginBlocker(ctx, abci.RequestBeginBlock{}) - }) -} From 56857e81e227ff3f7d487f7c6a963598f87a594e Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 17:24:02 +0000 Subject: [PATCH 18/34] bring back the drs panic --- app/app.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/app.go b/app/app.go index 5beb2b6..915029c 100644 --- a/app/app.go +++ b/app/app.go @@ -464,7 +464,7 @@ func NewRollapp( ) app.MintKeeper.SetHooks( minttypes.NewMultiMintHooks( - // insert mint hooks receivers here + // insert mint hooks receivers here ), ) @@ -557,7 +557,7 @@ func NewRollapp( app.GovKeeper = *govKeeper.SetHooks( govtypes.NewMultiGovHooks( - // register the governance hooks + // register the governance hooks ), ) @@ -879,7 +879,7 @@ func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.R panic(fmt.Errorf("Unable to get DRS version from binary: %w", err)) } if drsVersion != app.RollappParamsKeeper.Version(ctx) { - //panic(fmt.Errorf("DRS version mismatch. rollapp DRS version: %d binary DRS version:%d", app.RollappParamsKeeper.Version(ctx), drsVersion)) + panic(fmt.Errorf("DRS version mismatch. rollapp DRS version: %d binary DRS version:%d", app.RollappParamsKeeper.Version(ctx), drsVersion)) } return resp } From 0ed33e64dfffdf7649300ba18f7ca97e42b74076 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Thu, 2 Jan 2025 18:06:11 +0000 Subject: [PATCH 19/34] replace with cloud --- go.mod | 4 +++- go.sum | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 506b724..92338b7 100644 --- a/go.mod +++ b/go.mod @@ -367,4 +367,6 @@ replace ( github.com/tendermint/tendermint => github.com/dymensionxyz/cometbft v0.34.29-0.20241128205759-2a9d5f015da5 ) -replace github.com/dymensionxyz/dymension-rdk => /Users/danwt/Documents/dym/d-dymension-rdk +// TODO: cleanup after rdk is merged +//replace github.com/dymensionxyz/dymension-rdk => /Users/danwt/Documents/dym/d-dymension-rdk +replace github.com/dymensionxyz/dymension-rdk => github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250102180458-aea83a151bf2 diff --git a/go.sum b/go.sum index aea0fae..1779870 100644 --- a/go.sum +++ b/go.sum @@ -577,6 +577,8 @@ github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73 h1:A0O github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73/go.mod h1:VPUuzF+l+ekSGPV7VVB8m0OMQfwp3QdKWNZjvkU3A1U= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd h1:V89QyOFM84o9w0iFdctMU6So8SS/Xt32JWAXGqJduT0= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd/go.mod h1:3weqpVj/TqTFpC0LjEB3H+HZSpm7BrQ1QkEg1Ahy6KY= +github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250102180458-aea83a151bf2 h1:mUAW4hly5WY9rOaA6Upl2VfdUzh6IC3d4ucTYsou68A= +github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250102180458-aea83a151bf2/go.mod h1:p9rl2xNsbubJcxGnTIVF9D8aKAM+oPkCVdQ6Z6PM2Tw= github.com/dymensionxyz/dymint v1.3.0-rc03 h1:JRAGrLDMdM642lbcnIgRp3iuHhvLkq0z6LWKZlWLQyI= github.com/dymensionxyz/dymint v1.3.0-rc03/go.mod h1:C3VbfePK85aRCdA1iHzB2AYD+n1gKR9Pw+wm3wQUXvE= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.5.0-rc02 h1:G6rtzFNnzeYOHN33rkw0kMQX+xRantRLTip1AMXYmBg= From 5c7a09d7d0bb9bb20eaf642e4750febf64b6c609 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Fri, 3 Jan 2025 10:56:52 +0000 Subject: [PATCH 20/34] rename --- app/app.go | 8 ++++---- .../{drs-5-mainnet => drs-5-from2d}/constants.go | 4 ++-- app/upgrades/{drs-5-mainnet => drs-5-from2d}/doc.go | 2 +- .../{drs-5-mainnet => drs-5-from2d}/upgrade.go | 2 +- .../{drs-5-mainnet => drs-5-from2d}/upgrade_test.go | 10 +++++----- 5 files changed, 13 insertions(+), 13 deletions(-) rename app/upgrades/{drs-5-mainnet => drs-5-from2d}/constants.go (94%) rename app/upgrades/{drs-5-mainnet => drs-5-from2d}/doc.go (87%) rename app/upgrades/{drs-5-mainnet => drs-5-from2d}/upgrade.go (98%) rename app/upgrades/{drs-5-mainnet => drs-5-from2d}/upgrade_test.go (83%) diff --git a/app/app.go b/app/app.go index 915029c..ab31a63 100644 --- a/app/app.go +++ b/app/app.go @@ -11,7 +11,6 @@ import ( authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" "github.com/dymensionxyz/dymension-rdk/server/proposal" - drs5mainnet "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-5-mainnet" "github.com/gogo/protobuf/proto" "github.com/gorilla/mux" "github.com/rakyll/statik/fs" @@ -165,6 +164,7 @@ import ( drs3 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-3" drs4 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-4" drs5 "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-5" + drs5from2d "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-5-from2d" ) const ( @@ -190,7 +190,7 @@ var ( erc20types.StoreKey, } // Upgrades contains the upgrade handlers for the application - Upgrades = []upgrades.Upgrade{drs2.Upgrade, drs3.Upgrade, drs4.Upgrade, drs5.Upgrade, drs5mainnet.Upgrade} + Upgrades = []upgrades.Upgrade{drs2.Upgrade, drs3.Upgrade, drs4.Upgrade, drs5.Upgrade, drs5from2d.Upgrade} ) func getGovProposalHandlers() []govclient.ProposalHandler { @@ -464,7 +464,7 @@ func NewRollapp( ) app.MintKeeper.SetHooks( minttypes.NewMultiMintHooks( - // insert mint hooks receivers here + // insert mint hooks receivers here ), ) @@ -557,7 +557,7 @@ func NewRollapp( app.GovKeeper = *govKeeper.SetHooks( govtypes.NewMultiGovHooks( - // register the governance hooks + // register the governance hooks ), ) diff --git a/app/upgrades/drs-5-mainnet/constants.go b/app/upgrades/drs-5-from2d/constants.go similarity index 94% rename from app/upgrades/drs-5-mainnet/constants.go rename to app/upgrades/drs-5-from2d/constants.go index 5d5ef05..a3acc99 100644 --- a/app/upgrades/drs-5-mainnet/constants.go +++ b/app/upgrades/drs-5-from2d/constants.go @@ -1,4 +1,4 @@ -package drs5mainnet +package drs5from2d import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -14,7 +14,7 @@ import ( ) const ( - UpgradeName = "3D" + UpgradeName = "drs-5-from2D" DRS uint32 = 5 DA string = "celestia" ) diff --git a/app/upgrades/drs-5-mainnet/doc.go b/app/upgrades/drs-5-from2d/doc.go similarity index 87% rename from app/upgrades/drs-5-mainnet/doc.go rename to app/upgrades/drs-5-from2d/doc.go index 6e624e8..3bf7472 100644 --- a/app/upgrades/drs-5-mainnet/doc.go +++ b/app/upgrades/drs-5-from2d/doc.go @@ -1,2 +1,2 @@ // Package drs5mainnet (3D) provides a 3D upgrade for the apps Nim+Mande from mainnet (rollapp-evm v2.2.1) to a 3D compatible version. -package drs5mainnet +package drs5from2d diff --git a/app/upgrades/drs-5-mainnet/upgrade.go b/app/upgrades/drs-5-from2d/upgrade.go similarity index 98% rename from app/upgrades/drs-5-mainnet/upgrade.go rename to app/upgrades/drs-5-from2d/upgrade.go index 78d40c8..3d266ce 100644 --- a/app/upgrades/drs-5-mainnet/upgrade.go +++ b/app/upgrades/drs-5-from2d/upgrade.go @@ -1,4 +1,4 @@ -package drs5mainnet +package drs5from2d import ( "fmt" diff --git a/app/upgrades/drs-5-mainnet/upgrade_test.go b/app/upgrades/drs-5-from2d/upgrade_test.go similarity index 83% rename from app/upgrades/drs-5-mainnet/upgrade_test.go rename to app/upgrades/drs-5-from2d/upgrade_test.go index b94e273..dd424d9 100644 --- a/app/upgrades/drs-5-mainnet/upgrade_test.go +++ b/app/upgrades/drs-5-from2d/upgrade_test.go @@ -1,9 +1,9 @@ -package drs5mainnet_test +package drs5from2d_test import ( "testing" - drs5mainnet "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-5-mainnet" + up "github.com/dymensionxyz/rollapp-evm/app/upgrades/drs-5-from2d" abci "github.com/tendermint/tendermint/abci/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" @@ -20,7 +20,7 @@ func TestBeginBlocker(t *testing.T) { ChainID: "testchain_9000-1", }) err := app.UpgradeKeeper.ScheduleUpgrade(ctx, upgradetypes.Plan{ - Name: drs5mainnet.UpgradeName, + Name: up.UpgradeName, Height: h, }) require.NoError(t, err) @@ -46,6 +46,6 @@ func TestBeginBlocker(t *testing.T) { require.Equal(t, "channel-0", state.HubPortAndChannel.Channel, "Channel should be 'channel-0'") p := app.RollappParamsKeeper.GetParams(ctx) - require.Equal(t, drs5mainnet.DRS, p.DrsVersion, "Version should be set to DRS") - require.Equal(t, drs5mainnet.DA, p.Da, "Version should be set to DRS") + require.Equal(t, up.DRS, p.DrsVersion, "Version should be set to DRS") + require.Equal(t, up.DA, p.Da, "Version should be set to DRS") } From 9a3c87173f007ac47121c42e2eba76b53d8b6c15 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Fri, 3 Jan 2025 12:46:20 +0000 Subject: [PATCH 21/34] add a hack to make ut work --- app/app.go | 10 ++++++++++ app/upgrades/drs-5-from2d/upgrade_test.go | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/app/app.go b/app/app.go index ab31a63..f7313ad 100644 --- a/app/app.go +++ b/app/app.go @@ -344,6 +344,9 @@ type App struct { configurator module.Configurator consensusMessageAdmissionHandler consensus.AdmissionHandler + + // optionally override the way to query the dymint version + dymintVersionGetter func() (uint32, error) } // NewRollapp returns a reference to an initialized blockchain app @@ -875,6 +878,9 @@ func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.R resp.ConsensusMessagesResponses = consensusResponses drsVersion, err := dymintversion.GetDRSVersion() + if app.dymintVersionGetter != nil { + drsVersion, err = app.dymintVersionGetter() + } if err != nil { panic(fmt.Errorf("Unable to get DRS version from binary: %w", err)) } @@ -1167,3 +1173,7 @@ func (app *App) setupUpgradeHandler(u upgrades.Upgrade) { app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &u.StoreUpgrades)) } } + +func (app *App) SetDymintVersionGetter(getter func() (uint32, error)) { + app.dymintVersionGetter = getter +} diff --git a/app/upgrades/drs-5-from2d/upgrade_test.go b/app/upgrades/drs-5-from2d/upgrade_test.go index dd424d9..f6c9011 100644 --- a/app/upgrades/drs-5-from2d/upgrade_test.go +++ b/app/upgrades/drs-5-from2d/upgrade_test.go @@ -13,7 +13,11 @@ import ( ) func TestBeginBlocker(t *testing.T) { + app, _ := app.SetupWithOneValidator(t) + app.SetDymintVersionGetter(func() (uint32, error) { + return uint32(up.DRS), nil + }) h := int64(42) ctx := app.NewUncachedContext(true, types.Header{ Height: h - 1, From 05ee547f518e4a6e418c05522195ac6ab674cb10 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Fri, 3 Jan 2025 15:55:55 +0000 Subject: [PATCH 22/34] temp --- app/upgrades/drs-5-from2d/constants.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/upgrades/drs-5-from2d/constants.go b/app/upgrades/drs-5-from2d/constants.go index a3acc99..8e48eb7 100644 --- a/app/upgrades/drs-5-from2d/constants.go +++ b/app/upgrades/drs-5-from2d/constants.go @@ -10,7 +10,6 @@ import ( timeupgradetypes "github.com/dymensionxyz/dymension-rdk/x/timeupgrade/types" "github.com/dymensionxyz/rollapp-evm/app/upgrades" - claimstypes "github.com/evmos/evmos/v12/x/claims/types" ) const ( @@ -23,10 +22,10 @@ var Upgrade = upgrades.Upgrade{ Name: UpgradeName, CreateHandler: CreateUpgradeHandler, StoreUpgrades: storetypes.StoreUpgrades{ - Deleted: []string{ - claimstypes.ModuleName, - "denommetadata", - }, + //Deleted: []string{ + // claimstypes.ModuleName, + // "denommetadata", + //}, Added: []string{ authztypes.ModuleName, feegrant.ModuleName, From 864daa21eed3024708ebb7dada1c0291f2db6dd9 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Fri, 3 Jan 2025 16:09:05 +0000 Subject: [PATCH 23/34] use my own fork --- app/upgrades/drs-5-from2d/constants.go | 9 +++++---- go.mod | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/upgrades/drs-5-from2d/constants.go b/app/upgrades/drs-5-from2d/constants.go index 8e48eb7..ccbc633 100644 --- a/app/upgrades/drs-5-from2d/constants.go +++ b/app/upgrades/drs-5-from2d/constants.go @@ -8,6 +8,7 @@ import ( hubtypes "github.com/dymensionxyz/dymension-rdk/x/hub/types" rollappparamstypes "github.com/dymensionxyz/dymension-rdk/x/rollappparams/types" timeupgradetypes "github.com/dymensionxyz/dymension-rdk/x/timeupgrade/types" + claimstypes "github.com/evmos/evmos/v12/x/claims/types" "github.com/dymensionxyz/rollapp-evm/app/upgrades" ) @@ -22,10 +23,10 @@ var Upgrade = upgrades.Upgrade{ Name: UpgradeName, CreateHandler: CreateUpgradeHandler, StoreUpgrades: storetypes.StoreUpgrades{ - //Deleted: []string{ - // claimstypes.ModuleName, - // "denommetadata", - //}, + Deleted: []string{ + claimstypes.ModuleName, + "denommetadata", + }, Added: []string{ authztypes.ModuleName, feegrant.ModuleName, diff --git a/go.mod b/go.mod index 92338b7..c639dd3 100644 --- a/go.mod +++ b/go.mod @@ -368,5 +368,6 @@ replace ( ) // TODO: cleanup after rdk is merged -//replace github.com/dymensionxyz/dymension-rdk => /Users/danwt/Documents/dym/d-dymension-rdk -replace github.com/dymensionxyz/dymension-rdk => github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250102180458-aea83a151bf2 +replace github.com/dymensionxyz/dymension-rdk => /Users/danwt/Documents/dym/d-dymension-rdk +//replace github.com/dymensionxyz/dymension-rdk => github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250102180458-aea83a151bf2 +replace github.com/cosmos/cosmos-sdk => /Users/danwt/Documents/dym/d-cosmos-sdk From 35a1baf48f3cabc3666ffcbd646ee1c44c7343b5 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Fri, 3 Jan 2025 16:09:23 +0000 Subject: [PATCH 24/34] go mod tidy --- go.mod | 3 ++- go.sum | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index c639dd3..d34a0b9 100644 --- a/go.mod +++ b/go.mod @@ -360,7 +360,7 @@ replace ( // Dymension Forks replace ( - github.com/cosmos/cosmos-sdk => github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73 + //github.com/cosmos/cosmos-sdk => github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73 github.com/evmos/evmos/v12 => github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.5.0-rc02 github.com/gorilla/rpc => github.com/dymensionxyz/rpc v1.3.1 github.com/osmosis-labs/osmosis/v15 => github.com/dymensionxyz/osmosis/v15 v15.2.0-dymension-v1.1.2 @@ -369,5 +369,6 @@ replace ( // TODO: cleanup after rdk is merged replace github.com/dymensionxyz/dymension-rdk => /Users/danwt/Documents/dym/d-dymension-rdk + //replace github.com/dymensionxyz/dymension-rdk => github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250102180458-aea83a151bf2 replace github.com/cosmos/cosmos-sdk => /Users/danwt/Documents/dym/d-cosmos-sdk diff --git a/go.sum b/go.sum index 1779870..94f1eba 100644 --- a/go.sum +++ b/go.sum @@ -573,12 +573,8 @@ github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQx github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/dymensionxyz/cometbft v0.34.29-0.20241128205759-2a9d5f015da5 h1:DIKsa7EWJRt+pIzzFn3MGYajwqaTmQQ/k255xONciRc= github.com/dymensionxyz/cometbft v0.34.29-0.20241128205759-2a9d5f015da5/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw= -github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73 h1:A0Oqua/AfzhBWvv4jiep48TAaAsh6wSwgCKBAqU/LQ0= -github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73/go.mod h1:VPUuzF+l+ekSGPV7VVB8m0OMQfwp3QdKWNZjvkU3A1U= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd h1:V89QyOFM84o9w0iFdctMU6So8SS/Xt32JWAXGqJduT0= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd/go.mod h1:3weqpVj/TqTFpC0LjEB3H+HZSpm7BrQ1QkEg1Ahy6KY= -github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250102180458-aea83a151bf2 h1:mUAW4hly5WY9rOaA6Upl2VfdUzh6IC3d4ucTYsou68A= -github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250102180458-aea83a151bf2/go.mod h1:p9rl2xNsbubJcxGnTIVF9D8aKAM+oPkCVdQ6Z6PM2Tw= github.com/dymensionxyz/dymint v1.3.0-rc03 h1:JRAGrLDMdM642lbcnIgRp3iuHhvLkq0z6LWKZlWLQyI= github.com/dymensionxyz/dymint v1.3.0-rc03/go.mod h1:C3VbfePK85aRCdA1iHzB2AYD+n1gKR9Pw+wm3wQUXvE= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.5.0-rc02 h1:G6rtzFNnzeYOHN33rkw0kMQX+xRantRLTip1AMXYmBg= From 366a0cd4a5d3a98214d0a3782a133a64d42153f8 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Fri, 3 Jan 2025 16:14:52 +0000 Subject: [PATCH 25/34] temp --- app/app.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/app.go b/app/app.go index f7313ad..4316881 100644 --- a/app/app.go +++ b/app/app.go @@ -7,6 +7,7 @@ import ( "os" "path/filepath" + errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/x/authz" authzkeeper "github.com/cosmos/cosmos-sdk/x/authz/keeper" authzmodule "github.com/cosmos/cosmos-sdk/x/authz/module" @@ -842,6 +843,7 @@ func NewRollapp( if loadLatest { if err := app.LoadLatestVersion(); err != nil { + err = errorsmod.Wrap(err, "new rollapp: load latest version") tmos.Exit(err.Error()) } } @@ -1171,6 +1173,8 @@ func (app *App) setupUpgradeHandler(u upgrades.Upgrade) { if upgradeInfo.Name == u.Name && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { // configure store loader with the store upgrades app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &u.StoreUpgrades)) + + app.Logger().Info("SetupUpgradeHandler Set store loader.") } } From 5cf148c07ec9e197e5bba83eaa8cdc01928ec5bf Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Fri, 3 Jan 2025 16:36:54 +0000 Subject: [PATCH 26/34] remove cosmos fork --- app/upgrades/drs-5-from2d/constants.go | 2 -- go.mod | 2 +- go.sum | 2 ++ 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/upgrades/drs-5-from2d/constants.go b/app/upgrades/drs-5-from2d/constants.go index ccbc633..b8de30a 100644 --- a/app/upgrades/drs-5-from2d/constants.go +++ b/app/upgrades/drs-5-from2d/constants.go @@ -4,7 +4,6 @@ import ( storetypes "github.com/cosmos/cosmos-sdk/store/types" authztypes "github.com/cosmos/cosmos-sdk/x/authz" "github.com/cosmos/cosmos-sdk/x/feegrant" - hubgenesistypes "github.com/dymensionxyz/dymension-rdk/x/hub-genesis/types" hubtypes "github.com/dymensionxyz/dymension-rdk/x/hub/types" rollappparamstypes "github.com/dymensionxyz/dymension-rdk/x/rollappparams/types" timeupgradetypes "github.com/dymensionxyz/dymension-rdk/x/timeupgrade/types" @@ -32,7 +31,6 @@ var Upgrade = upgrades.Upgrade{ feegrant.ModuleName, timeupgradetypes.ModuleName, hubtypes.ModuleName, - hubgenesistypes.ModuleName, rollappparamstypes.ModuleName, }, }, diff --git a/go.mod b/go.mod index d34a0b9..8aa12c5 100644 --- a/go.mod +++ b/go.mod @@ -371,4 +371,4 @@ replace ( replace github.com/dymensionxyz/dymension-rdk => /Users/danwt/Documents/dym/d-dymension-rdk //replace github.com/dymensionxyz/dymension-rdk => github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250102180458-aea83a151bf2 -replace github.com/cosmos/cosmos-sdk => /Users/danwt/Documents/dym/d-cosmos-sdk +//replace github.com/cosmos/cosmos-sdk => /Users/danwt/Documents/dym/d-cosmos-sdk diff --git a/go.sum b/go.sum index 94f1eba..bab15ca 100644 --- a/go.sum +++ b/go.sum @@ -465,6 +465,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0 github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= +github.com/cosmos/cosmos-sdk v0.46.16 h1:RVGv1+RulLZeNyfCaPZrZtv0kY7ZZNAI6JGpub0Uh6o= +github.com/cosmos/cosmos-sdk v0.46.16/go.mod h1:05U50tAsOzQ8JOAePshJCbJQw5ib1YJR6IXcqyVI1Xg= github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 h1:iKclrn3YEOwk4jQHT2ulgzuXyxmzmPczUalMwW4XH9k= github.com/cosmos/cosmos-sdk/ics23/go v0.8.0/go.mod h1:2a4dBq88TUoqoWAU5eu0lGvpFP3wWDPgdHPargtyw30= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= From 914539c1a39df160f65cd63e927e6c97c15a0f22 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Fri, 3 Jan 2025 16:37:06 +0000 Subject: [PATCH 27/34] have it working --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8aa12c5..86d792e 100644 --- a/go.mod +++ b/go.mod @@ -360,7 +360,7 @@ replace ( // Dymension Forks replace ( - //github.com/cosmos/cosmos-sdk => github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73 + github.com/cosmos/cosmos-sdk => github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73 github.com/evmos/evmos/v12 => github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.5.0-rc02 github.com/gorilla/rpc => github.com/dymensionxyz/rpc v1.3.1 github.com/osmosis-labs/osmosis/v15 => github.com/dymensionxyz/osmosis/v15 v15.2.0-dymension-v1.1.2 diff --git a/go.sum b/go.sum index bab15ca..aea0fae 100644 --- a/go.sum +++ b/go.sum @@ -465,8 +465,6 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0 github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.46.16 h1:RVGv1+RulLZeNyfCaPZrZtv0kY7ZZNAI6JGpub0Uh6o= -github.com/cosmos/cosmos-sdk v0.46.16/go.mod h1:05U50tAsOzQ8JOAePshJCbJQw5ib1YJR6IXcqyVI1Xg= github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 h1:iKclrn3YEOwk4jQHT2ulgzuXyxmzmPczUalMwW4XH9k= github.com/cosmos/cosmos-sdk/ics23/go v0.8.0/go.mod h1:2a4dBq88TUoqoWAU5eu0lGvpFP3wWDPgdHPargtyw30= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= @@ -575,6 +573,8 @@ github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQx github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/dymensionxyz/cometbft v0.34.29-0.20241128205759-2a9d5f015da5 h1:DIKsa7EWJRt+pIzzFn3MGYajwqaTmQQ/k255xONciRc= github.com/dymensionxyz/cometbft v0.34.29-0.20241128205759-2a9d5f015da5/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw= +github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73 h1:A0Oqua/AfzhBWvv4jiep48TAaAsh6wSwgCKBAqU/LQ0= +github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73/go.mod h1:VPUuzF+l+ekSGPV7VVB8m0OMQfwp3QdKWNZjvkU3A1U= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd h1:V89QyOFM84o9w0iFdctMU6So8SS/Xt32JWAXGqJduT0= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd/go.mod h1:3weqpVj/TqTFpC0LjEB3H+HZSpm7BrQ1QkEg1Ahy6KY= github.com/dymensionxyz/dymint v1.3.0-rc03 h1:JRAGrLDMdM642lbcnIgRp3iuHhvLkq0z6LWKZlWLQyI= From c080f9a9092de2046503215883fff56bbae12efc Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Fri, 3 Jan 2025 17:37:45 +0000 Subject: [PATCH 28/34] gpush --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 86d792e..8e732af 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/cosmos/cosmos-sdk v0.46.16 github.com/cosmos/ibc-go/v6 v6.2.1 github.com/dymensionxyz/dymension-rdk v1.8.0-rc02 - github.com/dymensionxyz/dymint v1.3.0-rc03 + github.com/dymensionxyz/dymint v1.3.0-rc02.0.20250103163841-ca8fff3c69ef github.com/ethereum/go-ethereum v1.12.0 github.com/evmos/evmos/v12 v12.1.6 github.com/gogo/protobuf v1.3.3 diff --git a/go.sum b/go.sum index aea0fae..296bb3b 100644 --- a/go.sum +++ b/go.sum @@ -577,8 +577,8 @@ github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73 h1:A0O github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73/go.mod h1:VPUuzF+l+ekSGPV7VVB8m0OMQfwp3QdKWNZjvkU3A1U= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd h1:V89QyOFM84o9w0iFdctMU6So8SS/Xt32JWAXGqJduT0= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd/go.mod h1:3weqpVj/TqTFpC0LjEB3H+HZSpm7BrQ1QkEg1Ahy6KY= -github.com/dymensionxyz/dymint v1.3.0-rc03 h1:JRAGrLDMdM642lbcnIgRp3iuHhvLkq0z6LWKZlWLQyI= -github.com/dymensionxyz/dymint v1.3.0-rc03/go.mod h1:C3VbfePK85aRCdA1iHzB2AYD+n1gKR9Pw+wm3wQUXvE= +github.com/dymensionxyz/dymint v1.3.0-rc02.0.20250103163841-ca8fff3c69ef h1:hXWYTeJuXjY7gs434vT9YovKURcC0/mykhq/R/ztKj4= +github.com/dymensionxyz/dymint v1.3.0-rc02.0.20250103163841-ca8fff3c69ef/go.mod h1:sqE+4imdASE9lm63jv+K2zmOnclLJNZLPYbL9m6vR3o= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.5.0-rc02 h1:G6rtzFNnzeYOHN33rkw0kMQX+xRantRLTip1AMXYmBg= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.5.0-rc02/go.mod h1:CI6D89pkoiIm4BjoMFNnEaCLdKBEobLuwvhS0c1zh7Y= github.com/dymensionxyz/gerr-cosmos v1.0.0 h1:oi91rgOkpJWr41oX9JOyjvvBnhGY54tj513x8VlDAEc= From ecff6906b37a7ffc44e018da823da57a4bc2f5cb Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Mon, 6 Jan 2025 10:00:52 +0000 Subject: [PATCH 29/34] set genesis info checksum --- app/upgrades/drs-5-from2d/upgrade.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/upgrades/drs-5-from2d/upgrade.go b/app/upgrades/drs-5-from2d/upgrade.go index 3d266ce..810fa02 100644 --- a/app/upgrades/drs-5-from2d/upgrade.go +++ b/app/upgrades/drs-5-from2d/upgrade.go @@ -40,6 +40,11 @@ func migrateHubGenesis(ctx sdk.Context, k hubgenkeeper.Keeper) error { Channel: "channel-0", } k.SetState(ctx, s) + /* + We need to set this otherwise PopulateGenesisInfo complains. + It's not actually used anywhere. + */ + k.SetGenesisInfo(ctx, hubgenesistypes.GenesisInfo{GenesisChecksum: "This is a placeholder - only exists for nim and mande due to migration - not real checksum"}) return k.PopulateGenesisInfo(ctx, nil) } From 6083881b238914de03170dbc746fc84b899a23fd Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Mon, 6 Jan 2025 10:03:40 +0000 Subject: [PATCH 30/34] fix order --- app/upgrades/drs-5-from2d/upgrade.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/upgrades/drs-5-from2d/upgrade.go b/app/upgrades/drs-5-from2d/upgrade.go index 810fa02..2be92fd 100644 --- a/app/upgrades/drs-5-from2d/upgrade.go +++ b/app/upgrades/drs-5-from2d/upgrade.go @@ -23,11 +23,17 @@ func CreateUpgradeHandler( return nil, fmt.Errorf("migrate hub genesis: %w", err) } + vmap, err := mm.RunMigrations(ctx, configurator, fromVM) + if err != nil { + return nil, fmt.Errorf("run migrations: %w", err) + } + + // rollappparams is a new module so needs to go after RunMigrations to go after InitGenesis if err := migrateRollappParams(ctx, kk.RpKeeper); err != nil { return nil, fmt.Errorf("migrate rollapp params: %w", err) } - return mm.RunMigrations(ctx, configurator, fromVM) + return vmap, nil } } From 9f389fa57cfd8d0d9a4a6f9826f98047514b0c76 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:53:38 +0000 Subject: [PATCH 31/34] use proper remote temporary replacements for rdk and dymint --- go.mod | 8 ++++---- go.sum | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 8e732af..0ff812d 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/cosmos/cosmos-sdk v0.46.16 github.com/cosmos/ibc-go/v6 v6.2.1 github.com/dymensionxyz/dymension-rdk v1.8.0-rc02 - github.com/dymensionxyz/dymint v1.3.0-rc02.0.20250103163841-ca8fff3c69ef + github.com/dymensionxyz/dymint v1.3.0-rc03 github.com/ethereum/go-ethereum v1.12.0 github.com/evmos/evmos/v12 v12.1.6 github.com/gogo/protobuf v1.3.3 @@ -368,7 +368,7 @@ replace ( ) // TODO: cleanup after rdk is merged -replace github.com/dymensionxyz/dymension-rdk => /Users/danwt/Documents/dym/d-dymension-rdk +//replace github.com/dymensionxyz/dymension-rdk => /Users/danwt/Documents/dym/d-dymension-rdk +replace github.com/dymensionxyz/dymension-rdk => github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250106124930-592d75f2ff0f -//replace github.com/dymensionxyz/dymension-rdk => github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250102180458-aea83a151bf2 -//replace github.com/cosmos/cosmos-sdk => /Users/danwt/Documents/dym/d-cosmos-sdk +replace github.com/dymensionxyz/dymint => github.com/dymensionxyz/dymint v1.3.0-rc02.0.20250106124459-756b49ffdf0c diff --git a/go.sum b/go.sum index 296bb3b..4667a54 100644 --- a/go.sum +++ b/go.sum @@ -577,8 +577,10 @@ github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73 h1:A0O github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73/go.mod h1:VPUuzF+l+ekSGPV7VVB8m0OMQfwp3QdKWNZjvkU3A1U= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd h1:V89QyOFM84o9w0iFdctMU6So8SS/Xt32JWAXGqJduT0= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd/go.mod h1:3weqpVj/TqTFpC0LjEB3H+HZSpm7BrQ1QkEg1Ahy6KY= -github.com/dymensionxyz/dymint v1.3.0-rc02.0.20250103163841-ca8fff3c69ef h1:hXWYTeJuXjY7gs434vT9YovKURcC0/mykhq/R/ztKj4= -github.com/dymensionxyz/dymint v1.3.0-rc02.0.20250103163841-ca8fff3c69ef/go.mod h1:sqE+4imdASE9lm63jv+K2zmOnclLJNZLPYbL9m6vR3o= +github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250106124930-592d75f2ff0f h1:QDgG3tU1fAYdP+UASDow87T7kEUyHss6pti+UefYZjE= +github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250106124930-592d75f2ff0f/go.mod h1:PgFH4LETkSRpSJDfxsvNs3VCb//O1nkbAM+cZWYkaVU= +github.com/dymensionxyz/dymint v1.3.0-rc02.0.20250106124459-756b49ffdf0c h1:tTwBWY63JcfNqB32TKI5TyNZ2vGhwP8I4N0hzsJy9V8= +github.com/dymensionxyz/dymint v1.3.0-rc02.0.20250106124459-756b49ffdf0c/go.mod h1:sqE+4imdASE9lm63jv+K2zmOnclLJNZLPYbL9m6vR3o= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.5.0-rc02 h1:G6rtzFNnzeYOHN33rkw0kMQX+xRantRLTip1AMXYmBg= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.5.0-rc02/go.mod h1:CI6D89pkoiIm4BjoMFNnEaCLdKBEobLuwvhS0c1zh7Y= github.com/dymensionxyz/gerr-cosmos v1.0.0 h1:oi91rgOkpJWr41oX9JOyjvvBnhGY54tj513x8VlDAEc= From 475570a633c30be6895cfaa777cf8e36cd647832 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Mon, 6 Jan 2025 13:04:39 +0000 Subject: [PATCH 32/34] fix rdk sig dep --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 0ff812d..26d8ddf 100644 --- a/go.mod +++ b/go.mod @@ -369,6 +369,6 @@ replace ( // TODO: cleanup after rdk is merged //replace github.com/dymensionxyz/dymension-rdk => /Users/danwt/Documents/dym/d-dymension-rdk -replace github.com/dymensionxyz/dymension-rdk => github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250106124930-592d75f2ff0f +replace github.com/dymensionxyz/dymension-rdk => github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250106130345-02ca863760b8 replace github.com/dymensionxyz/dymint => github.com/dymensionxyz/dymint v1.3.0-rc02.0.20250106124459-756b49ffdf0c diff --git a/go.sum b/go.sum index 4667a54..579def2 100644 --- a/go.sum +++ b/go.sum @@ -577,8 +577,8 @@ github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73 h1:A0O github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73/go.mod h1:VPUuzF+l+ekSGPV7VVB8m0OMQfwp3QdKWNZjvkU3A1U= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd h1:V89QyOFM84o9w0iFdctMU6So8SS/Xt32JWAXGqJduT0= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd/go.mod h1:3weqpVj/TqTFpC0LjEB3H+HZSpm7BrQ1QkEg1Ahy6KY= -github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250106124930-592d75f2ff0f h1:QDgG3tU1fAYdP+UASDow87T7kEUyHss6pti+UefYZjE= -github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250106124930-592d75f2ff0f/go.mod h1:PgFH4LETkSRpSJDfxsvNs3VCb//O1nkbAM+cZWYkaVU= +github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250106130345-02ca863760b8 h1:L+0O1BlZfZtVrRQkQdlFDTUlFyG0qM49Z8ucMD61upo= +github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250106130345-02ca863760b8/go.mod h1:PgFH4LETkSRpSJDfxsvNs3VCb//O1nkbAM+cZWYkaVU= github.com/dymensionxyz/dymint v1.3.0-rc02.0.20250106124459-756b49ffdf0c h1:tTwBWY63JcfNqB32TKI5TyNZ2vGhwP8I4N0hzsJy9V8= github.com/dymensionxyz/dymint v1.3.0-rc02.0.20250106124459-756b49ffdf0c/go.mod h1:sqE+4imdASE9lm63jv+K2zmOnclLJNZLPYbL9m6vR3o= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.5.0-rc02 h1:G6rtzFNnzeYOHN33rkw0kMQX+xRantRLTip1AMXYmBg= From f021952e42a8718cdc61aaff5f137040022ac1ce Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Mon, 6 Jan 2025 13:53:02 +0000 Subject: [PATCH 33/34] Going to change tactic and NOT populate genesis info --- app/upgrades/drs-5-from2d/upgrade.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/upgrades/drs-5-from2d/upgrade.go b/app/upgrades/drs-5-from2d/upgrade.go index 2be92fd..9bd6aec 100644 --- a/app/upgrades/drs-5-from2d/upgrade.go +++ b/app/upgrades/drs-5-from2d/upgrade.go @@ -46,8 +46,12 @@ func migrateHubGenesis(ctx sdk.Context, k hubgenkeeper.Keeper) error { Channel: "channel-0", } k.SetState(ctx, s) + /* - We need to set this otherwise PopulateGenesisInfo complains. + We set PopulateGenesisInfo because the state it writes is used by GetBaseDenom + + + We need to set a dummy checksum otherwise PopulateGenesisInfo complains. It's not actually used anywhere. */ k.SetGenesisInfo(ctx, hubgenesistypes.GenesisInfo{GenesisChecksum: "This is a placeholder - only exists for nim and mande due to migration - not real checksum"}) From 0a260f3ce2f7dc6cad36dfac8278fd058a2a0e53 Mon Sep 17 00:00:00 2001 From: danwt <30197399+danwt@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:11:55 +0000 Subject: [PATCH 34/34] dont populate genesis info --- app/upgrades/drs-5-from2d/upgrade.go | 13 +++---------- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/app/upgrades/drs-5-from2d/upgrade.go b/app/upgrades/drs-5-from2d/upgrade.go index 9bd6aec..1f7dc42 100644 --- a/app/upgrades/drs-5-from2d/upgrade.go +++ b/app/upgrades/drs-5-from2d/upgrade.go @@ -46,16 +46,9 @@ func migrateHubGenesis(ctx sdk.Context, k hubgenkeeper.Keeper) error { Channel: "channel-0", } k.SetState(ctx, s) - - /* - We set PopulateGenesisInfo because the state it writes is used by GetBaseDenom - - - We need to set a dummy checksum otherwise PopulateGenesisInfo complains. - It's not actually used anywhere. - */ - k.SetGenesisInfo(ctx, hubgenesistypes.GenesisInfo{GenesisChecksum: "This is a placeholder - only exists for nim and mande due to migration - not real checksum"}) - return k.PopulateGenesisInfo(ctx, nil) + // Note: we won't populate genesis info. It has difficulties, such as missing checksum and denom metadata. + // It isn't needed for established chains. + return nil } func migrateRollappParams(ctx sdk.Context, k rollappparamskeeper.Keeper) error { diff --git a/go.mod b/go.mod index 26d8ddf..c39bc0c 100644 --- a/go.mod +++ b/go.mod @@ -369,6 +369,6 @@ replace ( // TODO: cleanup after rdk is merged //replace github.com/dymensionxyz/dymension-rdk => /Users/danwt/Documents/dym/d-dymension-rdk -replace github.com/dymensionxyz/dymension-rdk => github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250106130345-02ca863760b8 +replace github.com/dymensionxyz/dymension-rdk => github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250106141106-c4bf86e13eaf replace github.com/dymensionxyz/dymint => github.com/dymensionxyz/dymint v1.3.0-rc02.0.20250106124459-756b49ffdf0c diff --git a/go.sum b/go.sum index 579def2..d03bb3c 100644 --- a/go.sum +++ b/go.sum @@ -577,8 +577,8 @@ github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73 h1:A0O github.com/dymensionxyz/cosmos-sdk v0.46.17-0.20241128210616-e9dfe47b8c73/go.mod h1:VPUuzF+l+ekSGPV7VVB8m0OMQfwp3QdKWNZjvkU3A1U= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd h1:V89QyOFM84o9w0iFdctMU6So8SS/Xt32JWAXGqJduT0= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd/go.mod h1:3weqpVj/TqTFpC0LjEB3H+HZSpm7BrQ1QkEg1Ahy6KY= -github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250106130345-02ca863760b8 h1:L+0O1BlZfZtVrRQkQdlFDTUlFyG0qM49Z8ucMD61upo= -github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250106130345-02ca863760b8/go.mod h1:PgFH4LETkSRpSJDfxsvNs3VCb//O1nkbAM+cZWYkaVU= +github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250106141106-c4bf86e13eaf h1:jo12b6NffdTwP3IRWUmec0OVrlfuOx/wHAi0w20RbZ0= +github.com/dymensionxyz/dymension-rdk v1.8.0-rc02.0.20250106141106-c4bf86e13eaf/go.mod h1:PgFH4LETkSRpSJDfxsvNs3VCb//O1nkbAM+cZWYkaVU= github.com/dymensionxyz/dymint v1.3.0-rc02.0.20250106124459-756b49ffdf0c h1:tTwBWY63JcfNqB32TKI5TyNZ2vGhwP8I4N0hzsJy9V8= github.com/dymensionxyz/dymint v1.3.0-rc02.0.20250106124459-756b49ffdf0c/go.mod h1:sqE+4imdASE9lm63jv+K2zmOnclLJNZLPYbL9m6vR3o= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.5.0-rc02 h1:G6rtzFNnzeYOHN33rkw0kMQX+xRantRLTip1AMXYmBg=