fn maliciously_return_wrong_hash(
    manifest: &Manifest,
    log: &ReplicaLogger,
    malicious_flags: &MaliciousFlags,
    height: Height,
) -> CryptoHashOfState {
    use ic_protobuf::log::malicious_behaviour_log_entry::v1::{
        MaliciousBehaviour, MaliciousBehaviourLogEntry,
    };

    if malicious_flags
        .maliciously_corrupt_own_state_at_heights
        .contains(&height.get())
    {
        ic_logger::info!(
            log,
            "[MALICIOUS] corrupting the hash of the state at height {}",
            height.get();
            malicious_behaviour => MaliciousBehaviourLogEntry { malicious_behaviour: MaliciousBehaviour::CorruptOwnStateAtHeights as i32}
        );
        CryptoHashOfState::from(CryptoHash(vec![0u8; 32]))
    } else {
        CryptoHashOfState::from(CryptoHash(
            crate::manifest::manifest_hash(&manifest).to_vec(),
        ))
    }
}
/// When maliciously_corrupt_own_state_at_heights contains the given height,
/// this function returns a false hash that contains all 0s.
When maliciously_corrupt_own_state_at_heights contains the given height,
this function returns a false hash that contains all 0s.
When maliciously_corrupt_own_state_at_heights contains the given height this function returns a false hash that contains all 0s .
fn maliciously_return_wrong_hash(
    manifest: &Manifest,
    log: &ReplicaLogger,
    malicious_flags: &MaliciousFlags,
    height: Height,
) -> CryptoHashOfState {
    use ic_protobuf::log::malicious_behaviour_log_entry::v1::{
        MaliciousBehaviour, MaliciousBehaviourLogEntry,
    };
    if malicious_flags
        .maliciously_corrupt_own_state_at_heights
        .contains(&height.get())
    {
        ic_logger::info!(
            log,
            "[MALICIOUS] corrupting the hash of the state at height {}",
            height.get();
            malicious_behaviour => MaliciousBehaviourLogEntry { malicious_behaviour: MaliciousBehaviour::CorruptOwnStateAtHeights as i32}
        );
        CryptoHashOfState::from(CryptoHash(vec![0u8; 32]))
    } else {
        CryptoHashOfState::from(CryptoHash(
            crate::manifest::manifest_hash(&manifest).to_vec(),
        ))
    }
}
fn maliciously_return_wrong_hash ( manifest : & Manifest , log : & ReplicaLogger , malicious_flags : & MaliciousFlags , height : Height , ) -> CryptoHashOfState { use ic_protobuf :: log :: malicious_behaviour_log_entry :: v1 :: { MaliciousBehaviour , MaliciousBehaviourLogEntry , } ; if malicious_flags . maliciously_corrupt_own_state_at_heights . contains ( & height . get ( ) ) { ic_logger :: info ! ( log " " height get ( ) malicious_behaviour MaliciousBehaviourLogEntry { malicious_behaviour MaliciousBehaviour CorruptOwnStateAtHeights as i32 } ) ; CryptoHashOfState :: from ( CryptoHash ( vec ! [ 0u8 32 ] ) ) } else { CryptoHashOfState :: from ( CryptoHash ( crate :: manifest :: manifest_hash ( & manifest ) . to_vec ( ) , ) ) } }
When maliciously_corrupt_own_state_at_heights contains the given height,
this function returns a false hash that contains all 0s.
When maliciously_corrupt_own_state_at_heights contains the given height this function returns a false hash that contains all 0s .
manifest
&Manifest
log
&ReplicaLogger
malicious_flags
&MaliciousFlags
height
Height
manifest
&Manifest
log
&ReplicaLogger
malicious_flags
&MaliciousFlags
height
Height