diff --git a/app/app.go b/app/app.go index 87c87658e..f9beabe34 100644 --- a/app/app.go +++ b/app/app.go @@ -702,17 +702,19 @@ func New( } } - // enable diff for reconciliation - bankIavl, ok := ms.GetCommitStore(keys[banktypes.StoreKey]).(*iavl.Store) - if !ok { - tmos.Exit("cannot convert bank store to ival store") - } - bankIavl.EnableDiff() - paymentIavl, ok := ms.GetCommitStore(keys[paymentmoduletypes.StoreKey]).(*iavl.Store) - if !ok { - tmos.Exit("cannot convert payment store to ival store") + if app.IsIavlStore() { + //enable diff for reconciliation + bankIavl, ok := ms.GetCommitStore(keys[banktypes.StoreKey]).(*iavl.Store) + if !ok { + tmos.Exit("cannot convert bank store to ival store") + } + bankIavl.EnableDiff() + paymentIavl, ok := ms.GetCommitStore(keys[paymentmoduletypes.StoreKey]).(*iavl.Store) + if !ok { + tmos.Exit("cannot convert payment store to ival store") + } + paymentIavl.EnableDiff() } - paymentIavl.EnableDiff() app.initModules(ctx) @@ -763,9 +765,11 @@ func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.R // EndBlocker application updates every end block func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { resp := app.mm.EndBlock(ctx, req) - bankIavl, _ := app.CommitMultiStore().GetCommitStore(sdk.NewKVStoreKey(banktypes.StoreKey)).(*iavl.Store) - paymentIavl, _ := app.CommitMultiStore().GetCommitStore(sdk.NewKVStoreKey(paymentmoduletypes.StoreKey)).(*iavl.Store) - app.reconcile(ctx, bankIavl, paymentIavl) + if app.IsIavlStore() { + bankIavl, _ := app.CommitMultiStore().GetCommitStore(sdk.NewKVStoreKey(banktypes.StoreKey)).(*iavl.Store) + paymentIavl, _ := app.CommitMultiStore().GetCommitStore(sdk.NewKVStoreKey(paymentmoduletypes.StoreKey)).(*iavl.Store) + app.reconcile(ctx, bankIavl, paymentIavl) + } return resp } diff --git a/cmd/gnfd/cmd/root.go b/cmd/gnfd/cmd/root.go index 521973dcc..91b59bb15 100644 --- a/cmd/gnfd/cmd/root.go +++ b/cmd/gnfd/cmd/root.go @@ -370,6 +370,7 @@ func (a appCreator) newApp( baseapp.SetIAVLDisableFastNode(cast.ToBool(appOpts.Get(server.FlagDisableIAVLFastNode))), baseapp.SetChainID(chainID), baseapp.SetEnableUnsafeQuery(cast.ToBool(appOpts.Get(server.FlagEnableUnsafeQuery))), + baseapp.SetEnablePlainStore(cast.ToBool(appOpts.Get(server.FlagEnablePlainStore))), ) } diff --git a/go.mod b/go.mod index 0442f2f54..e5771671d 100644 --- a/go.mod +++ b/go.mod @@ -174,10 +174,10 @@ replace ( cosmossdk.io/api => github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230425074444-eb5869b05fe9 cosmossdk.io/math => github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230425074444-eb5869b05fe9 github.com/btcsuite/btcd => github.com/btcsuite/btcd v0.23.0 - github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v0.0.2 + github.com/cometbft/cometbft => github.com/bnb-chain/greenfield-cometbft v0.0.0-20230811080536-f2d046dfe48e github.com/cometbft/cometbft-db => github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 - github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v0.2.4-alpha.1 + github.com/cosmos/cosmos-sdk => github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20230811095344-f1b1f69e0079 github.com/cosmos/iavl => github.com/bnb-chain/greenfield-iavl v0.20.1 github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 ) diff --git a/go.sum b/go.sum index 92ce2a9cd..714f9c5af 100644 --- a/go.sum +++ b/go.sum @@ -159,12 +159,12 @@ github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsy github.com/bits-and-blooms/bitset v1.2.0 h1:Kn4yilvwNtMACtf1eYDlG8H77R07mZSPbMjLyS07ChA= github.com/bits-and-blooms/bitset v1.2.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= -github.com/bnb-chain/greenfield-cometbft v0.0.2 h1:bRamS8Lq1lA3ttRLZBha22uiNG5tqN+diD3hapdUCYI= -github.com/bnb-chain/greenfield-cometbft v0.0.2/go.mod h1:EBmwmUdaNbGPyGjf1cMuoN3pAeM2tQu7Lfg95813EAw= +github.com/bnb-chain/greenfield-cometbft v0.0.0-20230811080536-f2d046dfe48e h1:LZw+XR1RVZdg2p+cF1PN86nCYus+2ts6svQs3CRqLho= +github.com/bnb-chain/greenfield-cometbft v0.0.0-20230811080536-f2d046dfe48e/go.mod h1:3nGT4Z9fHwgRlBY/rofn0rSarnIcNbuhz/eq0XlLlkg= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1 h1:XcWulGacHVRiSCx90Q8Y//ajOrLNBQWR/KDB89dy3cU= github.com/bnb-chain/greenfield-cometbft-db v0.8.1-alpha.1/go.mod h1:ey1CiK4bYo1RBNJLRiVbYr5CMdSxci9S/AZRINLtppI= -github.com/bnb-chain/greenfield-cosmos-sdk v0.2.4-alpha.1 h1:SpkwHzAjIllIQG8av7MybFjJ8mhW1ZZ+P9JqJIsENxI= -github.com/bnb-chain/greenfield-cosmos-sdk v0.2.4-alpha.1/go.mod h1:vyZi5fr4gZBVbhV/TLxbm6T8vylHXbfqQmDCUCUPPfo= +github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20230811095344-f1b1f69e0079 h1:C1sFQsljpyOu+yUmnl31GeLZLIiKxEaP3CcTCpUNeEA= +github.com/bnb-chain/greenfield-cosmos-sdk v0.2.3-alpha.3.0.20230811095344-f1b1f69e0079/go.mod h1:75pTFtmS49bTHiHmzBFsxcP6rqPiKb9z0dDdJYgDVg0= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230425074444-eb5869b05fe9 h1:6fLpmmI0EZvDTfPvI0zy5dBaaTUboHnEkoC5/p/w8TQ= github.com/bnb-chain/greenfield-cosmos-sdk/api v0.0.0-20230425074444-eb5869b05fe9/go.mod h1:rbc4o84RSEvhf09o2+4Qiazsv0snRJLiEZdk17HeIDw= github.com/bnb-chain/greenfield-cosmos-sdk/math v0.0.0-20230425074444-eb5869b05fe9 h1:1ZdK+iR1Up02bOa2YTZCml7PBpP//kcdamOcK6aWO/s=