Skip to content

Commit 412e2fc

Browse files
authored
feat: configurable fastnode (cosmos#13321)
1 parent 822900b commit 412e2fc

23 files changed

+109
-75
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
8888
* [#13233](https://github.com/cosmos/cosmos-sdk/pull/13233) Add `--append` to `add-genesis-account` sub-command to append new tokens after an account is already created.
8989
* [#13236](https://github.com/cosmos/cosmos-sdk/pull/13236) Integrate Filter Logging
9090
* [#13301](https://github.com/cosmos/cosmos-sdk/pull/13301) Keep the balance query endpoint compatible with legacy blocks
91+
* [#13321](https://github.com/cosmos/cosmos-sdk/pull/13321) Add flag to disable fast node migration and usage.
9192

9293
### State Machine Breaking
9394

baseapp/options.go

+5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ func SetIAVLCacheSize(size int) func(*BaseApp) {
6464
return func(bapp *BaseApp) { bapp.cms.SetIAVLCacheSize(size) }
6565
}
6666

67+
// SetIAVLDisableFastNode enables(false)/disables(true) fast node usage from the IAVL store.
68+
func SetIAVLDisableFastNode(disable bool) func(*BaseApp) {
69+
return func(bapp *BaseApp) { bapp.cms.SetIAVLDisableFastNode(disable) }
70+
}
71+
6772
// SetInterBlockCache provides a BaseApp option function that sets the
6873
// inter-block cache.
6974
func SetInterBlockCache(cache sdk.MultiStorePersistentCache) func(*BaseApp) {

fuzz/tests/store_internal_proofs_createnonmembershipproof_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ func FuzzStoreInternalProofsCreateNonmembershipProof(f *testing.F) {
2525
if len(sz.Data) == 0 || len(sz.Key) == 0 {
2626
return
2727
}
28-
tree, err := iavl.NewMutableTree(db.NewMemDB(), 0)
28+
tree, err := iavl.NewMutableTree(db.NewMemDB(), 0, false)
2929
if err != nil {
3030
t.Fatal(err)
3131
}

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ require (
2121
github.com/cosmos/cosmos-sdk/store/tools/ics23 v0.0.0-20220820010601-dc361be9e3ff
2222
github.com/cosmos/go-bip39 v1.0.0
2323
github.com/cosmos/gogoproto v1.4.2
24-
github.com/cosmos/iavl v0.19.1
24+
github.com/cosmos/iavl v0.19.2-0.20220916140702-9b6be3095313
2525
github.com/cosmos/ledger-cosmos-go v0.11.1
2626
github.com/gogo/gateway v1.1.0
2727
github.com/golang/mock v1.6.0

go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ github.com/cosmos/gogoproto v1.4.2 h1:UeGRcmFW41l0G0MiefWhkPEVEwvu78SZsHBvI78dAY
197197
github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU=
198198
github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y=
199199
github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw=
200-
github.com/cosmos/iavl v0.19.1 h1:3gaq9b6SjiB0KBTygRnAvEGml2pQlu1TH8uma5g63Ys=
201-
github.com/cosmos/iavl v0.19.1/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw=
200+
github.com/cosmos/iavl v0.19.2-0.20220916140702-9b6be3095313 h1:R7CnaI/0OLwOusy7n9750n8fqQ3yCQ8OJQI2L3ws9RA=
201+
github.com/cosmos/iavl v0.19.2-0.20220916140702-9b6be3095313/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw=
202202
github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo=
203203
github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA=
204204
github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4=

server/config/config.go

+26-20
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,13 @@ type BaseConfig struct {
8181
// IndexEvents defines the set of events in the form {eventType}.{attributeKey},
8282
// which informs Tendermint what to index. If empty, all events will be indexed.
8383
IndexEvents []string `mapstructure:"index-events"`
84+
8485
// IavlCacheSize set the size of the iavl tree cache.
8586
IAVLCacheSize uint64 `mapstructure:"iavl-cache-size"`
8687

88+
// IAVLDisableFastnNode enables or disables the fast sync node.
89+
IAVLDisableFastnNode bool `mapstructure:"iavl-disable-fastnode"`
90+
8791
// AppDBBackend defines the type of Database to use for the application and snapshots databases.
8892
// An empty string indicates that the Tendermint config's DBBackend value should be used.
8993
AppDBBackend string `mapstructure:"app-db-backend"`
@@ -236,15 +240,16 @@ func (c *Config) GetMinGasPrices() sdk.DecCoins {
236240
func DefaultConfig() *Config {
237241
return &Config{
238242
BaseConfig: BaseConfig{
239-
MinGasPrices: defaultMinGasPrices,
240-
InterBlockCache: true,
241-
Pruning: pruningtypes.PruningOptionDefault,
242-
PruningKeepRecent: "0",
243-
PruningInterval: "0",
244-
MinRetainBlocks: 0,
245-
IndexEvents: make([]string, 0),
246-
IAVLCacheSize: 781250, // 50 MB
247-
AppDBBackend: "",
243+
MinGasPrices: defaultMinGasPrices,
244+
InterBlockCache: true,
245+
Pruning: pruningtypes.PruningOptionDefault,
246+
PruningKeepRecent: "0",
247+
PruningInterval: "0",
248+
MinRetainBlocks: 0,
249+
IndexEvents: make([]string, 0),
250+
IAVLCacheSize: 781250, // 50 MB
251+
IAVLDisableFastnNode: false,
252+
AppDBBackend: "",
248253
},
249254
Telemetry: telemetry.Config{
250255
Enabled: false,
@@ -306,17 +311,18 @@ func GetConfig(v *viper.Viper) (Config, error) {
306311

307312
return Config{
308313
BaseConfig: BaseConfig{
309-
MinGasPrices: v.GetString("minimum-gas-prices"),
310-
InterBlockCache: v.GetBool("inter-block-cache"),
311-
Pruning: v.GetString("pruning"),
312-
PruningKeepRecent: v.GetString("pruning-keep-recent"),
313-
PruningInterval: v.GetString("pruning-interval"),
314-
HaltHeight: v.GetUint64("halt-height"),
315-
HaltTime: v.GetUint64("halt-time"),
316-
IndexEvents: v.GetStringSlice("index-events"),
317-
MinRetainBlocks: v.GetUint64("min-retain-blocks"),
318-
IAVLCacheSize: v.GetUint64("iavl-cache-size"),
319-
AppDBBackend: v.GetString("app-db-backend"),
314+
MinGasPrices: v.GetString("minimum-gas-prices"),
315+
InterBlockCache: v.GetBool("inter-block-cache"),
316+
Pruning: v.GetString("pruning"),
317+
PruningKeepRecent: v.GetString("pruning-keep-recent"),
318+
PruningInterval: v.GetString("pruning-interval"),
319+
HaltHeight: v.GetUint64("halt-height"),
320+
HaltTime: v.GetUint64("halt-time"),
321+
IndexEvents: v.GetStringSlice("index-events"),
322+
MinRetainBlocks: v.GetUint64("min-retain-blocks"),
323+
IAVLCacheSize: v.GetUint64("iavl-cache-size"),
324+
IAVLDisableFastnNode: v.GetBool("iavl-disable-fastnode"),
325+
AppDBBackend: v.GetString("app-db-backend"),
320326
},
321327
Telemetry: telemetry.Config{
322328
ServiceName: v.GetString("telemetry.service-name"),

server/config/toml.go

+4
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ index-events = [{{ range .BaseConfig.IndexEvents }}{{ printf "%q, " . }}{{end}}]
7474
# Default cache size is 50mb.
7575
iavl-cache-size = {{ .BaseConfig.IAVLCacheSize }}
7676
77+
# IavlDisableFastnNode enables or disables the fast node feature of IAVL.
78+
# Default is false.
79+
iavl-disable-fastnode = {{ .BaseConfig.IAVLDisableFastnNode }}
80+
7781
# AppDBBackend defines the database backend type to use for the application and snapshots DBs.
7882
# An empty string indicates that a fallback will be used.
7983
# First fallback is the deprecated compile-time types.DBBackend value.

server/mock/store.go

+4
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ func (ms multiStore) SetIAVLCacheSize(size int) {
130130
panic("not implemented")
131131
}
132132

133+
func (ms multiStore) SetIAVLDisableFastNode(disable bool) {
134+
panic("not implemented")
135+
}
136+
133137
func (ms multiStore) SetInitialVersion(version int64) error {
134138
panic("not implemented")
135139
}

server/start.go

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ const (
5656
FlagIndexEvents = "index-events"
5757
FlagMinRetainBlocks = "min-retain-blocks"
5858
FlagIAVLCacheSize = "iavl-cache-size"
59+
FlagIAVLFastNode = "iavl-disable-fastnode"
5960

6061
// state sync-related flags
6162
FlagStateSyncSnapshotInterval = "state-sync.snapshot-interval"

simapp/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ require (
4646
github.com/cosmos/go-bip39 v1.0.0 // indirect
4747
github.com/cosmos/gogoproto v1.4.2 // indirect
4848
github.com/cosmos/gorocksdb v1.2.0 // indirect
49-
github.com/cosmos/iavl v0.19.1 // indirect
49+
github.com/cosmos/iavl v0.19.2-0.20220916140702-9b6be3095313 // indirect
5050
github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect
5151
github.com/cosmos/ledger-go v0.9.2 // indirect
5252
github.com/creachadair/taskgroup v0.3.2 // indirect

simapp/go.sum

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ github.com/cosmos/gogoproto v1.4.2 h1:UeGRcmFW41l0G0MiefWhkPEVEwvu78SZsHBvI78dAY
193193
github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU=
194194
github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y=
195195
github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw=
196-
github.com/cosmos/iavl v0.19.1 h1:3gaq9b6SjiB0KBTygRnAvEGml2pQlu1TH8uma5g63Ys=
197-
github.com/cosmos/iavl v0.19.1/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw=
196+
github.com/cosmos/iavl v0.19.2-0.20220916140702-9b6be3095313 h1:R7CnaI/0OLwOusy7n9750n8fqQ3yCQ8OJQI2L3ws9RA=
197+
github.com/cosmos/iavl v0.19.2-0.20220916140702-9b6be3095313/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw=
198198
github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo=
199199
github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA=
200200
github.com/cosmos/ledger-cosmos-go v0.11.1 h1:9JIYsGnXP613pb2vPjFeMMjBI5lEDsEaF6oYorTy6J4=

simapp/simd/cmd/root.go

+2
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ func initAppConfig() (string, interface{}) {
145145
//
146146
// In simapp, we set the min gas prices to 0.
147147
srvCfg.MinGasPrices = "0stake"
148+
// srvCfg.BaseConfig.IAVLDisableFastnNode = true // disable fastnode by default
148149

149150
customAppConfig := CustomAppConfig{
150151
Config: *srvCfg,
@@ -304,6 +305,7 @@ func newApp(
304305
baseapp.SetIndexEvents(cast.ToStringSlice(appOpts.Get(server.FlagIndexEvents))),
305306
baseapp.SetSnapshot(snapshotStore, snapshotOptions),
306307
baseapp.SetIAVLCacheSize(cast.ToInt(appOpts.Get(server.FlagIAVLCacheSize))),
308+
baseapp.SetIAVLDisableFastNode(cast.ToBool(appOpts.Get(server.FlagIAVLFastNode))),
307309
)
308310
}
309311

store/cache/cache_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func TestGetOrSetStoreCache(t *testing.T) {
1818
mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize)
1919

2020
sKey := types.NewKVStoreKey("test")
21-
tree, err := iavl.NewMutableTree(db, 100)
21+
tree, err := iavl.NewMutableTree(db, 100, false)
2222
require.NoError(t, err)
2323
store := iavlstore.UnsafeNewStore(tree)
2424
store2 := mngr.GetStoreCache(sKey, store)
@@ -32,7 +32,7 @@ func TestUnwrap(t *testing.T) {
3232
mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize)
3333

3434
sKey := types.NewKVStoreKey("test")
35-
tree, err := iavl.NewMutableTree(db, 100)
35+
tree, err := iavl.NewMutableTree(db, 100, false)
3636
require.NoError(t, err)
3737
store := iavlstore.UnsafeNewStore(tree)
3838
_ = mngr.GetStoreCache(sKey, store)
@@ -46,7 +46,7 @@ func TestStoreCache(t *testing.T) {
4646
mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize)
4747

4848
sKey := types.NewKVStoreKey("test")
49-
tree, err := iavl.NewMutableTree(db, 100)
49+
tree, err := iavl.NewMutableTree(db, 100, false)
5050
require.NoError(t, err)
5151
store := iavlstore.UnsafeNewStore(tree)
5252
kvStore := mngr.GetStoreCache(sKey, store)

store/iavl/store.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,16 +43,16 @@ type Store struct {
4343
// LoadStore returns an IAVL Store as a CommitKVStore. Internally, it will load the
4444
// store's version (id) from the provided DB. An error is returned if the version
4545
// fails to load, or if called with a positive version on an empty tree.
46-
func LoadStore(db dbm.DB, logger log.Logger, key types.StoreKey, id types.CommitID, lazyLoading bool, cacheSize int) (types.CommitKVStore, error) {
47-
return LoadStoreWithInitialVersion(db, logger, key, id, lazyLoading, 0, cacheSize)
46+
func LoadStore(db dbm.DB, logger log.Logger, key types.StoreKey, id types.CommitID, lazyLoading bool, cacheSize int, disableFastNode bool) (types.CommitKVStore, error) {
47+
return LoadStoreWithInitialVersion(db, logger, key, id, lazyLoading, 0, cacheSize, disableFastNode)
4848
}
4949

5050
// LoadStoreWithInitialVersion returns an IAVL Store as a CommitKVStore setting its initialVersion
5151
// to the one given. Internally, it will load the store's version (id) from the
5252
// provided DB. An error is returned if the version fails to load, or if called with a positive
5353
// version on an empty tree.
54-
func LoadStoreWithInitialVersion(db dbm.DB, logger log.Logger, key types.StoreKey, id types.CommitID, lazyLoading bool, initialVersion uint64, cacheSize int) (types.CommitKVStore, error) {
55-
tree, err := iavl.NewMutableTreeWithOpts(db, cacheSize, &iavl.Options{InitialVersion: initialVersion})
54+
func LoadStoreWithInitialVersion(db dbm.DB, logger log.Logger, key types.StoreKey, id types.CommitID, lazyLoading bool, initialVersion uint64, cacheSize int, disableFastNode bool) (types.CommitKVStore, error) {
55+
tree, err := iavl.NewMutableTreeWithOpts(db, cacheSize, &iavl.Options{InitialVersion: initialVersion}, disableFastNode)
5656
if err != nil {
5757
return nil, err
5858
}

store/iavl/store_test.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func randBytes(numBytes int) []byte {
3434

3535
// make a tree with data from above and save it
3636
func newAlohaTree(t *testing.T, db dbm.DB) (*iavl.MutableTree, types.CommitID) {
37-
tree, err := iavl.NewMutableTree(db, cacheSize)
37+
tree, err := iavl.NewMutableTree(db, cacheSize, false)
3838
require.NoError(t, err)
3939

4040
for k, v := range treeData {
@@ -100,17 +100,17 @@ func TestLoadStore(t *testing.T) {
100100
require.Equal(t, string(hcStore.Get([]byte("hello"))), "ciao")
101101

102102
// Querying a new store at some previous non-pruned height H
103-
newHStore, err := LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), cIDH, false, DefaultIAVLCacheSize)
103+
newHStore, err := LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), cIDH, false, DefaultIAVLCacheSize, false)
104104
require.NoError(t, err)
105105
require.Equal(t, string(newHStore.Get([]byte("hello"))), "hallo")
106106

107107
// Querying a new store at some previous pruned height Hp
108-
newHpStore, err := LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), cIDHp, false, DefaultIAVLCacheSize)
108+
newHpStore, err := LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), cIDHp, false, DefaultIAVLCacheSize, false)
109109
require.NoError(t, err)
110110
require.Equal(t, string(newHpStore.Get([]byte("hello"))), "hola")
111111

112112
// Querying a new store at current height H
113-
newHcStore, err := LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), cIDHc, false, DefaultIAVLCacheSize)
113+
newHcStore, err := LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), cIDHc, false, DefaultIAVLCacheSize, false)
114114
require.NoError(t, err)
115115
require.Equal(t, string(newHcStore.Get([]byte("hello"))), "ciao")
116116
}
@@ -281,7 +281,7 @@ func TestIAVLIterator(t *testing.T) {
281281
func TestIAVLReverseIterator(t *testing.T) {
282282
db := dbm.NewMemDB()
283283

284-
tree, err := iavl.NewMutableTree(db, cacheSize)
284+
tree, err := iavl.NewMutableTree(db, cacheSize, false)
285285
require.NoError(t, err)
286286

287287
iavlStore := UnsafeNewStore(tree)
@@ -314,7 +314,7 @@ func TestIAVLReverseIterator(t *testing.T) {
314314

315315
func TestIAVLPrefixIterator(t *testing.T) {
316316
db := dbm.NewMemDB()
317-
tree, err := iavl.NewMutableTree(db, cacheSize)
317+
tree, err := iavl.NewMutableTree(db, cacheSize, false)
318318
require.NoError(t, err)
319319

320320
iavlStore := UnsafeNewStore(tree)
@@ -378,7 +378,7 @@ func TestIAVLPrefixIterator(t *testing.T) {
378378

379379
func TestIAVLReversePrefixIterator(t *testing.T) {
380380
db := dbm.NewMemDB()
381-
tree, err := iavl.NewMutableTree(db, cacheSize)
381+
tree, err := iavl.NewMutableTree(db, cacheSize, false)
382382
require.NoError(t, err)
383383

384384
iavlStore := UnsafeNewStore(tree)
@@ -446,7 +446,7 @@ func nextVersion(iavl *Store) {
446446

447447
func TestIAVLNoPrune(t *testing.T) {
448448
db := dbm.NewMemDB()
449-
tree, err := iavl.NewMutableTree(db, cacheSize)
449+
tree, err := iavl.NewMutableTree(db, cacheSize, false)
450450
require.NoError(t, err)
451451

452452
iavlStore := UnsafeNewStore(tree)
@@ -465,7 +465,7 @@ func TestIAVLNoPrune(t *testing.T) {
465465

466466
func TestIAVLStoreQuery(t *testing.T) {
467467
db := dbm.NewMemDB()
468-
tree, err := iavl.NewMutableTree(db, cacheSize)
468+
tree, err := iavl.NewMutableTree(db, cacheSize, false)
469469
require.NoError(t, err)
470470

471471
iavlStore := UnsafeNewStore(tree)
@@ -569,7 +569,7 @@ func BenchmarkIAVLIteratorNext(b *testing.B) {
569569
b.ReportAllocs()
570570
db := dbm.NewMemDB()
571571
treeSize := 1000
572-
tree, err := iavl.NewMutableTree(db, cacheSize)
572+
tree, err := iavl.NewMutableTree(db, cacheSize, false)
573573
require.NoError(b, err)
574574

575575
for i := 0; i < treeSize; i++ {
@@ -603,7 +603,7 @@ func TestSetInitialVersion(t *testing.T) {
603603
{
604604
"works with a mutable tree",
605605
func(db *dbm.MemDB) *Store {
606-
tree, err := iavl.NewMutableTree(db, cacheSize)
606+
tree, err := iavl.NewMutableTree(db, cacheSize, false)
607607
require.NoError(t, err)
608608
store := UnsafeNewStore(tree)
609609

@@ -613,7 +613,7 @@ func TestSetInitialVersion(t *testing.T) {
613613
{
614614
"throws error on immutable tree",
615615
func(db *dbm.MemDB) *Store {
616-
tree, err := iavl.NewMutableTree(db, cacheSize)
616+
tree, err := iavl.NewMutableTree(db, cacheSize, false)
617617
require.NoError(t, err)
618618
store := UnsafeNewStore(tree)
619619
_, version, err := store.tree.SaveVersion()

store/iavl/tree_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010

1111
func TestImmutableTreePanics(t *testing.T) {
1212
t.Parallel()
13-
immTree := iavl.NewImmutableTree(dbm.NewMemDB(), 100)
13+
immTree := iavl.NewImmutableTree(dbm.NewMemDB(), 100, false)
1414
it := &immutableTree{immTree}
1515
require.Panics(t, func() { it.Set([]byte{}, []byte{}) })
1616
require.Panics(t, func() { it.Remove([]byte{}) })

store/prefix/store_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ func testPrefixStore(t *testing.T, baseStore types.KVStore, prefix []byte) {
9090

9191
func TestIAVLStorePrefix(t *testing.T) {
9292
db := dbm.NewMemDB()
93-
tree, err := tiavl.NewMutableTree(db, cacheSize)
93+
tree, err := tiavl.NewMutableTree(db, cacheSize, false)
9494
require.NoError(t, err)
9595
iavlStore := iavl.UnsafeNewStore(tree)
9696

store/rootmulti/proof_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
func TestVerifyIAVLStoreQueryProof(t *testing.T) {
1616
// Create main tree for testing.
1717
db := dbm.NewMemDB()
18-
iStore, err := iavl.LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), types.CommitID{}, false, iavl.DefaultIAVLCacheSize)
18+
iStore, err := iavl.LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), types.CommitID{}, false, iavl.DefaultIAVLCacheSize, false)
1919
store := iStore.(*iavl.Store)
2020
require.Nil(t, err)
2121
store.Set([]byte("MYKEY"), []byte("MYVALUE"))

0 commit comments

Comments
 (0)