pub fn generate_single_vanilla_proof<Tree: 'static + MerkleTreeTrait>(
    post_config: &PoStConfig,
    sector_id: SectorId,
    replica: &PrivateReplicaInfo<Tree>,
    challenges: &[u64],
) -> Result<FallbackPoStSectorProof<Tree>> {
    info!("generate_single_vanilla_proof:start: {:?}", sector_id);

    let tree = &replica
        .merkle_tree(post_config.sector_size)
        .with_context(|| {
            format!(
                "generate_single_vanilla_proof: merkle_tree failed: {:?}",
                sector_id
            )
        })?;
    let comm_r = replica.safe_comm_r().with_context(|| {
        format!(
            "generate_single_vanilla_poof: safe_comm_r failed: {:?}",
            sector_id
        )
    })?;
    let comm_c = replica.safe_comm_c();
    let comm_r_last = replica.safe_comm_r_last();

    let mut priv_sectors = Vec::with_capacity(1);
    priv_sectors.push(fallback::PrivateSector {
        tree,
        comm_c,
        comm_r_last,
    });

    let priv_inputs = fallback::PrivateInputs::<Tree> {
        sectors: &priv_sectors,
    };

    let vanilla_proof =
        fallback::vanilla_proof(sector_id, &priv_inputs, challenges).with_context(|| {
            format!(
                "generate_single_vanilla_proof: vanilla_proof failed: {:?}",
                sector_id
            )
        })?;

    info!("generate_single_vanilla_proof:finish: {:?}", sector_id);

    Ok(FallbackPoStSectorProof {
        sector_id,
        comm_r,
        vanilla_proof,
    })
}
/// Generates a single vanilla proof required for either Window proof-of-spacetime
/// or Winning proof-of-spacetime.
Generates a single vanilla proof required for either Window proof-of-spacetime
or Winning proof-of-spacetime.
Generates a single vanilla proof required for either Window proof - of - spacetime or Winning proof - of - spacetime .
pub fn generate_single_vanilla_proof<Tree: 'static + MerkleTreeTrait>(
    post_config: &PoStConfig,
    sector_id: SectorId,
    replica: &PrivateReplicaInfo<Tree>,
    challenges: &[u64],
) -> Result<FallbackPoStSectorProof<Tree>> {
    info!("generate_single_vanilla_proof:start: {:?}", sector_id);
    let tree = &replica
        .merkle_tree(post_config.sector_size)
        .with_context(|| {
            format!(
                "generate_single_vanilla_proof: merkle_tree failed: {:?}",
                sector_id
            )
        })?;
    let comm_r = replica.safe_comm_r().with_context(|| {
        format!(
            "generate_single_vanilla_poof: safe_comm_r failed: {:?}",
            sector_id
        )
    })?;
    let comm_c = replica.safe_comm_c();
    let comm_r_last = replica.safe_comm_r_last();
    let mut priv_sectors = Vec::with_capacity(1);
    priv_sectors.push(fallback::PrivateSector {
        tree,
        comm_c,
        comm_r_last,
    });
    let priv_inputs = fallback::PrivateInputs::<Tree> {
        sectors: &priv_sectors,
    };
    let vanilla_proof =
        fallback::vanilla_proof(sector_id, &priv_inputs, challenges).with_context(|| {
            format!(
                "generate_single_vanilla_proof: vanilla_proof failed: {:?}",
                sector_id
            )
        })?;
    info!("generate_single_vanilla_proof:finish: {:?}", sector_id);
    Ok(FallbackPoStSectorProof {
        sector_id,
        comm_r,
        vanilla_proof,
    })
}
pub fn generate_single_vanilla_proof < Tree : ' static + MerkleTreeTrait > ( post_config : & PoStConfig , sector_id : SectorId , replica : & PrivateReplicaInfo < Tree > , challenges : & [ u64 ] , ) -> Result < FallbackPoStSectorProof < Tree > > { info ! ( " " sector_id ) ; let tree = & replica . merkle_tree ( post_config . sector_size ) . with_context ( | | { format ! ( " " sector_id ) } ) ? ; let comm_r = replica . safe_comm_r ( ) . with_context ( | | { format ! ( " " sector_id ) } ) ? ; let comm_c = replica . safe_comm_c ( ) ; let comm_r_last = replica . safe_comm_r_last ( ) ; let mut priv_sectors = Vec :: with_capacity ( 1 ) ; priv_sectors . push ( fallback :: PrivateSector { tree , comm_c , comm_r_last , } ) ; let priv_inputs = fallback :: PrivateInputs :: < Tree > { sectors : & priv_sectors , } ; let vanilla_proof = fallback :: vanilla_proof ( sector_id , & priv_inputs , challenges ) . with_context ( | | { format ! ( " " sector_id ) } ) ? ; info ! ( " " sector_id ) ; Ok ( FallbackPoStSectorProof { sector_id , comm_r , vanilla_proof , } ) }
Generates a single vanilla proof required for either Window proof-of-spacetime
or Winning proof-of-spacetime.
Generates a single vanilla proof required for either Window proof - of - spacetime or Winning proof - of - spacetime .
post_config
&PoStConfig
sector_id
SectorId
replica
&PrivateReplicaInfo<Tree>
challenges
&[u64]
post_config
&PoStConfig
sector_id
SectorId
replica
&PrivateReplicaInfo<Tree>
challenges
&[u64]