async fn validate_tipset(&self, fts: FullTipset) -> Result<(), Error> {
        if &fts.to_tipset() == self.genesis.as_ref() {
            debug!("Skipping tipset validation for genesis");
            return Ok(());
        }

        let epoch = fts.epoch();

        let mut validations = FuturesUnordered::new();
        for b in fts.into_blocks() {
            let sm = self.state_manager.clone();
            let bc = self.beacon.clone();
            let v = task::spawn(async move { Self::validate_block(sm, bc, Arc::new(b)).await });
            validations.push(v);
        }

        while let Some(result) = validations.next().await {
            match result {
                Ok(block) => {
                    self.chain_store()
                        .add_to_tipset_tracker(block.header())
                        .await;
                }
                Err((cid, e)) => {
                    // If the error is temporally invalidated, don't add to bad blocks cache.
                    if !matches!(e, Error::Temporal(_, _)) {
                        self.bad_blocks.put(cid, e.to_string()).await;
                    }
                    return Err(Error::Other(format!("Invalid block detected: {}", e)));
                }
            }
        }
        info!("Successfully validated tipset at epoch: {}", epoch);
        Ok(())
    }
/// validates tipsets and adds header data to tipset tracker
validates tipsets and adds header data to tipset tracker
validates tipsets and adds header data to tipset tracker
async fn validate_tipset(&self, fts: FullTipset) -> Result<(), Error> {
        if &fts.to_tipset() == self.genesis.as_ref() {
            debug!("Skipping tipset validation for genesis");
            return Ok(());
        }
        let epoch = fts.epoch();
        let mut validations = FuturesUnordered::new();
        for b in fts.into_blocks() {
            let sm = self.state_manager.clone();
            let bc = self.beacon.clone();
            let v = task::spawn(async move { Self::validate_block(sm, bc, Arc::new(b)).await });
            validations.push(v);
        }
        while let Some(result) = validations.next().await {
            match result {
                Ok(block) => {
                    self.chain_store()
                        .add_to_tipset_tracker(block.header())
                        .await;
                }
                Err((cid, e)) => {
                    // If the error is temporally invalidated, don't add to bad blocks cache.
                    if !matches!(e, Error::Temporal(_, _)) {
                        self.bad_blocks.put(cid, e.to_string()).await;
                    }
                    return Err(Error::Other(format!("Invalid block detected: {}", e)));
                }
            }
        }
        info!("Successfully validated tipset at epoch: {}", epoch);
        Ok(())
    }
async fn validate_tipset ( & self , fts : FullTipset ) -> Result < ( ) , Error > { if & fts . to_tipset ( ) == self . genesis . as_ref ( ) { debug ! ( " " ) ; return Ok ( ( ) ) ; } let epoch = fts . epoch ( ) ; let mut validations = FuturesUnordered :: new ( ) ; for b in fts . into_blocks ( ) { let sm = self . state_manager . clone ( ) ; let bc = self . beacon . clone ( ) ; let v = task :: spawn ( async move { Self :: validate_block ( sm , bc , Arc :: new ( b ) ) . await } ) ; validations . push ( v ) ; } while let Some ( result ) = validations . next ( ) . await { match result { Ok ( block ) => { self . chain_store ( ) . add_to_tipset_tracker ( block . header ( ) ) . await ; } Err ( ( cid , e ) ) => { // If the error is temporally invalidated, don't add to bad blocks cache. if ! matches ! ( e Error Temporal ( ) ) { self . bad_blocks . put ( cid , e . to_string ( ) ) . await ; } return Err ( Error :: Other ( format ! ( " " e ) ) ) ; } } } info ! ( " " epoch ) ; Ok ( ( ) ) }
validates tipsets and adds header data to tipset tracker
validates tipsets and adds header data to tipset tracker
&self
fts
FullTipset