From 77cde583ad9dedb7777c34fa6c73cc03db95dd53 Mon Sep 17 00:00:00 2001 From: Derek Adams Date: Tue, 14 Jun 2022 11:15:55 -0400 Subject: [PATCH 1/3] add upgrade handler. fix lint errors. update changelog version --- CHANGELOG.md | 2 +- app/upgrades.go | 65 +--------------------------- internal/handlers/msg_fee_handler.go | 1 + internal/handlers/msg_fee_invoker.go | 4 -- 4 files changed, 4 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a8f50a3ec..8ce8e679d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,7 +39,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ --- -## [v1.11.0](https://github.com/provenance-io/provenance/releases/tag/v1.11.0) - 2022-06-13 +## [v1.11.1-rc1](https://github.com/provenance-io/provenance/releases/tag/v1.11.1-rc1) - 2022-06-14 ### Features diff --git a/app/upgrades.go b/app/upgrades.go index fa853de3c5..378819ed10 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -9,8 +9,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" - "github.com/cosmos/ibc-go/v2/modules/core/exported" - ibcctmtypes "github.com/cosmos/ibc-go/v2/modules/light-clients/07-tendermint/types" attributetypes "github.com/provenance-io/provenance/x/attribute/types" markertypes "github.com/provenance-io/provenance/x/marker/types" @@ -36,67 +34,8 @@ type appUpgrade struct { } var handlers = map[string]appUpgrade{ - "green": { - Handler: func(app *App, ctx sdk.Context, plan upgradetypes.Plan) (module.VersionMap, error) { - // Ensure consensus params are correct and match mainnet/testnet. Max Block Sizes: 60M gas, 5MB - params := app.GetConsensusParams(ctx) - params.Block.MaxBytes = 1024 * 1024 * 5 // 5MB - params.Block.MaxGas = 60_000_000 // With ante tx gas limit this will yield 3M gas max per tx. - app.StoreConsensusParams(ctx, params) - - app.IBCKeeper.ClientKeeper.IterateClients(ctx, func(clientId string, state exported.ClientState) bool { - tc, ok := (state).(*ibcctmtypes.ClientState) - if ok { - tc.AllowUpdateAfterExpiry = true - app.IBCKeeper.ClientKeeper.SetClientState(ctx, clientId, state) - } - return false - }) - - // set governance deposit requirement to 50,000HASH - govParams := app.GovKeeper.GetDepositParams(ctx) - beforeDeposit := govParams.MinDeposit - govParams.MinDeposit = sdk.NewCoins(sdk.NewCoin(DefaultBondDenom, sdk.NewInt(50_000_000_000_000))) - app.GovKeeper.SetDepositParams(ctx, govParams) - ctx.Logger().Info(fmt.Sprintf("Updated governance module minimum deposit from %s to %s", beforeDeposit, govParams.MinDeposit)) - - // set attribute param length to 1,000 from 10,000 - attrParams := app.AttributeKeeper.GetParams(ctx) - beforeLength := attrParams.MaxValueLength - attrParams.MaxValueLength = 1_000 - app.AttributeKeeper.SetParams(ctx, attrParams) - ctx.Logger().Info(fmt.Sprintf("Updated attribute module max length value from %d to %d", beforeLength, attrParams.MaxValueLength)) - - // Note: retrieving current module versions from upgrade keeper - // metadata module will be at from version 2 going to version 3 - // msgfees module will not be in version map this will cause runmigrations to create it and run InitGenesis - versionMap := app.UpgradeKeeper.GetModuleVersionMap(ctx) - ctx.Logger().Info("NOTICE: Starting migrations. This may take a significant amount of time to complete. Do not restart node.") - resultVM, err := app.mm.RunMigrations(ctx, app.configurator, versionMap) - if err != nil { - return resultVM, err - } - - return resultVM, AddMsgBasedFees(app, ctx) - - }, - Added: []string{msgfeestypes.ModuleName}, - }, - "hazel": {}, - "indigo": {}, // upgrade for pio-testnet-1 from v1.8.0-rc7 to v1.8.0-rc8 - "jasmine": { - Handler: func(app *App, ctx sdk.Context, plan upgradetypes.Plan) (module.VersionMap, error) { - // Ensure consensus params are correct and match mainnet/testnet. Max Block Sizes: 60M gas, 5MB - params := app.GetConsensusParams(ctx) - params.Block.MaxBytes = 1024 * 1024 * 5 // 5MB - params.Block.MaxGas = 60_000_000 // With ante tx gas limit this will yield 3M gas max per tx. - app.StoreConsensusParams(ctx, params) - versionMap := app.UpgradeKeeper.GetModuleVersionMap(ctx) - return versionMap, nil - }, // upgrade for pio-testnet-1 from v1.8.0-rc8 to v1.8.0-rc9 - }, - "kahlua": {}, // upgrade for pio-testnet-1 from v1.8.0-rc9 to v1.8.0 - "lava": {}, // upgrade for 1.10.0 + "lava": {}, // upgrade for 1.10.0 + "mango": {}, // upgrade for 1.11.1 // TODO - Add new upgrade definitions here. } diff --git a/internal/handlers/msg_fee_handler.go b/internal/handlers/msg_fee_handler.go index fadcf4ea2c..56b8e1506c 100644 --- a/internal/handlers/msg_fee_handler.go +++ b/internal/handlers/msg_fee_handler.go @@ -5,6 +5,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + msgfeestypes "github.com/provenance-io/provenance/x/msgfees/types" ) diff --git a/internal/handlers/msg_fee_invoker.go b/internal/handlers/msg_fee_invoker.go index 79717e9ccf..eade9f5177 100644 --- a/internal/handlers/msg_fee_invoker.go +++ b/internal/handlers/msg_fee_invoker.go @@ -36,8 +36,6 @@ func (afd MsgFeeInvoker) Invoke(ctx sdk.Context, simulate bool) (coins sdk.Coins eventsToReturn := sdk.Events{} if ctx.TxBytes() != nil && len(ctx.TxBytes()) != 0 { - originalGasMeter := ctx.GasMeter() - tx, err := afd.txDecoder(ctx.TxBytes()) if err != nil { panic(fmt.Errorf("error in chargeFees() while getting txBytes: %w", err)) @@ -123,8 +121,6 @@ func (afd MsgFeeInvoker) Invoke(ctx sdk.Context, simulate bool) (coins sdk.Coins eventsToReturn = append(eventsToReturn, msgFeesSummaryEvent) } } - - ctx = ctx.WithGasMeter(originalGasMeter) } return chargedFees, eventsToReturn, nil From 87cc95d4a003887fc4478f7439668bad12844215 Mon Sep 17 00:00:00 2001 From: Derek Adams Date: Tue, 14 Jun 2022 12:58:00 -0400 Subject: [PATCH 2/3] separate changelog sections for v1.11.0 -> v1.11.1-rc1 updates --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ce8e679d6..9799466d7b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,12 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [v1.11.1-rc1](https://github.com/provenance-io/provenance/releases/tag/v1.11.1-rc1) - 2022-06-14 +### Bug Fixes + +* Add `mango` upgrade handler. + +## [v1.11.0](https://github.com/provenance-io/provenance/releases/tag/v1.11.0) - 2022-06-13 + ### Features * Add CONTROLLER, and VALIDATOR PartyTypes for contract execution. [\#824](https://github.com/provenance-io/provenance/pull/824]) From e23fde9361c4add4fdc1100f38fe182b0f09ca98 Mon Sep 17 00:00:00 2001 From: Derek Adams Date: Tue, 14 Jun 2022 13:03:59 -0400 Subject: [PATCH 3/3] Improve markdown for changelog entries Co-authored-by: Daniel Wedul --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9799466d7b..db18910ac5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * Add `mango` upgrade handler. +--- + ## [v1.11.0](https://github.com/provenance-io/provenance/releases/tag/v1.11.0) - 2022-06-13 ### Features