From 8250093f9f627c2b696481a72f0f90850b248a0f Mon Sep 17 00:00:00 2001 From: Sergi Rene Date: Thu, 12 Dec 2024 15:13:35 +0100 Subject: [PATCH 1/3] rdk version + test fix --- app/test_helpers.go | 4 +++- e2e/testing/chain.go | 2 ++ go.mod | 2 +- go.sum | 6 ++---- x/cwerrors/keeper/sudo_errors_test.go | 1 - 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/test_helpers.go b/app/test_helpers.go index aab4e42..f0ede60 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -19,6 +19,7 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/dymensionxyz/dymension-rdk/testutil/utils" rollappparamstypes "github.com/dymensionxyz/dymension-rdk/x/rollappparams/types" + "github.com/dymensionxyz/dymint/version" "github.com/tendermint/tendermint/crypto/encoding" "github.com/tendermint/tendermint/libs/log" "github.com/tendermint/tendermint/proto/tendermint/crypto" @@ -92,6 +93,7 @@ func SetupWithGenesisValSet(t *testing.T, valSet *types2.ValidatorSet, genAccs [ app, genesisState := setup(true, 5) genesisState = genesisStateWithValSet(t, app, genesisState, valSet, genAccs, balances...) + version.DRS = "1" genesisState = setRollappVersion(app.appCodec, genesisState, 1) denomMD := banktypes.Metadata{ @@ -126,7 +128,7 @@ func SetupWithGenesisValSet(t *testing.T, valSet *types2.ValidatorSet, genAccs [ ConsensusParams: utils.DefaultConsensusParams, AppStateBytes: stateBytes, ChainId: TestChainID, - GenesisChecksum: "notwmpty", + GenesisChecksum: "notempty", }, ) diff --git a/e2e/testing/chain.go b/e2e/testing/chain.go index 2a50c69..80c7b2e 100644 --- a/e2e/testing/chain.go +++ b/e2e/testing/chain.go @@ -28,6 +28,7 @@ import ( "github.com/cosmos/ibc-go/v6/testing/mock" rollappparamstypes "github.com/dymensionxyz/dymension-rdk/x/rollappparams/types" seqtypes "github.com/dymensionxyz/dymension-rdk/x/sequencers/types" + "github.com/dymensionxyz/dymint/version" "github.com/golang/protobuf/proto" //nolint:staticcheck "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" @@ -248,6 +249,7 @@ func NewTestChain(t *testing.T, chainIdx int, opts ...interface{}) *TestChain { } } genState[slashingTypes.ModuleName] = rollApp.AppCodec().MustMarshalJSON(slashingTypes.NewGenesisState(slashingTypes.DefaultParams(), signInfo, nil)) + version.DRS = "1" rollappParamsState := rollappparamstypes.DefaultGenesisState() rollappParamsState.Params.DrsVersion = 1 diff --git a/go.mod b/go.mod index 7db3c5e..4e1cd38 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/cosmos/gogoproto v1.5.0 github.com/cosmos/ibc-go/v6 v6.3.0 github.com/dvsekhvalnov/jose2go v1.5.0 - github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241211172411-14119cc73f17 + github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241212094010-b3df828e7611 github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241210155059-b7f6555f960c github.com/ethereum/go-ethereum v1.12.0 github.com/evmos/evmos/v12 v12.1.6 diff --git a/go.sum b/go.sum index f2a2985..59b2c5a 100644 --- a/go.sum +++ b/go.sum @@ -573,10 +573,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.6.1-0.20241211144227-68ba9bcc36c0 h1:wOF+zJzyNNLmnOxOSoax+OF5o6BSn6tKy6TqZafPzc4= -github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241211144227-68ba9bcc36c0/go.mod h1:L6vBXdlUPxHFUz3kjWwXdOun0uX3SrsD9KkpxWQkUy4= -github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241211172411-14119cc73f17 h1:D12T30p6UH5ccXbcC2diUAq3RMD3qbw3uBwlzYbfJsw= -github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241211172411-14119cc73f17/go.mod h1:L6vBXdlUPxHFUz3kjWwXdOun0uX3SrsD9KkpxWQkUy4= +github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241212094010-b3df828e7611 h1:uQuoHQ/q74Sk5hEHviry/34/VRzkbdCBKo9A5gXlMsQ= +github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241212094010-b3df828e7611/go.mod h1:L6vBXdlUPxHFUz3kjWwXdOun0uX3SrsD9KkpxWQkUy4= github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241210155059-b7f6555f960c h1:y6RSUu2GnWZaV6TRZIZaKRUH6+JTLMWpAPIPXFMWVqM= github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241210155059-b7f6555f960c/go.mod h1:C3VbfePK85aRCdA1iHzB2AYD+n1gKR9Pw+wm3wQUXvE= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.4.2 h1:aVP3off7u2vsvRH7lHAUPTLdf9/AfnzC/rvvi0wC/co= diff --git a/x/cwerrors/keeper/sudo_errors_test.go b/x/cwerrors/keeper/sudo_errors_test.go index 7885163..c751391 100644 --- a/x/cwerrors/keeper/sudo_errors_test.go +++ b/x/cwerrors/keeper/sudo_errors_test.go @@ -112,7 +112,6 @@ func (s *KeeperTestSuite) TestGetErrorsByContractAddress() { contractAddr2.String(), contractAdminAcc.Address.String(), ) - // Set errors for block 1 // 2 errors for contract1 // 1 error for contract2 From 70e43873c0150b34e532c9d4011c9e8ff31913a5 Mon Sep 17 00:00:00 2001 From: Sergi Rene Date: Thu, 12 Dec 2024 15:16:51 +0100 Subject: [PATCH 2/3] migrate rollapp params fix --- app/upgrades/drs-2/upgrade.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/upgrades/drs-2/upgrade.go b/app/upgrades/drs-2/upgrade.go index 9a046ab..47a5fde 100644 --- a/app/upgrades/drs-2/upgrade.go +++ b/app/upgrades/drs-2/upgrade.go @@ -14,13 +14,15 @@ func CreateUpgradeHandler( configurator module.Configurator, ) upgradetypes.UpgradeHandler { return func(ctx sdk.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { - da := rpKeeper.DA(ctx) - version := uint32(2) - params := rollappparamstypes.DefaultParams() - params.Da = da - params.DrsVersion = version - - rpKeeper.SetParams(ctx, params) + //migrate rollapp params with missing min-gas-prices and updating drs to 2 + err := rpKeeper.SetVersion(ctx, uint32(2)) + if err != nil { + return nil, err + } + err = rpKeeper.SetMinGasPrices(ctx, rollappparamstypes.DefaultParams().MinGasPrices) + if err != nil { + return nil, err + } return mm.RunMigrations(ctx, configurator, fromVM) } From f6765465afc05150a8953055340d42805ecbacf7 Mon Sep 17 00:00:00 2001 From: Sergi Rene Date: Fri, 13 Dec 2024 13:29:57 +0100 Subject: [PATCH 3/3] dymint version --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4e1cd38..1d00b6c 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/cosmos/ibc-go/v6 v6.3.0 github.com/dvsekhvalnov/jose2go v1.5.0 github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241212094010-b3df828e7611 - github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241210155059-b7f6555f960c + github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241213113333-2a07ba36444a 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 59b2c5a..8d5c5ce 100644 --- a/go.sum +++ b/go.sum @@ -575,8 +575,8 @@ github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd h github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20241121093220-e0d7ad456fbd/go.mod h1:3weqpVj/TqTFpC0LjEB3H+HZSpm7BrQ1QkEg1Ahy6KY= github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241212094010-b3df828e7611 h1:uQuoHQ/q74Sk5hEHviry/34/VRzkbdCBKo9A5gXlMsQ= github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241212094010-b3df828e7611/go.mod h1:L6vBXdlUPxHFUz3kjWwXdOun0uX3SrsD9KkpxWQkUy4= -github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241210155059-b7f6555f960c h1:y6RSUu2GnWZaV6TRZIZaKRUH6+JTLMWpAPIPXFMWVqM= -github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241210155059-b7f6555f960c/go.mod h1:C3VbfePK85aRCdA1iHzB2AYD+n1gKR9Pw+wm3wQUXvE= +github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241213113333-2a07ba36444a h1:6NKKbfOxjcPun7UZ0Aj8sjGjtPHZFn0nKlFbbQelpzQ= +github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241213113333-2a07ba36444a/go.mod h1:C3VbfePK85aRCdA1iHzB2AYD+n1gKR9Pw+wm3wQUXvE= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.4.2 h1:aVP3off7u2vsvRH7lHAUPTLdf9/AfnzC/rvvi0wC/co= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.4.2/go.mod h1:CI6D89pkoiIm4BjoMFNnEaCLdKBEobLuwvhS0c1zh7Y= github.com/dymensionxyz/gerr-cosmos v1.0.0 h1:oi91rgOkpJWr41oX9JOyjvvBnhGY54tj513x8VlDAEc=