From a48f617bad9db5fd364f0682a834a139e7d21274 Mon Sep 17 00:00:00 2001 From: yihuang Date: Thu, 22 Sep 2022 16:16:17 +0800 Subject: [PATCH] Problem: new iavl indexes migration is slow and not optional (#714) * Problem: new iavl indexes migration is slow and not optional Closes: #712 Solution: - Integrate the option introduced in cosmos-sdk * Update CHANGELOG.md Signed-off-by: yihuang Signed-off-by: yihuang --- CHANGELOG.md | 1 + cmd/cronosd/cmd/root.go | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b789e50b43..9491374bf6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ### Improvements - [cronos#702](https://github.com/crypto-org-chain/cronos/pull/702) Integrate the file state streamer. +- [cronos#714](https://github.com/crypto-org-chain/cronos/pull/714) Add option `iavl-disable-fastnode` to disable iavl fastnode indexing migration. *September 13, 2022* diff --git a/cmd/cronosd/cmd/root.go b/cmd/cronosd/cmd/root.go index 0357883043..39f88d7486 100644 --- a/cmd/cronosd/cmd/root.go +++ b/cmd/cronosd/cmd/root.go @@ -213,9 +213,6 @@ type appCreator struct { encCfg params.EncodingConfig } -// missing flag from cosmos-sdk -const flagIAVLCacheSize = "iavl-cache-size" - // newApp is an AppCreator func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, appOpts servertypes.AppOptions) servertypes.Application { var cache sdk.MultiStorePersistentCache @@ -271,7 +268,8 @@ func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, a baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))), baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))), baseapp.SetSnapshot(snapshotStore, snapshotOptions), - baseapp.SetIAVLCacheSize(cast.ToInt(appOpts.Get(flagIAVLCacheSize))), + baseapp.SetIAVLCacheSize(cast.ToInt(appOpts.Get(server.FlagIAVLCacheSize))), + baseapp.SetIAVLDisableFastNode(cast.ToBool(appOpts.Get(server.FlagIAVLFastNode))), ) }