pub fn generate_window_post_with_vanilla<Tree: 'static + MerkleTreeTrait>(
    post_config: &PoStConfig,
    randomness: &ChallengeSeed,
    prover_id: ProverId,
    vanilla_proofs: Vec<FallbackPoStSectorProof<Tree>>,
) -> Result<SnarkProof> {
    info!("generate_window_post_with_vanilla:start");
    ensure!(
        post_config.typ == PoStType::Window,
        "invalid post config type"
    );

    let randomness_safe: <Tree::Hasher as Hasher>::Domain =
        as_safe_commitment(randomness, "randomness")?;
    let prover_id_safe: <Tree::Hasher as Hasher>::Domain =
        as_safe_commitment(&prover_id, "prover_id")?;

    let vanilla_params = window_post_setup_params(&post_config);
    let partitions = get_partitions_for_window_post(vanilla_proofs.len(), &post_config);

    let setup_params = compound_proof::SetupParams {
        vanilla_params,
        partitions,
        priority: post_config.priority,
    };

    let partitions = match partitions {
        Some(x) => x,
        None => 1,
    };

    let pub_params: compound_proof::PublicParams<fallback::FallbackPoSt<Tree>> =
        fallback::FallbackPoStCompound::setup(&setup_params)?;
    let groth_params = get_post_params::<Tree>(&post_config)?;

    let mut pub_sectors = Vec::with_capacity(vanilla_proofs.len());
    for vanilla_proof in &vanilla_proofs {
        pub_sectors.push(fallback::PublicSector {
            id: vanilla_proof.sector_id,
            comm_r: vanilla_proof.comm_r,
        });
    }

    let pub_inputs = fallback::PublicInputs {
        randomness: randomness_safe,
        prover_id: prover_id_safe,
        sectors: &pub_sectors,
        k: None,
    };

    let partitioned_proofs = partition_vanilla_proofs(
        &post_config,
        &pub_params.vanilla_params,
        &pub_inputs,
        partitions,
        &vanilla_proofs,
    )?;

    let proof = fallback::FallbackPoStCompound::prove_with_vanilla(
        &pub_params,
        &pub_inputs,
        partitioned_proofs,
        &groth_params,
    )?;

    info!("generate_window_post_with_vanilla:finish");

    Ok(proof.to_vec()?)
}
/// Generates a Window proof-of-spacetime with provided vanilla proofs.
Generates a Window proof-of-spacetime with provided vanilla proofs.
Generates a Window proof - of - spacetime with provided vanilla proofs .
pub fn generate_window_post_with_vanilla<Tree: 'static + MerkleTreeTrait>(
    post_config: &PoStConfig,
    randomness: &ChallengeSeed,
    prover_id: ProverId,
    vanilla_proofs: Vec<FallbackPoStSectorProof<Tree>>,
) -> Result<SnarkProof> {
    info!("generate_window_post_with_vanilla:start");
    ensure!(
        post_config.typ == PoStType::Window,
        "invalid post config type"
    );
    let randomness_safe: <Tree::Hasher as Hasher>::Domain =
        as_safe_commitment(randomness, "randomness")?;
    let prover_id_safe: <Tree::Hasher as Hasher>::Domain =
        as_safe_commitment(&prover_id, "prover_id")?;
    let vanilla_params = window_post_setup_params(&post_config);
    let partitions = get_partitions_for_window_post(vanilla_proofs.len(), &post_config);
    let setup_params = compound_proof::SetupParams {
        vanilla_params,
        partitions,
        priority: post_config.priority,
    };
    let partitions = match partitions {
        Some(x) => x,
        None => 1,
    };
    let pub_params: compound_proof::PublicParams<fallback::FallbackPoSt<Tree>> =
        fallback::FallbackPoStCompound::setup(&setup_params)?;
    let groth_params = get_post_params::<Tree>(&post_config)?;
    let mut pub_sectors = Vec::with_capacity(vanilla_proofs.len());
    for vanilla_proof in &vanilla_proofs {
        pub_sectors.push(fallback::PublicSector {
            id: vanilla_proof.sector_id,
            comm_r: vanilla_proof.comm_r,
        });
    }
    let pub_inputs = fallback::PublicInputs {
        randomness: randomness_safe,
        prover_id: prover_id_safe,
        sectors: &pub_sectors,
        k: None,
    };
    let partitioned_proofs = partition_vanilla_proofs(
        &post_config,
        &pub_params.vanilla_params,
        &pub_inputs,
        partitions,
        &vanilla_proofs,
    )?;
    let proof = fallback::FallbackPoStCompound::prove_with_vanilla(
        &pub_params,
        &pub_inputs,
        partitioned_proofs,
        &groth_params,
    )?;
    info!("generate_window_post_with_vanilla:finish");
    Ok(proof.to_vec()?)
}
pub fn generate_window_post_with_vanilla < Tree : ' static + MerkleTreeTrait > ( post_config : & PoStConfig , randomness : & ChallengeSeed , prover_id : ProverId , vanilla_proofs : Vec < FallbackPoStSectorProof < Tree > > , ) -> Result < SnarkProof > { info ! ( " " ) ; ensure ! ( post_config typ PoStType Window " " ) ; let randomness_safe : < Tree :: Hasher as Hasher > :: Domain = as_safe_commitment ( randomness , " " ) ? ; let prover_id_safe : < Tree :: Hasher as Hasher > :: Domain = as_safe_commitment ( & prover_id , " " ) ? ; let vanilla_params = window_post_setup_params ( & post_config ) ; let partitions = get_partitions_for_window_post ( vanilla_proofs . len ( ) , & post_config ) ; let setup_params = compound_proof :: SetupParams { vanilla_params , partitions , priority : post_config . priority , } ; let partitions = match partitions { Some ( x ) => x , None => 1 , } ; let pub_params : compound_proof :: PublicParams < fallback :: FallbackPoSt < Tree > > = fallback :: FallbackPoStCompound :: setup ( & setup_params ) ? ; let groth_params = get_post_params :: < Tree > ( & post_config ) ? ; let mut pub_sectors = Vec :: with_capacity ( vanilla_proofs . len ( ) ) ; for vanilla_proof in & vanilla_proofs { pub_sectors . push ( fallback :: PublicSector { id : vanilla_proof . sector_id , comm_r : vanilla_proof . comm_r , } ) ; } let pub_inputs = fallback :: PublicInputs { randomness : randomness_safe , prover_id : prover_id_safe , sectors : & pub_sectors , k : None , } ; let partitioned_proofs = partition_vanilla_proofs ( & post_config , & pub_params . vanilla_params , & pub_inputs , partitions , & vanilla_proofs , ) ? ; let proof = fallback :: FallbackPoStCompound :: prove_with_vanilla ( & pub_params , & pub_inputs , partitioned_proofs , & groth_params , ) ? ; info ! ( " " ) ; Ok ( proof . to_vec ( ) ? ) }
Generates a Window proof-of-spacetime with provided vanilla proofs.
Generates a Window proof - of - spacetime with provided vanilla proofs .
post_config
&PoStConfig
randomness
&ChallengeSeed
prover_id
ProverId
vanilla_proofs
Vec<FallbackPoStSectorProof<Tree>>
post_config
&PoStConfig
randomness
&ChallengeSeed
prover_id
ProverId
vanilla_proofs
Vec<FallbackPoStSectorProof<Tree>>