Revert "Dynamic erasure (#4653)"

This reverts commit ada4d16c4c.
This commit is contained in:
Michael Vines
2019-06-20 20:15:33 -07:00
parent aa0f8538ed
commit 36c9e22e3d
14 changed files with 1064 additions and 1118 deletions

View File

@ -4,7 +4,7 @@
use crate::blocktree::Blocktree;
use crate::cluster_info::ClusterInfo;
use crate::leader_schedule_cache::LeaderScheduleCache;
use crate::packet::{Blob, SharedBlob};
use crate::packet::{Blob, SharedBlob, BLOB_HEADER_SIZE};
use crate::repair_service::{RepairService, RepairStrategy};
use crate::result::{Error, Result};
use crate::service::Service;
@ -62,14 +62,19 @@ pub fn process_blobs(blobs: &[SharedBlob], blocktree: &Arc<Blocktree>) -> Result
}
}))?;
blocktree.put_many_coding_blobs(blobs.iter().filter_map(move |blob| {
if blob.is_coding() {
Some(&**blob)
} else {
None
}
}))?;
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
if blob.is_coding() {
blocktree.put_coding_blob_bytes(
blob.slot(),
blob.index(),
&blob.data[..BLOB_HEADER_SIZE + blob.size()],
)?;
}
}
Ok(())
}