-
Notifications
You must be signed in to change notification settings - Fork 293
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
Prevent double writes of samples to IPFS #271
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd wait for another reviewer to comment before merging, but this LGTM 👍
IMO this closes #204 as well. Awesome find @Wondertan
Co-authored-by: Ismail Khoffi <Ismail.Khoffi@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #271 +/- ##
==========================================
- Coverage 62.27% 62.12% -0.16%
==========================================
Files 260 262 +2
Lines 23218 23359 +141
==========================================
+ Hits 14460 14512 +52
- Misses 7265 7329 +64
- Partials 1493 1518 +25
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great find and great work! 🚀
Problem
As we compute the NMT tree for columns and rows of shares in an extended data square, we end up adding all the shares into IPFS two times, thus introducing unnecessary overhead, especially for IO. Considering how big blocks may become and how quickly they are generated, the overhead would scale significantly.
Solution
The PR introduces a simple patch in NMTNodeAdder to memoize added leaves not to be added a second time.
EDIT:
It also fixes incorrect use of
BatchAdder
EDIT2:
Closes #204