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: finish msg inclusion api #681

Merged
merged 7 commits into from
Sep 9, 2022
Merged

Conversation

evan-forbes
Copy link
Member

@evan-forbes evan-forbes commented Sep 2, 2022

finishes the api for message inclusion

part of #382
closes #381

@codecov-commenter
Copy link

codecov-commenter commented Sep 6, 2022

Codecov Report

Merging #681 (2bc32cf) into main (feebea0) will increase coverage by 1.44%.
The diff coverage is 82.14%.

@@            Coverage Diff             @@
##             main     #681      +/-   ##
==========================================
+ Coverage   39.28%   40.73%   +1.44%     
==========================================
  Files          27       29       +2     
  Lines        2795     2897     +102     
==========================================
+ Hits         1098     1180      +82     
- Misses       1609     1628      +19     
- Partials       88       89       +1     
Impacted Files Coverage Δ
pkg/inclusion/get_commit.go 0.00% <0.00%> (ø)
pkg/shares/non_interactive_defaults.go 94.82% <94.82%> (ø)
pkg/inclusion/nmt_caching.go 80.00% <100.00%> (ø)
pkg/inclusion/paths.go 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

evan-forbes and others added 2 commits September 7, 2022 14:03
Co-authored-by: Rootul Patel <rootulp@gmail.com>
Co-authored-by: Rootul Patel <rootulp@gmail.com>
@evan-forbes evan-forbes marked this pull request as ready for review September 7, 2022 19:03
Copy link
Collaborator

@rootulp rootulp left a comment

Choose a reason for hiding this comment

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

LGTM. I'm not sure if my intuition on how to draw the merkle tree of row roots is correct so open to feedback there

expected []path
}
tests := []test{
{2, 0, 1, []path{{instructions: []WalkInstruction{WalkLeft}, row: 0}}},
Copy link
Collaborator

Choose a reason for hiding this comment

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

[no change needed] visual

row 0 -> |1| |   
row 1 -> | | |

merkle tree of row 0

   x
 /   \
1     x

where I assume x doesn't matter

{2, 0, 1, []path{{instructions: []WalkInstruction{WalkLeft}, row: 0}}},
{2, 2, 2, []path{{instructions: []WalkInstruction{}, row: 1}}},
{2, 1, 2, []path{{instructions: []WalkInstruction{}, row: 1}}},
{4, 2, 2, []path{{instructions: []WalkInstruction{WalkRight}, row: 0}}},
Copy link
Collaborator

Choose a reason for hiding this comment

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

[no change needed] visual

row 0 -> | | |2|2|
row 2 -> | | | | |
row 3 -> | | | | |
row 4 -> | | | | |

merkle tree of row 0

        x
       / \
      x   y
         / \
        2   2

where y is what we want

Copy link
Member Author

Choose a reason for hiding this comment

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

exactly!

@evan-forbes
Copy link
Member Author

evan-forbes commented Sep 8, 2022

going to merge this later tonight w/o further feedback, as its blocking creating a PR for the ProcessProposal refactor. Still open to making changes there.

Copy link
Member

@rach-id rach-id left a comment

Choose a reason for hiding this comment

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

🚀


return paths
}

// genSubTreeRootPath calculates the path to a given subtree root of a node, given the
// depth and position of the node. note: the root of the tree is depth 0.
// The following nolint can be removed after this function is used.
//nolint:unused,deadcode
Copy link
Member

@rach-id rach-id Sep 8, 2022

Choose a reason for hiding this comment

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

[Non Blocking][Suggestion]

Probably can be removed, as this function is now used.

Suggested change
//nolint:unused,deadcode

Copy link
Member Author

Choose a reason for hiding this comment

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

nice! good find, I'll if there is other feedback, I'll include this in this PR, if not, I'll be sure to include this in the next ProcessProposal PR as to not dismiss reviews.

@evan-forbes evan-forbes merged commit 1e4d057 into main Sep 9, 2022
@evan-forbes evan-forbes deleted the evan/finish-msg-inclusion-api branch September 9, 2022 02:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Create API to check for message inclusion
4 participants