removes first_coding_index from erasure recovery code (#16646)

first_coding_index is the same as the set_index and is so redundant:
https://github.com/solana-labs/solana/blob/37b8587d4/ledger/src/blockstore_meta.rs#L49-L60
This commit is contained in:
behzad nouri
2021-04-23 12:00:37 +00:00
committed by GitHub
parent f59fe41abf
commit 03194145c0
6 changed files with 24 additions and 62 deletions

View File

@@ -76,7 +76,6 @@ fn test_multi_fec_block_coding() {
MAX_DATA_SHREDS_PER_FEC_BLOCK as usize,
MAX_DATA_SHREDS_PER_FEC_BLOCK as usize,
shred_start_index,
shred_start_index,
slot,
)
.unwrap();
@@ -121,6 +120,7 @@ fn test_multi_fec_block_different_size_coding() {
for (fec_data_shreds, fec_coding_shreds) in fec_data.values().zip(fec_coding.values()) {
let first_data_index = fec_data_shreds.first().unwrap().index() as usize;
let first_code_index = fec_coding_shreds.first().unwrap().index() as usize;
assert_eq!(first_data_index, first_code_index);
let num_data = fec_data_shreds.len();
let num_coding = fec_coding_shreds.len();
let all_shreds: Vec<Shred> = fec_data_shreds
@@ -129,17 +129,9 @@ fn test_multi_fec_block_different_size_coding() {
.chain(fec_coding_shreds.iter().step_by(2))
.cloned()
.collect();
let recovered_data = Shredder::try_recovery(
all_shreds,
num_data,
num_coding,
first_data_index,
first_code_index,
slot,
)
.unwrap();
let recovered_data =
Shredder::try_recovery(all_shreds, num_data, num_coding, first_data_index, slot)
.unwrap();
// Necessary in order to ensure the last shred in the slot
// is part of the recovered set, and that the below `index`
// calcuation in the loop is correct