Skip to content
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 proof generation and verification #4

Merged
merged 5 commits into from
Jan 9, 2024

Conversation

AurelienFT
Copy link
Collaborator

@AurelienFT AurelienFT commented Jan 3, 2024

This PR adds the possibility to generate proof that a key/value is or isn't in the trie. The proof is a list of node with their hash and the ones of their children following the same format as Madara.

You can also verify the proof using a new function that will verify if the proof is indeed correct and that it verify if the key/value is (or isn't) in the trie.

I have updated the example in the README.md for usage.

@codecov-commenter
Copy link

codecov-commenter commented Jan 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

❗ No coverage uploaded for pull request base (oss@8752531). Click here to learn what that means.

Additional details and impacted files
@@          Coverage Diff           @@
##             oss       #4   +/-   ##
======================================
  Coverage       ?   57.84%           
======================================
  Files          ?       11           
  Lines          ?      344           
  Branches       ?        0           
======================================
  Hits           ?      199           
  Misses         ?      145           
  Partials       ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

src/trie/merkle_tree.rs Outdated Show resolved Hide resolved
src/trie/merkle_tree.rs Show resolved Hide resolved
src/trie/merkle_tree.rs Outdated Show resolved Hide resolved
src/trie/merkle_tree.rs Show resolved Hide resolved
src/trie/merkle_tree.rs Show resolved Hide resolved
Eitu33 referenced this pull request in massalabs/bonsai-trie Jan 8, 2024
src/trie/merkle_tree.rs Show resolved Hide resolved
src/trie/merkle_tree.rs Show resolved Hide resolved
@Eitu33 Eitu33 mentioned this pull request Jan 8, 2024
Copy link
Collaborator

@0xLucqs 0xLucqs left a comment

Choose a reason for hiding this comment

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

Lgtm

@AurelienFT AurelienFT merged commit 8d5dafc into madara-alliance:oss Jan 9, 2024
6 checks passed
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