Skip to content

Commit

Permalink
fix the bug not setting iavl-cache-size value of app.toml (#679)
Browse files Browse the repository at this point in the history
* fix: the bug not setting `iavl-cache-size` value of the `app.toml` and change `DefaultIAVLCacheSize`

Signed-off-by: zemyblue <[email protected]>

* chore: add more warning descriptions

Signed-off-by: zemyblue <[email protected]>

* chore: add changelog

Signed-off-by: zemyblue <[email protected]>

Signed-off-by: zemyblue <[email protected]>
  • Loading branch information
zemyblue authored Sep 21, 2022
1 parent 80ba750 commit 4b3add8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (x/wasm) [\#640](https://github.com/line/lbm-sdk/pull/640) remove legacy codes of wasm
* (amino) [\#635](https://github.com/line/lbm-sdk/pull/635) change some minor things that haven't been fixed in #549
* (store) [\#666](https://github.com/line/lbm-sdk/pull/666) change default `iavl-cache-size` and description
* (simapp) [\#679](https://github.com/line/lbm-sdk/pull/679) fix the bug not setting `iavl-cache-size` value of `app.toml`

### Breaking Changes
* (proto) [\#564](https://github.com/line/lbm-sdk/pull/564) change gRPC path to original cosmos path
Expand Down
2 changes: 2 additions & 0 deletions server/config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ inter-block-cache = {{ .BaseConfig.InterBlockCache }}
inter-block-cache-size = {{ .BaseConfig.InterBlockCacheSize }}
# IAVLCacheSize is the maximum units size of iavl node cache (1 unit is 128 bytes)
# This iavl cache size is just one store cache size, and the store exists for each modules.
# So be careful that all iavl cache size are difference from this iavl cache size value.
iavl-cache-size = {{ .BaseConfig.IAVLCacheSize }}
# IndexEvents defines the set of events in the form {eventType}.{attributeKey},
Expand Down
1 change: 1 addition & 0 deletions simapp/simd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ func (a appCreator) newApp(logger log.Logger, db dbm.DB, traceStore io.Writer, a
baseapp.SetInterBlockCache(cache),
baseapp.SetTrace(cast.ToBool(appOpts.Get(server.FlagTrace))),
baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))),
baseapp.SetIAVLCacheSize(cast.ToInt(appOpts.Get(server.FlagIAVLCacheSize))),
baseapp.SetSnapshotStore(snapshotStore),
baseapp.SetSnapshotInterval(cast.ToUint64(appOpts.Get(server.FlagStateSyncSnapshotInterval))),
baseapp.SetSnapshotKeepRecent(cast.ToUint32(appOpts.Get(server.FlagStateSyncSnapshotKeepRecent))),
Expand Down
4 changes: 2 additions & 2 deletions store/iavl/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (

const (
// DefaultIAVLCacheSize is default Iavl cache units size. 1 unit is 128 byte
// default 128MB
DefaultIAVLCacheSize = 1024 * 1024
// default 64MB
DefaultIAVLCacheSize = 1024 * 512
)

var (
Expand Down

0 comments on commit 4b3add8

Please sign in to comment.