Dynamic erasure (#4653)
Remove erasure-related constants Remove unneeded `Iterator::collect` call Document erasure module Randomize coding blobs used for repair
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
use crate::blocktree::Blocktree;
|
||||
use crate::cluster_info::ClusterInfo;
|
||||
use crate::leader_schedule_cache::LeaderScheduleCache;
|
||||
use crate::packet::{Blob, SharedBlob, BLOB_HEADER_SIZE};
|
||||
use crate::packet::{Blob, SharedBlob};
|
||||
use crate::repair_service::{RepairService, RepairStrategy};
|
||||
use crate::result::{Error, Result};
|
||||
use crate::service::Service;
|
||||
@ -62,19 +62,14 @@ pub fn process_blobs(blobs: &[SharedBlob], blocktree: &Arc<Blocktree>) -> Result
|
||||
}
|
||||
}))?;
|
||||
|
||||
for blob in blobs {
|
||||
// TODO: Once the original leader signature is added to the blob, make sure that
|
||||
// the blob was originally generated by the expected leader for this slot
|
||||
|
||||
// Insert the new blob into block tree
|
||||
blocktree.put_many_coding_blobs(blobs.iter().filter_map(move |blob| {
|
||||
if blob.is_coding() {
|
||||
blocktree.put_coding_blob_bytes(
|
||||
blob.slot(),
|
||||
blob.index(),
|
||||
&blob.data[..BLOB_HEADER_SIZE + blob.size()],
|
||||
)?;
|
||||
Some(&**blob)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}))?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user