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
adds methods to obtain shreds' erasure coded block and index #21325
Conversation
Codecov Report
@@ Coverage Diff @@
## master #21325 +/- ##
=========================================
- Coverage 81.5% 81.5% -0.1%
=========================================
Files 500 501 +1
Lines 140604 141003 +399
=========================================
+ Hits 114704 114981 +277
- Misses 25900 26022 +122 |
ledger/src/shred.rs
Outdated
let fec_set_index = self.common_header.fec_set_index; | ||
let index = self.index().checked_sub(fec_set_index)? as usize; | ||
if self.is_data() { | ||
Some(index) |
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.
Should we also uphold this existing check from the current code:
if index >= num_data_shreds {
return Err(InvalidIndex);
}
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.
We don't know number of data shreds here, and I don't want to pass it in as a function argument (or check it inside Shredder) because then that would leak out implementation details.
The goal of this commit was to encapsulate and hide the implementation details of erasure coding indices.
I think it is fine not to check for it because data reconstruct from codes will error out anyways.
The check was only added recently in #21082
and is not released yet.
e65c078
to
a08b17e
Compare
…olana-labs#21325)" This reverts commit b267586.
(cherry picked from commit 7da2df7)
Problem
Working towards encapsulating erasure coding scheme inside shreds in order to simplify upcoming changes and not to leak implementation details.
Summary of Changes
.drain
.