turbofish-org / merk

High-performance Merkle key/value store
Apache License 2.0
226 stars 36 forks source link

Big ol' rewrite #15

Closed mappum closed 5 years ago

mappum commented 5 years ago

This WIP PR contains the changes I have been working on for the past few months, which have over time replaced all parts of the existing codebase. While the tree algorithms have not changed and feature-wise it is in the same place as a few months ago, the internal types and interfaces have changed a lot and have resulted in much better code (the second time around I'm more experienced with Rust).

Main improvements:

I'll finalize this PR once the core Merk store API is finished, leaving it where the master branch currently is.

davebryson commented 5 years ago

This is looking good! One concern I have is opening rocksdb within Merk. This limits the ability to share the db connection across threads. For example, you may want that db handle available separately in the abci commit callback to save the latest root hash and height to the db for later use in abci info.

mappum commented 5 years ago

For example, you may want that db handle available separately in the abci commit callback to commit the latest root hash and height for later use in abci info.

That's a good point. I'm not necessarily set on the top-level API and it would be pretty easy to pass in a reference to a db handle in the Merk constructor, or have methods for raw access.

mappum commented 5 years ago

Merging these changes into develop because we're now at parity with what we had before the rewrite. Still needs a few things before a real release though.