From 1a223427d1c4803f6c37f1010a717c98406118a2 Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Wed, 22 Sep 2021 07:06:58 +0200 Subject: [PATCH] feat: revert "enabled snapshot by default" ## Description Reverts commit 96dff741 This is done to prevent adding such feature without additional study on the consequences. An ADR should be created before applying this change. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://docs.cosmos.network/v0.44/building-modules/intro.html) - [ ] included the necessary unit and integration [tests](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- CHANGELOG.md | 2 -- app/desmos/cmd/init.go | 39 --------------------------------------- app/desmos/cmd/root.go | 2 +- 3 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 app/desmos/cmd/init.go diff --git a/CHANGELOG.md b/CHANGELOG.md index d8997a6f2c..a50a766391 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). # Changelog ## [Unreleased] - Renamed `PollData` and `PollAnswer` to `Poll` and `ProvidedAnswer` ([\#536]((https://github.com/desmos-labs/desmos/issues/536))) -- Enabled snapshot by default ([\#529](https://github.com/desmos-labs/desmos/pull/529)) - ## Version 1.0.3 ### Bug fixes - Fixed the help of the `desmos tx profiles save` command diff --git a/app/desmos/cmd/init.go b/app/desmos/cmd/init.go deleted file mode 100644 index b06adfedd2..0000000000 --- a/app/desmos/cmd/init.go +++ /dev/null @@ -1,39 +0,0 @@ -package cmd - -// DONTCOVER - -import ( - "path/filepath" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - srvconfig "github.com/cosmos/cosmos-sdk/server/config" - "github.com/cosmos/cosmos-sdk/types/module" - cosmosgenutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" -) - -// initCmd returns a command that initializes all files needed for Tendermint -// and the respective application. -func initCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command { - cmd := cosmosgenutilcli.InitCmd(mbm, defaultNodeHome) - defaultRun := cmd.RunE - cmd.RunE = func(cmd *cobra.Command, args []string) error { - clientCtx := client.GetClientContextFromCmd(cmd) - err := defaultRun(cmd, args) - if err != nil { - return err - } - // Set app.toml file - appConfig := srvconfig.DefaultConfig() - appConfig.Pruning = "custom" - appConfig.PruningKeepRecent = "100" - appConfig.PruningKeepEvery = "500" - appConfig.PruningInterval = "10" - - appConfig.StateSync.SnapshotInterval = 500 - srvconfig.WriteConfigFile(filepath.Join(clientCtx.HomeDir, "config", "app.toml"), appConfig) - return nil - } - return cmd -} diff --git a/app/desmos/cmd/root.go b/app/desmos/cmd/root.go index 1c2fa029f0..fc476ed71b 100644 --- a/app/desmos/cmd/root.go +++ b/app/desmos/cmd/root.go @@ -154,7 +154,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) { cfg.Seal() rootCmd.AddCommand( - initCmd(app.ModuleBasics, app.DefaultNodeHome), + cosmosgenutilcli.InitCmd(app.ModuleBasics, app.DefaultNodeHome), cosmosgenutilcli.CollectGenTxsCmd(banktypes.GenesisBalancesIterator{}, app.DefaultNodeHome), genutilcli.MigrationsListCmd(), genutilcli.MigrateGenesisCmd(),