Skip to content

Commit a6e703c

Browse files
mergify[bot]yihuangtac0turtle
authored
cache first version for legacy versions (backport #1018) (#1020)
Co-authored-by: yihuang <huang@crypto.com> Co-authored-by: Marko Baricevic <marbar3778@yahoo.com>
1 parent ee6810d commit a6e703c

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@
1616
- [#955](https://github.com/cosmos/iavl/pull/955) Get rid of `cosmos-db` deps completely.
1717
- [#965](https://github.com/cosmos/iavl/pull/965) Use expected interface for expected IAVL `Logger`.
1818
- [#970](https://github.com/cosmos/iavl/pull/970) Close the pruning process when the nodeDB is closed.
19+
- [#980](https://github.com/cosmos/iavl/pull/980) Use the `sdk/core/store.KVStoreWithBatch` interface instead of `iavl/db.DB` interface
20+
- [#1018](https://github.com/cosmos/iavl/pull/1018) Cache first version for legacy versions, fix performance regression after upgrade.

nodedb.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,7 @@ func (ndb *nodeDB) getFirstVersion() (int64, error) {
739739
if itr.Valid() {
740740
var version int64
741741
legacyRootKeyFormat.Scan(itr.Key(), &version)
742+
ndb.resetFirstVersion(version)
742743
return version, nil
743744
}
744745
// Find the first version

0 commit comments

Comments
 (0)