-
Notifications
You must be signed in to change notification settings - Fork 16
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
Merge transactionnal state with uncommitted changes #28
Merge transactionnal state with uncommitted changes #28
Conversation
92bcb49
to
69f6f96
Compare
Co-authored-by: Damir Vodenicarevic <[email protected]> Co-authored-by: AurelienFT <[email protected]> Co-authored-by: Jean-François <[email protected]> Signed-off-by: Jean-François <[email protected]>
69f6f96
to
7c65199
Compare
src/trie/merkle_tree.rs
Outdated
@@ -296,7 +292,7 @@ pub struct MerkleTree<H: StarkHash> { | |||
/// The list of nodes that should be removed from the underlying database during the next commit. | |||
death_row: Vec<TrieKey>, | |||
/// The list of leaves that have been modified during the current commit. | |||
cache_leaf_modified: HashMap<Vec<u8>, InsertOrRemove<Felt>>, | |||
pub cache_leaf_modified: HashMap<Vec<u8>, InsertOrRemove<Felt>>, |
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.
If you only read it for reading, maybe a getter will be better, than pub
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.
ok
src/lib.rs
Outdated
//self.tries.db_mut().merge() work for all test but one | ||
//(merge_with_uncommitted_remove, it fails with RocksDB.Busy error, | ||
//which seems to be related to use of OptimisticTransactions, but | ||
//removing them does not solve this particular problem but causes | ||
//others). | ||
|
||
//Applying changes after call to merge() would imply a big refactor as | ||
//merge take ownership of its arguments, hence changes are not | ||
//available anymore. | ||
|
||
//Hence the solution which is a tradeoff between the two solutions: | ||
//1. memorize changes | ||
//2. merge tries | ||
//3. apply changes |
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.
fmt comment
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.
will remove, the code is self-explanatory
src/lib.rs
Outdated
//Applying changes after call to merge() would imply a big refactor as | ||
//merge take ownership of its arguments, hence changes are not | ||
//available anymore. |
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.
Do you want to create an issue for this? Or is it not even worth it?
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 don't think it worth it. And I think this whole comment is not really useful (it was for the internal review). I'm going to remove it.
Signed-off-by: Jean-François <[email protected]>
I'm merging this as there is a lot of perfs improvements that will come in the following days and don't want to block the process (given the fact that you already approved @tdelabro also) |
@tdelabro @antiyro
Please find this work done at Massalabs that allows to merge transactional state with uncommitted changes into bonsai storage.
Co-authored-by: Damir Vodenicarevic [email protected]
Co-authored-by: AurelienFT [email protected]
Co-authored-by: Jean-François [email protected]