Skip to content

merklearray: simplify single-leaf proofs#5703

Merged
algorandskiy merged 2 commits intoalgorand:masterfrom
zeldovich:stateproof-nodepth
Sep 1, 2023
Merged

merklearray: simplify single-leaf proofs#5703
algorandskiy merged 2 commits intoalgorand:masterfrom
zeldovich:stateproof-nodepth

Conversation

@zeldovich
Copy link
Copy Markdown
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
Copy Markdown

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

Comment thread crypto/merklearray/proof_test.go
Copy link
Copy Markdown
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
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