diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index c2ce465ca9..bcae791730 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -158,7 +158,7 @@ func NewBaseApp( logger: logger, name: name, db: db, - cms: store.NewCommitMultiStore(db), + cms: store.NewCommitMultiStore(db, logger), storeLoader: DefaultStoreLoader, grpcQueryRouter: NewGRPCQueryRouter(), msgServiceRouter: NewMsgServiceRouter(), diff --git a/store/cachekv/benchmark_test.go b/store/cachekv/benchmark_test.go index 3a941d1436..b579dfc419 100644 --- a/store/cachekv/benchmark_test.go +++ b/store/cachekv/benchmark_test.go @@ -18,7 +18,7 @@ func DoBenchmarkDeepContextStack(b *testing.B, depth int) { key := storetypes.NewKVStoreKey("test") db := dbm.NewMemDB() - cms := store.NewCommitMultiStore(db) + cms := store.NewCommitMultiStore(db, log.NewNopLogger()) cms.MountStoreWithDB(key, storetypes.StoreTypeIAVL, db) cms.LoadLatestVersion() ctx := sdk.NewContext(cms, tmproto.Header{}, false, log.NewNopLogger()) diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index d93351d752..308feb1703 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -608,9 +608,12 @@ func (rs *Store) PruneStores(pruningHeight int64) (err error) { rs.logger.Debug("pruning store", "height", pruningHeight) + cnt := 1 + total := len(rs.stores) for key, store := range rs.stores { - rs.logger.Debug("pruning store", "key", key) // Also log store.name (a private variable)? - + rs.logger.Debug("pruning store", "key", key.Name()) // Also log store.name (a private variable)? + rs.logger.Info(fmt.Sprintf("pruning for module \"%s\" to height %d. (%d/%d)", key.Name(), pruningHeight, cnt, total)) + cnt++ // If the store is wrapped with an inter-block cache, we must first unwrap // it to get the underlying IAVL store. if store.GetStoreType() != types.StoreTypeIAVL { diff --git a/store/store.go b/store/store.go index d70ad54ee4..aa29d6cc0f 100644 --- a/store/store.go +++ b/store/store.go @@ -9,8 +9,8 @@ import ( "github.com/cosmos/cosmos-sdk/store/types" ) -func NewCommitMultiStore(db dbm.DB) types.CommitMultiStore { - return rootmulti.NewStore(db, log.NewNopLogger()) +func NewCommitMultiStore(db dbm.DB, logger log.Logger) types.CommitMultiStore { + return rootmulti.NewStore(db, logger) } func NewCommitKVStoreCacheManager() types.MultiStorePersistentCache { diff --git a/testutil/context.go b/testutil/context.go index 7c99b699ab..670c903ed0 100644 --- a/testutil/context.go +++ b/testutil/context.go @@ -16,7 +16,7 @@ import ( // DefaultContext creates a sdk.Context with a fresh MemDB that can be used in tests. func DefaultContext(key storetypes.StoreKey, tkey storetypes.StoreKey) sdk.Context { db := dbm.NewMemDB() - cms := store.NewCommitMultiStore(db) + cms := store.NewCommitMultiStore(db, log.NewNopLogger()) cms.MountStoreWithDB(key, storetypes.StoreTypeIAVL, db) cms.MountStoreWithDB(tkey, storetypes.StoreTypeTransient, db) err := cms.LoadLatestVersion() @@ -36,7 +36,7 @@ type TestContext struct { func DefaultContextWithDB(t *testing.T, key storetypes.StoreKey, tkey storetypes.StoreKey) TestContext { db := dbm.NewMemDB() - cms := store.NewCommitMultiStore(db) + cms := store.NewCommitMultiStore(db, log.NewNopLogger()) cms.MountStoreWithDB(key, storetypes.StoreTypeIAVL, db) cms.MountStoreWithDB(tkey, storetypes.StoreTypeTransient, db) err := cms.LoadLatestVersion() diff --git a/x/group/internal/orm/testsupport.go b/x/group/internal/orm/testsupport.go index f4878d265b..8243b4d34e 100644 --- a/x/group/internal/orm/testsupport.go +++ b/x/group/internal/orm/testsupport.go @@ -4,6 +4,7 @@ import ( "fmt" dbm "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/store" "github.com/cosmos/cosmos-sdk/store/gaskv" storetypes "github.com/cosmos/cosmos-sdk/store/types" @@ -19,7 +20,7 @@ func NewMockContext() *MockContext { db := dbm.NewMemDB() return &MockContext{ db: dbm.NewMemDB(), - store: store.NewCommitMultiStore(db), + store: store.NewCommitMultiStore(db, log.NewNopLogger()), } } diff --git a/x/group/keeper/invariants_test.go b/x/group/keeper/invariants_test.go index dd22f93d3a..6d4443cb53 100644 --- a/x/group/keeper/invariants_test.go +++ b/x/group/keeper/invariants_test.go @@ -39,7 +39,7 @@ func (s *invariantTestSuite) SetupSuite() { cdc := codec.NewProtoCodec(interfaceRegistry) key := sdk.NewKVStoreKey(group.ModuleName) db := dbm.NewMemDB() - cms := store.NewCommitMultiStore(db) + cms := store.NewCommitMultiStore(db, log.NewNopLogger()) cms.MountStoreWithDB(key, storetypes.StoreTypeIAVL, db) _ = cms.LoadLatestVersion() sdkCtx := sdk.NewContext(cms, tmproto.Header{}, false, log.NewNopLogger()) diff --git a/x/params/types/subspace_test.go b/x/params/types/subspace_test.go index 6449fcb992..434dc532f3 100644 --- a/x/params/types/subspace_test.go +++ b/x/params/types/subspace_test.go @@ -32,7 +32,7 @@ type SubspaceTestSuite struct { func (suite *SubspaceTestSuite) SetupTest() { db := dbm.NewMemDB() - ms := store.NewCommitMultiStore(db) + ms := store.NewCommitMultiStore(db, log.NewNopLogger()) ms.MountStoreWithDB(key, storetypes.StoreTypeIAVL, db) ms.MountStoreWithDB(tkey, storetypes.StoreTypeTransient, db) suite.NoError(ms.LoadLatestVersion())