Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem: subUnlockedCoins is not optimal #865

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* [#507](https://github.com/crypto-org-chain/cosmos-sdk/pull/507) mempool respect gas wanted returned by ante handler
* [#744](https://github.com/crypto-org-chain/cosmos-sdk/pull/744) Pass raw transactions to tx executor so it can do pre-estimations.
* [#884](https://github.com/crypto-org-chain/cosmos-sdk/pull/884) Avoid decoding tx for in PrepareProposal if it's NopMempool.
* [#]() Prune cmd wait for async pruning to finish.

## [Unreleased]

Expand Down
8 changes: 6 additions & 2 deletions client/pruning/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,12 @@ Supported app-db-backend types include 'goleveldb', 'rocksdb', 'pebbledb'.`,
pruningHeight := latestHeight - int64(pruningOptions.KeepRecent)
cmd.Printf("pruning heights up to %v\n", pruningHeight)

err = rootMultiStore.PruneStores(pruningHeight)
if err != nil {
if err := rootMultiStore.PruneStores(pruningHeight); err != nil {
return err
}

// close will wait for async pruning process to finish
if err := rootMultiStore.Close(); err != nil {
return err
}

Expand Down
7 changes: 7 additions & 0 deletions store/iavl/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,13 @@
return st.tree.TraverseStateChanges(startVersion, endVersion, fn)
}

func (st *Store) Close() error {
if closer, ok := st.tree.(io.Closer); ok {

Check failure on line 393 in store/iavl/store.go

View workflow job for this annotation

GitHub Actions / dependency-review

undefined: io

Check failure on line 393 in store/iavl/store.go

View workflow job for this annotation

GitHub Actions / dependency-review

undefined: io
return closer.Close()
}
return nil
}

// Takes a MutableTree, a key, and a flag for creating existence or absence proof and returns the
// appropriate merkle.Proof. Since this must be called after querying for the value, this function should never error
// Thus, it will panic on error rather than returning it
Expand Down
10 changes: 10 additions & 0 deletions store/rootmulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,16 @@
rs.logger.Debug("flushing metadata finished", "height", version)
}

func (rs *Store) Close() error {
errs := make([]error, 0, len(rs.stores))
for _, store := range rs.stores {
if closer, ok := store.(io.Closer); ok {
errs = append(errs, closer.Close())
}
}
Comment on lines +1193 to +1197

Check warning

Code scanning / CodeQL

Iteration over map Warning

Iteration over map may be a possible source of non-determinism
return errors.Join(errs...)
}

type storeParams struct {
key types.StoreKey
db dbm.DB
Expand Down
Loading