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

merklearray: simplify single-leaf proofs #5703

Merged
merged 2 commits into from
Sep 1, 2023

Conversation

zeldovich
Copy link
Contributor

No need to explicitly specify tree depth for merklearray proofs of a single leaf node, because the tree depth is exactly the number of sibling hashes in the proof.

This allows simplifying the format for sending single-leaf merklearray proofs, sending just the proofBytes []byte, and not having to send along an extra treeDepth.

The current algod API for fetching a proof still sends the tree depth along, for any clients that might care about it, but future APIs won't need to pass treeDepth.

No need to explicitly specify tree depth for merklearray proofs of
a single leaf node, because the tree depth is exactly the number of
sibling hashes in the proof.

This allows simplifying the format for sending single-leaf merklearray
proofs, sending just the proofBytes []byte, and not having to send along
an extra treeDepth.

The current algod API for fetching a proof still sends the tree depth
along, for any clients that might care about it, but future APIs won't
need to pass treeDepth.
@codecov
Copy link

codecov bot commented Aug 23, 2023

Codecov Report

Merging #5703 (5b75a24) into master (f155add) will increase coverage by 0.03%.
Report is 1 commits behind head on master.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #5703      +/-   ##
==========================================
+ Coverage   55.17%   55.21%   +0.03%     
==========================================
  Files         466      466              
  Lines       65084    65085       +1     
==========================================
+ Hits        35910    35934      +24     
+ Misses      26785    26765      -20     
+ Partials     2389     2386       -3     
Files Changed Coverage Δ
crypto/merklearray/proof.go 92.00% <100.00%> (+0.16%) ⬆️

... and 15 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@algonautshant algonautshant left a comment

Choose a reason for hiding this comment

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

Looks good!

@algorandskiy algorandskiy merged commit ba92ba3 into algorand:master Sep 1, 2023
10 checks passed
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.

4 participants