Skip to content

feat: abstract Merk storage - #7

Merged
fominok merged 2 commits into
masterfrom
abstract_storage
Dec 20, 2021
Merged

feat: abstract Merk storage#7
fominok merged 2 commits into
masterfrom
abstract_storage

Conversation

@fominok

@fominok fominok commented Dec 6, 2021

Copy link
Copy Markdown
Contributor

This PR includes abstracting from RocksDB as well as making Merk unaware of prefixes and other details.

GroveDB chooses the storage, but that could be also moved out to the caller site later if needed.

@fominok fominok changed the title abstract Merk storage feat: abstract Merk storage Dec 6, 2021
@fominok
fominok marked this pull request as ready for review December 6, 2021 16:29

@QuantumExplorer QuantumExplorer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We can create other PRs for the work needed in comments.

Comment thread grovedb/src/lib.rs
root_leaf_keys: HashMap<Vec<u8>, usize>,
subtrees: HashMap<Vec<u8>, Merk>,
db: Rc<rocksdb::DB>,
subtrees: HashMap<Vec<u8>, Merk<PrefixedRocksDbStorage>>,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't want to keep all merk subtrees in memory.

Comment thread grovedb/src/lib.rs
};
let create_subtree_merk =
|| -> Result<(Vec<u8>, Merk<PrefixedRocksDbStorage>), Error> {
let compressed_path_subtree = Self::compress_path(path, Some(&key));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

compress path needs to be make sure that ab, a != a, ba

Comment thread merk/src/merk/mod.rs
/// store.apply(batch, &[]).unwrap();
/// ```
pub fn apply(&mut self, batch: &Batch, aux: &Batch) -> Result<()> {
pub fn apply(&mut self, batch: &MerkBatch, aux: &MerkBatch) -> Result<()> {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We need multiple tree batching.,

this includes abstracting from rocksdb as well as making merk unaware of
prefixes and other details
@fominok
fominok merged commit 7f285c0 into master Dec 20, 2021
@fominok
fominok deleted the abstract_storage branch December 27, 2021 12:36
@fominok
fominok restored the abstract_storage branch December 27, 2021 12:37
QuantumExplorer pushed a commit that referenced this pull request Aug 11, 2022
@QuantumExplorer
QuantumExplorer deleted the abstract_storage branch July 17, 2025 09:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants