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

Fix state sync halt issue #559

Merged
merged 1 commit into from
Jan 3, 2025
Merged
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
12 changes: 6 additions & 6 deletions storev2/rootmulti/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,26 +279,26 @@
if version <= 0 || (rs.lastCommitInfo != nil && version == rs.lastCommitInfo.Version) {
return rs.CacheMultiStore(), nil
}
// Open SC stores for wasm snapshot, this op is blocking and could take a long time
scStore, err := rs.scStore.LoadVersion(version, true)
if err != nil {
return nil, err
}

Check warning on line 286 in storev2/rootmulti/store.go

View check run for this annotation

Codecov / codecov/patch

storev2/rootmulti/store.go#L283-L286

Added lines #L283 - L286 were not covered by tests
rs.mtx.RLock()
defer rs.mtx.RUnlock()
stores := make(map[types.StoreKey]types.CacheWrapper)
// add the transient/mem stores registered in current app.
for k, store := range rs.ckvStores {
if store.GetStoreType() != types.StoreTypeIAVL {
stores[k] = store
}
}
// add SC stores for historical queries
scStore, err := rs.scStore.LoadVersion(version, true)
if err != nil {
return nil, err
}
for k, store := range rs.ckvStores {
if store.GetStoreType() == types.StoreTypeIAVL {
tree := scStore.GetTreeByName(k.Name())
stores[k] = commitment.NewStore(tree, rs.logger)
}
}
rs.mtx.RUnlock()

Check warning on line 301 in storev2/rootmulti/store.go

View check run for this annotation

Codecov / codecov/patch

storev2/rootmulti/store.go#L301

Added line #L301 was not covered by tests
cacheMs := cachemulti.NewStore(nil, stores, rs.storeKeys, nil, nil, nil)
// We need this because we need to make sure sc is closed after being used to release the resources
cacheMs.AddCloser(scStore)
Expand Down
Loading