-
Notifications
You must be signed in to change notification settings - Fork 29
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
Add content for 4.5: Database and Merklized Storage #31
Conversation
syllabus/4-substrate/4.5-Db_and_Merklized_Storage/4.5-Db_and_Merklized_Storage_Slides.md
Show resolved
Hide resolved
syllabus/4-substrate/4.5-Db_and_Merklized_Storage/4.5-Db_and_Merklized_Storage_Slides.md
Show resolved
Hide resolved
syllabus/4-substrate/4.5-Db_and_Merklized_Storage/4.5-Db_and_Merklized_Storage_Slides.md
Show resolved
Hide resolved
## Complexity | ||
|
||
* Reading | ||
* Writing |
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.
Where is merkle proof on this slide?
@sacha-l I did review a bit in https://github.com/paritytech/polkadot-blockchain-academy/compare/sl/module-4-db-storage...ec-4-5?expand=1 . |
![Diagram of trie](http://placehold.jp/150x150.png) | ||
|
||
</div> | ||
|
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.
Idea of slide for node description (general message is 'radix tree' is a well knowned struct and merklizing it is rather direct and elegant):
## Anatomy of a node
Tree contains nodes, in radix tree node is partialkey ++ n children ++ maybe_value
Merkle version is
partialkey ++ n children hash ++ maybe_value
Add constraint that terminal node always contains a value
Specialized this node for merklizing to these variants
Header branch ++ partialkey ++ n children hash ++ maybevaleu
Header leaf ++ partially ++ value hash
Value
And you got current trie
With the subtleties that if content under hash is smaller than it s hash, then it is written in the parent node instead of hash
Been thinking, I got this branch that is a very incomplete, quite bad implementation of mmr as child trie, I was thinking of removing content from it and make it a 'complete code' exercise. |
Thanks for the review @cheme. Your exercise seems like a great idea. Please share it and we can add it as a workshop option for this lecture. As for the |
The branch with child mmr is this one paritytech/substrate@master...cheme:substrate:child_other_contract2 that's pretty bad code (just drafting things). |
* Comments * clean a bit
* Add draft content to 4.5 * Add and update content * Additional content for 4.5 (#180) * Comments * clean a bit * update Co-authored-by: cheme <[email protected]> Co-authored-by: Shawn Tabrizi <[email protected]>
First pass at adding content for 4.5: Database and Merklized Storage lesson.
Still need to flesh some things out with a little help of SMEs.
Things to note when reviewing: