pub fn generate_winning_post_sector_challenge<Tree: MerkleTreeTrait>(
    post_config: &PoStConfig,
    randomness: &ChallengeSeed,
    sector_set_size: u64,
    prover_id: Commitment,
) -> Result<Vec<u64>> {
    info!("generate_winning_post_sector_challenge:start");
    ensure!(sector_set_size != 0, "empty sector set is invalid");
    ensure!(
        post_config.typ == PoStType::Winning,
        "invalid post config type"
    );

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

    let randomness_safe: <Tree::Hasher as Hasher>::Domain =
        as_safe_commitment(randomness, "randomness")?;
    let result = fallback::generate_sector_challenges(
        randomness_safe,
        post_config.sector_count,
        sector_set_size,
        prover_id_safe,
    );

    info!("generate_winning_post_sector_challenge:finish");

    result
}
/// Given some randomness and the length of available sectors, generates the challenged sector.
///
/// The returned values are indices in the range of `0..sector_set_size`, requiring the caller
/// to match the index to the correct sector.
Given some randomness and the length of available sectors, generates the challenged sector.
The returned values are indices in the range of `0..sector_set_size`, requiring the caller
to match the index to the correct sector.
Given some randomness and the length of available sectors generates the challenged sector . The returned values are indices in the range of ` 0 .. sector_set_size ` requiring the caller to match the index to the correct sector .
pub fn generate_winning_post_sector_challenge<Tree: MerkleTreeTrait>(
    post_config: &PoStConfig,
    randomness: &ChallengeSeed,
    sector_set_size: u64,
    prover_id: Commitment,
) -> Result<Vec<u64>> {
    info!("generate_winning_post_sector_challenge:start");
    ensure!(sector_set_size != 0, "empty sector set is invalid");
    ensure!(
        post_config.typ == PoStType::Winning,
        "invalid post config type"
    );
    let prover_id_safe: <Tree::Hasher as Hasher>::Domain =
        as_safe_commitment(&prover_id, "prover_id")?;
    let randomness_safe: <Tree::Hasher as Hasher>::Domain =
        as_safe_commitment(randomness, "randomness")?;
    let result = fallback::generate_sector_challenges(
        randomness_safe,
        post_config.sector_count,
        sector_set_size,
        prover_id_safe,
    );
    info!("generate_winning_post_sector_challenge:finish");
    result
}
pub fn generate_winning_post_sector_challenge < Tree : MerkleTreeTrait > ( post_config : & PoStConfig , randomness : & ChallengeSeed , sector_set_size : u64 , prover_id : Commitment , ) -> Result < Vec < u64 > > { info ! ( " " ) ; ensure ! ( sector_set_size 0 " " ) ; ensure ! ( post_config typ PoStType Winning " " ) ; let prover_id_safe : < Tree :: Hasher as Hasher > :: Domain = as_safe_commitment ( & prover_id , " " ) ? ; let randomness_safe : < Tree :: Hasher as Hasher > :: Domain = as_safe_commitment ( randomness , " " ) ? ; let result = fallback :: generate_sector_challenges ( randomness_safe , post_config . sector_count , sector_set_size , prover_id_safe , ) ; info ! ( " " ) ; result }
Given some randomness and the length of available sectors, generates the challenged sector.
Given some randomness and the length of available sectors generates the challenged sector .
post_config
&PoStConfig
randomness
&ChallengeSeed
sector_set_size
u64
prover_id
Commitment
post_config
&PoStConfig
randomness
&ChallengeSeed
sector_set_size
u64
prover_id
Commitment