-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
R4R: Store Refactor 1 #2985
R4R: Store Refactor 1 #2985
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #2985 +/- ##
===========================================
- Coverage 59.39% 59.32% -0.08%
===========================================
Files 135 130 -5
Lines 9979 9809 -170
===========================================
- Hits 5927 5819 -108
+ Misses 3680 3620 -60
+ Partials 372 370 -2 |
448c93a
to
26e05ae
Compare
Will there be any logic changes in this PR? I hope not. Please hold off merging btw, I want to understand it, and need to plan ahead toward an KeyObjectStore wrapper for the KVStore. |
@jaekwon There is no, most of the changes are just |
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.
I think this package reorganization makes sense, lots of comments (some probably not introduced in this PR, but maybe we can fix them here...)
) | ||
|
||
// copied from iavl/store_test.go | ||
var ( | ||
cacheSize = 100 |
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.
These should really be config parameters
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.
++
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.
Still true - could be a separate PR though.
// Start must be less than end, or the Iterator is invalid. | ||
// Iterator must be closed by caller. | ||
// To iterate over entire domain, use store.Iterator(nil, nil) | ||
// CONTRACT: No writes may happen within a domain while an iterator exists over it. |
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.
fwiw we don't obey this contract at all (assuming writes include deletions, but even so) - we break it all over the codebase
is this actually required?
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.
The iavl tree requires, but since we are cache wrapping the iavlstore before passing it to the handlers and the modification on the CacheKVStore
is not reflected on the iterator, it looks safe to do it in the modules. It is still an exception but for the module writers' perspective we should update the comment to notify them that it is safe to modify in the modules
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.
Reasonable - let's definitely update the comment
// Iterator over a domain of keys in descending order. End is exclusive. | ||
// Start must be less than end, or the Iterator is invalid. | ||
// Iterator must be closed by caller. | ||
// CONTRACT: No writes may happen within a domain while an iterator exists over it. |
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.
same as above (we break the contract)
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.
Update the comment here too.
Would also be really nice to have a |
Needs linter fixes - and agreed with @jackzampolin. |
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.
Neat! Good to go from me.
Lint failures are unrelated, though I'm rerunning the build now.
@mossid Is this WIP again now - are we waiting on something? |
Working on the README, some parts are being written @cwgoes |
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.
A few notes on README.md
- otherwise LGTM.
Co-Authored-By: mossid <torecursedivine@gmail.com>
Co-Authored-By: mossid <torecursedivine@gmail.com>
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.
There are a fair amount of changes here, but most of which look reasonable and are headed in a great direction. Approving.
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.
A great start at getting the /store
package organized and documented! Good work @mossid ! LGTM
Targeted PR against correct branch (see CONTRIBUTING.md)
Linked to github-issue with discussion and accepted design OR link to spec that describes this work.
Wrote tests
Updated relevant documentation (
docs/
)Added entries in
PENDING.md
with issue #rereviewed
Files changed
in the github PR explorerAddresses: #2986
For Admin Use: