removes Default implementaion of ErasureConfig
The Default implementation of ErasureConfig is off and never useful: https://github.com/solana-labs/solana/blob/150951333/ledger/src/erasure.rs#L49-L68
This commit is contained in:
parent
7e98b77b33
commit
d25d9be555
|
@ -46,7 +46,7 @@ pub struct ShredIndex {
|
|||
index: BTreeSet<u64>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default, Deserialize, Serialize, Eq, PartialEq)]
|
||||
#[derive(Clone, Copy, Debug, Deserialize, Serialize, Eq, PartialEq)]
|
||||
/// Erasure coding information
|
||||
pub struct ErasureMeta {
|
||||
/// Which erasure set in the slot this is
|
||||
|
@ -217,7 +217,8 @@ impl ErasureMeta {
|
|||
ErasureMeta {
|
||||
set_index,
|
||||
config,
|
||||
..Self::default()
|
||||
__unused_first_coding_index: 0,
|
||||
__unused_size: 0,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -285,7 +286,7 @@ mod test {
|
|||
use ErasureMetaStatus::*;
|
||||
|
||||
let set_index = 0;
|
||||
let erasure_config = ErasureConfig::default();
|
||||
let erasure_config = ErasureConfig::new(8, 16);
|
||||
|
||||
let e_meta = ErasureMeta::new(set_index, erasure_config);
|
||||
let mut rng = thread_rng();
|
||||
|
|
|
@ -46,27 +46,12 @@ use {
|
|||
serde::{Deserialize, Serialize},
|
||||
};
|
||||
|
||||
//TODO(sakridge) pick these values
|
||||
/// Number of data shreds
|
||||
pub const NUM_DATA: usize = 8;
|
||||
/// Number of coding shreds; also the maximum number that can go missing.
|
||||
pub const NUM_CODING: usize = 8;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ErasureConfig {
|
||||
num_data: usize,
|
||||
num_coding: usize,
|
||||
}
|
||||
|
||||
impl Default for ErasureConfig {
|
||||
fn default() -> ErasureConfig {
|
||||
ErasureConfig {
|
||||
num_data: NUM_DATA,
|
||||
num_coding: NUM_CODING,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl ErasureConfig {
|
||||
pub fn new(num_data: usize, num_coding: usize) -> ErasureConfig {
|
||||
ErasureConfig {
|
||||
|
@ -122,12 +107,6 @@ impl Session {
|
|||
}
|
||||
}
|
||||
|
||||
impl Default for Session {
|
||||
fn default() -> Session {
|
||||
Session::new(NUM_DATA, NUM_CODING).unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub mod test {
|
||||
use super::*;
|
||||
|
|
Loading…
Reference in New Issue