-
Notifications
You must be signed in to change notification settings - Fork 741
Firewoodize merkle db Part 1: Make Views ReadOnly #1816
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
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.
Looks OK to me but two things I want to flag:
- We still need to update the readme
- The code is in a kind of intermediate state since we've made views read only, but still have a lot of code (mostly locking) that helped to handle views being editable. Should we wait until subsequent PRs cleaning up that code have been written/merged into this one before merging this into dev?
// Remove will delete a key from the Trie | ||
Remove(ctx context.Context, key []byte) error | ||
|
||
// NewPreallocatedView returns a new view on top of this Trie with space allocated for changes | ||
NewPreallocatedView(estimatedChanges int) (TrieView, error) | ||
|
||
// NewView returns a new view on top of this Trie | ||
NewView() (TrieView, error) | ||
|
||
// Insert a key/value pair into the Trie | ||
Insert(ctx context.Context, key, value []byte) error |
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 we risk having an enormous, unreviewable mess if we try to merge everything at once. I think iterative cleanup might be best. |
Remove the ability to insert/remove key values from merkledb directly. Can make changes by passing them in as a batch when creating a new view.