-
Notifications
You must be signed in to change notification settings - Fork 584
Implement multi-key file storage #18127
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
It's a very simple way to store a set of related values in an efficient manner. Values are assumed to written all in one batch. Values can't be updated or deleted individually (the only way possible is to overwrite the whole file or remove the file). Reading of the key reads only the bytes of file that are reuired for the read. It's an efficient way to store data that is semantically connected, written and garbage-collected, but that needs to be accessed piecewise.
Allows to serialize tags without overhead and fragility of storing filenames, using semantically-meaningful representation instead.
a5132e8 to
17c0197
Compare
|
!ci-build-me |
|
!ci-bypass-changelog |
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.
This is pretty clever.
To be honest I didn't really understand how write_values_exn was working until I read the tests because I wasn't registering the importance of universal quantification in write_value.
If I has one suggestion for readability in my case, it would be to use a different type variable in the type definition of write_value and write_values, like use a in write_value and as in write_values
|
!ci-build-me |
Implement multi-key file storage.
Idea was first tested in benchmarks in PR #18117. Idea is to store heavy parts of a block (witnesses, which are part of scan state) in the new file storage, and be able to reference them from all over the codebase, including the ability to store references on disk (for which a
Stablemodule is provided for tags).Explain how you tested your changes:
Checklist: