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: Cache and traverse nmt sub tree roots #549

Merged
merged 25 commits into from
Sep 2, 2022
Merged

Conversation

evan-forbes
Copy link
Member

@evan-forbes evan-forbes commented Jul 15, 2022

Description

spinning this out into its own PR. I think its mostly finished, so we can begin the review process imo, but I'm keeping as a draft for the moment as it might need to change and I don't really want to merge anything to master until we have fully functional non-interactive defaults.

a big part of #381

@evan-forbes evan-forbes added enhancement New feature or request C: Celestia app labels Jul 15, 2022
@evan-forbes evan-forbes self-assigned this Jul 15, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jul 15, 2022

Codecov Report

Merging #549 (b6745f6) into main (7766a5e) will decrease coverage by 0.78%.
The diff coverage is 80.00%.

@@            Coverage Diff             @@
##             main     #549      +/-   ##
==========================================
- Coverage   38.53%   37.74%   -0.79%     
==========================================
  Files          19       26       +7     
  Lines        2543     2726     +183     
==========================================
+ Hits          980     1029      +49     
- Misses       1478     1609     +131     
- Partials       85       88       +3     
Impacted Files Coverage Δ
pkg/inclusion/nmt_caching.go 80.00% <80.00%> (ø)
pkg/shares/share_splitting.go 13.25% <0.00%> (-61.75%) ⬇️
pkg/shares/share_merging.go 70.78% <0.00%> (-6.33%) ⬇️
x/payment/types/tx.pb.gw.go 0.00% <0.00%> (ø)
pkg/shares/parse_contiguous_shares.go 77.77% <0.00%> (ø)
pkg/shares/split_message_shares.go 69.51% <0.00%> (ø)
pkg/shares/parse_message_shares.go 88.60% <0.00%> (ø)
pkg/shares/utils.go 0.00% <0.00%> (ø)
pkg/shares/split_contiguous_shares.go 70.40% <0.00%> (ø)
pkg/shares/info_reserved_byte.go 100.00% <0.00%> (ø)
... and 2 more

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

@liamsi

This comment was marked as resolved.

return strc.walk([]byte(children[1]), path[1:])
default:
// this is unreachable code, but the compiler doesn't recognize this somehow
panic("bool other than true or false, computers were a mistake, everything is a lie, math is fake.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

everything is a lie, math is fake.

😆

Perhaps this is why John likes Rust so much (specifically Exhaustive Matches)

pkg/inclusion/sub_tree_root.go Outdated Show resolved Hide resolved
pkg/inclusion/sub_tree_root.go Outdated Show resolved Hide resolved
pkg/inclusion/sub_tree_root.go Outdated Show resolved Hide resolved
}

// Constructor fullfills the rsmt2d.TreeCreatorFn by keeping a pointer to the
// cache and embedding it as a nmt.NodeVisitor into a new wrapped nmt. I only
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the next line(s) of this doc comment were accidentally removed

pkg/inclusion/sub_tree_root.go Outdated Show resolved Hide resolved
evan-forbes and others added 4 commits July 20, 2022 03:07
Co-authored-by: Rootul Patel <[email protected]>
Co-authored-by: Rootul Patel <[email protected]>
Co-authored-by: Rootul Patel <[email protected]>
Co-authored-by: Rootul Patel <[email protected]>
Copy link
Member

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

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

Is this one ready for review @evan-forbes?

@evan-forbes
Copy link
Member Author

Is this one ready for review @evan-forbes?

kinda but not quite. I would like to have a working well tested version as to avoid changing things, but this will very likely look very similar to the final product so its probably safe to look at and review if you see anything.

I think I renamed the files on a different branch that's further along, but that's it

@evan-forbes
Copy link
Member Author

will break this this branch up a bit now that we have a better idea of what works and is needed

@evan-forbes evan-forbes force-pushed the evan/msg-inclusion-api branch from 530c3e3 to c006232 Compare August 17, 2022 06:48
@evan-forbes evan-forbes marked this pull request as ready for review August 17, 2022 07:15
@evan-forbes
Copy link
Member Author

marking this ready for review again. It is unchanged from the last review, other than I spun off #621 and moved everything else the non-interactive-defaults feature branch

pkg/inclusion/nmt_caching.go Outdated Show resolved Hide resolved
pkg/inclusion/nmt_caching.go Outdated Show resolved Hide resolved
pkg/inclusion/nmt_caching.go Outdated Show resolved Hide resolved
pkg/inclusion/nmt_caching_test.go Outdated Show resolved Hide resolved
pkg/inclusion/nmt_caching_test.go Outdated Show resolved Hide resolved
rach-id
rach-id previously approved these changes Aug 19, 2022
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.

LGTM 🚀. Only left some questions

pkg/inclusion/nmt_caching.go Outdated Show resolved Hide resolved
pkg/inclusion/nmt_caching.go Outdated Show resolved Hide resolved
pkg/inclusion/nmt_caching_test.go Outdated Show resolved Hide resolved
pkg/inclusion/nmt_caching_test.go Show resolved Hide resolved
evan-forbes and others added 2 commits September 2, 2022 00:28
@evan-forbes
Copy link
Member Author

wow, I thought I was replying to things here, but apparently github will treat it as a review if you have pending comments and just continue to add them as pending comments!!

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.

🚀

@evan-forbes evan-forbes merged commit 9d2fc60 into main Sep 2, 2022
@evan-forbes evan-forbes deleted the evan/msg-inclusion-api branch September 2, 2022 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants