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

feat(state-tree)!: implement verify for Merkle in/exclusion proofs #1216

Merged

Conversation

sdbondi
Copy link
Member

@sdbondi sdbondi commented Dec 11, 2024

Description

feat(state-tree): implement verify for Merkle in/exclusion proofs
fix(consensus)!: include substate version in JMT node hashes

Motivation and Context

Implement inclusion and exclusion proofs for JMT. This is useful for command inclusion proofs e.g. eviction proof as well as inclusion proofs for substates.

Usage:

let (key, proof_value, proof) = tree.get_proof(current_version, &substate_id).unwrap();
let value_hash = hash_substate(substate);
proof.verify_inclusion(&root_hash, &key, &value_hash).unwrap();
proof.verify_exclusion(&root_hash, &some_non_existing_key).unwrap();

How Has This Been Tested?

Unit tests, manually

What process can a PR reviewer use to test or verify this change?

Breaking Changes

  • None
  • Requires data directory to be deleted
  • Other - Please specify

BREAKING CHANGE: substate changes for JMT state tree include the substate version in the key hash

Copy link

Test Results (CI)

567 tests  +1   567 ✅ +1   1h 37m 20s ⏱️ -51s
 54 suites ±0     0 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 358a65c. ± Comparison against base commit 27e2516.

@sdbondi sdbondi merged commit 613d9c2 into tari-project:development Dec 12, 2024
13 of 14 checks passed
@sdbondi sdbondi deleted the consensus-jellyfish-proofs branch December 12, 2024 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants