Skip to content

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

Merged
merged 27 commits into from
Aug 14, 2023
Merged

Conversation

dboehm-avalabs
Copy link
Contributor

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.

@dboehm-avalabs dboehm-avalabs changed the base branch from master to dev August 7, 2023 16:49
Copy link

@danlaine danlaine left a 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:

  1. We still need to update the readme
  2. 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?

Comment on lines -56 to -66
// 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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@dboehm-avalabs
Copy link
Contributor Author

Looks OK to me but two things I want to flag:

  1. We still need to update the readme
  2. 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?

I think we risk having an enormous, unreviewable mess if we try to merge everything at once. I think iterative cleanup might be best.

@danlaine danlaine merged commit e2d35e9 into dev Aug 14, 2023
@danlaine danlaine deleted the FirewoodizeMerkleDb branch August 14, 2023 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants