pub fn encode<S: Shard>(bytes: &[u8], validator_count: usize) -> Result<Vec<S>>