|
|
@@ -28,7 +28,10 @@ pub struct DuplicateShred {
|
|
|
pub(crate) wallclock: u64,
|
|
|
pub(crate) slot: Slot,
|
|
|
_unused: u32,
|
|
|
- _unused_shred_type: ShredType,
|
|
|
+ // NOTE: This field was previously typed as `ShredType`.
|
|
|
+ // It is semantically unused, so we now deserialize it as a plain `u8`
|
|
|
+ // to avoid strict enum validation errors on bad data.
|
|
|
+ _unused_shred_type: u8,
|
|
|
// Serialized DuplicateSlotProof split into chunks.
|
|
|
num_chunks: u8,
|
|
|
chunk_index: u8,
|
|
|
@@ -243,7 +246,7 @@ where
|
|
|
chunk_index: i as u8,
|
|
|
chunk,
|
|
|
_unused: 0,
|
|
|
- _unused_shred_type: ShredType::Code,
|
|
|
+ _unused_shred_type: ShredType::Code.into(),
|
|
|
});
|
|
|
Ok(chunks)
|
|
|
}
|
|
|
@@ -353,7 +356,7 @@ pub(crate) mod tests {
|
|
|
from: Pubkey::new_unique(),
|
|
|
wallclock: u64::MAX,
|
|
|
slot: Slot::MAX,
|
|
|
- _unused_shred_type: ShredType::Data,
|
|
|
+ _unused_shred_type: ShredType::Data.into(),
|
|
|
num_chunks: u8::MAX,
|
|
|
chunk_index: u8::MAX,
|
|
|
chunk: Vec::default(),
|
|
|
@@ -496,7 +499,7 @@ pub(crate) mod tests {
|
|
|
chunk_index: i as u8,
|
|
|
chunk,
|
|
|
_unused: 0,
|
|
|
- _unused_shred_type: ShredType::Code,
|
|
|
+ _unused_shred_type: ShredType::Code.into(),
|
|
|
});
|
|
|
Ok(chunks)
|
|
|
}
|