-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
feat!: ADR-040: Refactor App to use v2.MultiStore
#10174
Conversation
4f3a83d
to
75d96b1
Compare
75d96b1
to
4303bba
Compare
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.
Comments from online review with @robert-zaremba and @alexanderbez
4303bba
to
f71f755
Compare
f71f755
to
8efa2af
Compare
This pull request introduces 1 alert when merging 8efa2af into 8fc9f76 - view on LGTM.com new alerts:
|
## Description Part of: #10192 Introduces a new `RootStore` type in the `store/v2` package and an implementation, without yet replacing the `MultiStore` or refactoring its use within the SDK (which will happen in the follow up: #10174). Specified by [ADR-040](https://github.com/cosmos/cosmos-sdk/blob/1326fa2a7dfc3d83cf23dc1c1f33ff131152ad60/docs/architecture/adr-040-storage-and-smt-state-commitments.md). Fixes #10651 Fixes #10263 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [x] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [x] included comments for [documenting Go code](https://blog.golang.org/godoc) - [x] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
v2.MultiStore
8efa2af
to
d94b249
Compare
simapp, baseapp and dependencies update db interface options refactor app.CloseStore() LoadLatestVersion => Init ...
* remove iterator read lock; doesn't play with orm tests, so just rely on the stated contract: no store writes while iterator open * use v2 store in orm tests * clean up app boilerplate * update NewCommitMultiStore() * fix NewUncachedContext
(cherry picked from commit f69c198) Co-authored-by: Roman <roman@osmosis.team>
rm superfluous app.cms rename memdb imports [wip]substore prefix conflict
encode names with varint length to make them unambiguous
3afa273
to
1a9e194
Compare
Codecov Report
@@ Coverage Diff @@
## main #10174 +/- ##
==========================================
- Coverage 65.39% 65.24% -0.15%
==========================================
Files 693 688 -5
Lines 70965 72132 +1167
==========================================
+ Hits 46408 47066 +658
- Misses 21992 22325 +333
- Partials 2565 2741 +176
|
for v, _ := range vm.vmap { | ||
if v > target { | ||
delete(vm.vmap, v) | ||
} | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map
for skey, ls := range opts.listeners { | ||
cms.AddListeners(skey, ls) | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map
} | ||
|
||
func (s *store1as2) GetVersion(ver int64) (v2.MultiStore, error) { | ||
ret, err := s.CacheMultiStoreWithVersion(ver) |
Check warning
Code scanning / CodeQL
Useless assignment to local variable
for k := range backends { | ||
keys = append(keys, string(k)) | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map
for _, key := range keys { | ||
typ, err := types.StoreKeyToType(key) | ||
if err != nil { | ||
return err | ||
} | ||
if err = par.RegisterSubstore(key, typ); err != nil { | ||
return err | ||
} | ||
} |
Check warning
Code scanning / CodeQL
Iteration over map
gonna close this for now. the work is still being reviewed |
Description
Part of: #10192
Closes #10804
Refactors the App state store and supporting code to use the new
store/v2.RootStore
type introduced by #10430.Specified by ADR-040.
Note:
Store behavior additions, changes (breakages?):
Close
d to resolve DB transactionsCloseStore()
to resolve its storeStoreTypePersistent
for substoresStoreTypeSMT
for SC-only smt.StoreAuthor Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change