Window service is filtering out coding shreds (#6052) (#6059)

automerge
This commit is contained in:
mergify[bot]
2019-09-24 13:48:13 -07:00
committed by Grimes
parent 9fd29b0575
commit aac0d7f2f5
2 changed files with 12 additions and 2 deletions

View File

@ -396,7 +396,7 @@ impl Blocktree {
set_index as usize,
slot,
) {
submit_metrics(true, "complete".into());
submit_metrics(true, format!("complete. recovered: {}", result.len()));
recovered_data_shreds.append(&mut result);
} else {
submit_metrics(true, "incomplete".into());

View File

@ -25,6 +25,16 @@ use std::time::{Duration, Instant};
pub const NUM_THREADS: u32 = 10;
fn verify_shred_slot(shred: &Shred, root: u64) -> bool {
if shred.is_data() {
// Only data shreds have parent information
blocktree::verify_shred_slots(shred.slot(), shred.parent(), root)
} else {
// Filter out outdated coding shreds
shred.slot() >= root
}
}
/// drop blobs that are from myself or not from the correct leader for the
/// blob's slot
pub fn should_retransmit_and_persist(
@ -42,7 +52,7 @@ pub fn should_retransmit_and_persist(
if leader_id == *my_pubkey {
inc_new_counter_debug!("streamer-recv_window-circular_transmission", 1);
false
} else if !blocktree::verify_shred_slots(shred.slot(), shred.parent(), root) {
} else if !verify_shred_slot(shred, root) {
inc_new_counter_debug!("streamer-recv_window-outdated_transmission", 1);
false
} else if !shred.verify(&leader_id) {