/// Return the finalized block at height if the given `CatchUpContent` is
/// consistent, PermanentError if it is inconsistent, and TransientError
/// if there is insufficient data to verify consistency (see CON-330).
///
/// A CatchUpContent is inconsistent if things in it do not match up, e.g.
/// block height != random beacon height. Or it does not match
/// known valid artifacts already in the validated pool. Note that this
/// validation is only performed for the content of catch-up package
/// shares. The content of full CUPs has to be trusted if it is signed
/// by the subnet.
Return the finalized block at height if the given `CatchUpContent` is
consistent, PermanentError if it is inconsistent, and TransientError
if there is insufficient data to verify consistency .

A CatchUpContent is inconsistent if things in it do not match up, e.g.
block height != random beacon height. Or it does not match
known valid artifacts already in the validated pool. Note that this
validation is only performed for the content of catch-up package
shares. The content of full CUPs has to be trusted if it is signed
by the subnet.
Return the finalized block at height if the given ` CatchUpContent ` is consistent PermanentError if it is inconsistent and TransientError if there is insufficient data to verify consistency . A CatchUpContent is inconsistent if things in it do not match up e . g . block height ! = random beacon height . Or it does not match known valid artifacts already in the validated pool . Note that this validation is only performed for the content of catch - up package shares . The content of full CUPs has to be trusted if it is signed by the subnet .
fn validate_catch_up_share_content(
        &self,
        pool_reader: &PoolReader<'_>,
        share_content: &CatchUpShareContent,
    ) -> Result<Block, ValidatorError> {
        let height = share_content.height();
        let block = pool_reader
            .get_finalized_block(height)
            .ok_or(TransientError::FinalizedBlockNotFound(height))?;
        if ic_crypto::crypto_hash(&block) != share_content.block {
            warn!(self.log, "Block from received CatchUpShareContent does not match finalized block in the pool: {:?} {:?}", share_content, block);
            Err(PermanentError::MismatchedBlockInCatchUpPackageShare)?
        }
        let beacon = pool_reader
            .get_random_beacon(height)
            .ok_or(TransientError::RandomBeaconNotFound(height))?;
        if &beacon != share_content.random_beacon.get_value() {
            warn!(self.log, "RandomBeacon from received CatchUpContent does not match RandomBeacon in the pool: {:?} {:?}", share_content, beacon);
            Err(PermanentError::MismatchedRandomBeaconInCatchUpPackageShare)?
        }
        let hash = self
            .state_manager
            .get_state_hash_at(height)
            .map_err(TransientError::StateManagerError)?
            .ok_or(TransientError::StateNotAvailable(height))?;
        if hash != share_content.state_hash {
            warn!( self.log, "State hash from received CatchUpContent does not match local state hash: {:?} {:?}", share_content, hash);
            Err(PermanentError::MismatchedStateHashInCatchUpPackageShare)?
        }
        Ok(block)
    }
fn validate_catch_up_share_content ( & self , pool_reader : & PoolReader < ' _ > , share_content : & CatchUpShareContent , ) -> Result < Block , ValidatorError > { let height = share_content . height ( ) ; let block = pool_reader . get_finalized_block ( height ) . ok_or ( TransientError :: FinalizedBlockNotFound ( height ) ) ? ; if ic_crypto :: crypto_hash ( & block ) != share_content . block { warn ! ( self log " " share_content block ) ; Err ( PermanentError :: MismatchedBlockInCatchUpPackageShare ) ? } let beacon = pool_reader . get_random_beacon ( height ) . ok_or ( TransientError :: RandomBeaconNotFound ( height ) ) ? ; if & beacon != share_content . random_beacon . get_value ( ) { warn ! ( self log " " share_content beacon ) ; Err ( PermanentError :: MismatchedRandomBeaconInCatchUpPackageShare ) ? } let hash = self . state_manager . get_state_hash_at ( height ) . map_err ( TransientError :: StateManagerError ) ? . ok_or ( TransientError :: StateNotAvailable ( height ) ) ? ; if hash != share_content . state_hash { warn ! ( self log " " share_content hash ) ; Err ( PermanentError :: MismatchedStateHashInCatchUpPackageShare ) ? } Ok ( block ) }
Return the finalized block at height if the given `CatchUpContent` is
consistent, PermanentError if it is inconsistent, and TransientError
if there is insufficient data to verify consistency (see CON-330).
Return the finalized block at height if the given ` CatchUpContent ` is consistent PermanentError if it is inconsistent and TransientError if there is insufficient data to verify consistency ( see CON - 330 ) .
&self
pool_reader
&PoolReader<'_>
share_content
&CatchUpShareContent