-
Notifications
You must be signed in to change notification settings - Fork 4.1k
feat(iavl): blockSTM updates to iavlx store impl #25504
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
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## aaronc/iavlx #25504 +/- ##
===============================================
Coverage ? 67.79%
===============================================
Files ? 887
Lines ? 58400
Branches ? 0
===============================================
Hits ? 39590
Misses ? 18810
Partials ? 0
🚀 New features to boost your workflow:
|
iavl/commit_multi_tree.go
Dismissed
| func (db *CommitMultiTree) GetObjKVStore(key storetypes.StoreKey) storetypes.ObjKVStore { | ||
| treeIdx, ok := db.treesByKey[key] | ||
| if !ok { | ||
| panic(fmt.Sprintf("tree key not found in treesByKey: %v", key)) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note, since we're changing the store interfaces for block stm anyway, is it maybe time to get rid of all these panics and add proper error values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we could consider that. is it just for code cleanliness purposes? or is there some end user benefit to being able to react to these types of errors w/o a recover?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code cleanliness. Totally a side issue.
| s := db.trees[index] | ||
| store, ok := s.(storetypes.KVStore) | ||
| if !ok { | ||
| panic(fmt.Sprintf("store with key %v is not KVStore", key)) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
| func (t *MultiTree) GetObjKVStore(key storetypes.StoreKey) storetypes.ObjKVStore { | ||
| store, ok := t.getCacheWrapper(key).(storetypes.ObjKVStore) | ||
| if !ok { | ||
| panic(fmt.Sprintf("store with key %v is not ObjKVStore", key)) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
| } | ||
| if index >= len(t.trees) { | ||
| panic(fmt.Sprintf("store index %d out of bounds for key %s (trees length: %d)", index, key.Name(), len(t.trees))) | ||
| panic(fmt.Sprintf("store with key %v is not KVStore: store type=%T", key, store)) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
iavl/commit_multi_tree.go
Dismissed
| func (db *CommitMultiTree) GetObjKVStore(key storetypes.StoreKey) storetypes.ObjKVStore { | ||
| treeIdx, ok := db.treesByKey[key] | ||
| if !ok { | ||
| panic(fmt.Sprintf("tree key not found in treesByKey: %v", key)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note, since we're changing the store interfaces for block stm anyway, is it maybe time to get rid of all these panics and add proper error values?
|
@technicallyty your pull request is missing a changelog! |
| if t.parentTree != nil { | ||
| store = t.initStore(key, t.parentTree(key)) | ||
| } else { | ||
| panic(fmt.Sprintf("kv store with key %v has not been registered in stores", key)) |
Check warning
Code scanning / CodeQL
Panic in BeginBock or EndBlock consensus methods Warning
Description
updates the iavlx store impl to adhere to the changes required by blockSTM
Closes: #25496