-
Notifications
You must be signed in to change notification settings - Fork 956
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
Merklized but not diffed #3293
Merklized but not diffed #3293
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3293 +/- ##
==========================================
+ Coverage 53.79% 53.82% +0.02%
==========================================
Files 314 314
Lines 105784 105843 +59
==========================================
+ Hits 56903 56966 +63
+ Misses 48881 48877 -4 ☔ View full report in Codecov by Sentry. |
); | ||
let make_key = |suffix: u64| { |
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.
What is this doing exactly? Needs some comments.
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.
added a comment cd441a2
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.
Can you explain what this whole suffix % 3u64
logic is doing, though?
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.
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.
Also what does "probable" mean in this context?
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.
these data require proofs of the existence or non-existence
let tree = | ||
state.get_merkle_tree(height, Some(StoreType::NoDiff))?; | ||
assert_eq!(tree.root().0, roots.get(&height).unwrap().0); | ||
match write_type { |
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.
Needs comments, this logic is not clear.
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.
added a comment cd441a2
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.
Can you explain the semantics of these 0/1/3 write types?
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.
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 still want clearer comments 😁
); | ||
let make_key = |suffix: u64| { |
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.
Can you explain what this whole suffix % 3u64
logic is doing, though?
let tree = | ||
state.get_merkle_tree(height, Some(StoreType::NoDiff))?; | ||
assert_eq!(tree.root().0, roots.get(&height).unwrap().0); | ||
match write_type { |
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.
Can you explain the semantics of these 0/1/3 write types?
crates/node/src/storage/mod.rs
Outdated
let make_key = |suffix: u64| { | ||
// For three type keys | ||
match suffix % 3u64 { | ||
// for non-probable data |
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.
provable?
crates/node/src/storage/mod.rs
Outdated
match suffix % 3u64 { | ||
// for non-probable data | ||
0 => Key::parse(format!("key{suffix}")).unwrap(), | ||
// for probable data |
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.
provable?
assert!(!tree.has_key(&merkle_key)?); | ||
} | ||
} | ||
1 | 3 => { |
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.
but what do these numbers 1 or 3 mean?
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.
They're indexes generated by proptest
let blocks_write_type = blocks_write_type.into_iter().enumerate().map(
|(index, write_type)| {
* origin/yuji/merklized-not-diffed: fix typo add comments remove is_merklized_storage_key fix for tests add changelog fmt add NoDiff subtree add diff_key_filter
* origin/yuji/merklized-not-diffed: fix typo add comments remove is_merklized_storage_key fix for tests add changelog fmt add NoDiff subtree add diff_key_filter
Describe your changes
diff_key_filter
to check if the data should be stored to diffs even ifmerkle_tree_key_filter
is trueNoDiff
subtree in Merkle treeIndicate on which release or other PRs this topic is based on
v0.36.1
Checklist before merging to
draft