fn create_initial_params<Tree: 'static + MerkleTreeTrait>(
    proof: Proof,
    hasher: Hasher,
    sector_size: Sector,
) {
    let head = get_head_commit();

    info!(
        "creating initial params for circuit: {}-{}-{}-{}",
        proof.pretty_print(),
        hasher.pretty_print(),
        sector_size.pretty_print(),
        head,
    );

    let start_total = Instant::now();
    let dt_create_circuit: u64;
    let dt_create_params: u64;

    let params = match (proof, hasher) {
        (Proof::Sdr, Hasher::Poseidon) => {
            let start = Instant::now();
            let public_params = blank_sdr_poseidon_params(sector_size.as_u64());
            let circuit = <StackedCompound<Tree, Sha256Hasher> as CompoundProof<
                StackedDrg<Tree, Sha256Hasher>,
                _,
            >>::blank_circuit(&public_params);
            dt_create_circuit = start.elapsed().as_secs();
            let start = Instant::now();
            let params = MPCParameters::new(circuit).expect("mpc params new failure");
            dt_create_params = start.elapsed().as_secs();
            params
        }
        (Proof::Winning, Hasher::Poseidon) => {
            let start = Instant::now();
            let public_params = blank_winning_post_poseidon_params::<Tree>(sector_size.as_u64());
            let circuit = <FallbackPoStCompound<Tree> as CompoundProof<
                FallbackPoSt<Tree>,
                FallbackPoStCircuit<Tree>,
            >>::blank_circuit(&public_params);
            dt_create_circuit = start.elapsed().as_secs();
            let start = Instant::now();
            let params = MPCParameters::new(circuit).expect("mpc params new failure");
            dt_create_params = start.elapsed().as_secs();
            params
        }
        (Proof::Window, Hasher::Poseidon) => {
            let start = Instant::now();
            let public_params = blank_window_post_poseidon_params::<Tree>(sector_size.as_u64());
            let circuit = <FallbackPoStCompound<Tree> as CompoundProof<
                FallbackPoSt<Tree>,
                FallbackPoStCircuit<Tree>,
            >>::blank_circuit(&public_params);
            dt_create_circuit = start.elapsed().as_secs();
            let start = Instant::now();
            let params = MPCParameters::new(circuit).expect("mpc params new failure");
            dt_create_params = start.elapsed().as_secs();
            params
        }
    };

    info!(
        "successfully created initial params for circuit, dt_create_circuit={}s, dt_create_params={}s",
        dt_create_circuit,
        dt_create_params
    );

    let large_path = params_filename(
        proof,
        hasher,
        sector_size,
        &head,
        0,
        ParamSize::Large,
        false,
    );

    {
        info!("writing large initial params to file: {}", large_path);
        let file = File::create(&large_path).expect("param file create failure");
        let mut writer = BufWriter::with_capacity(1024 * 1024, file);
        params.write(&mut writer).expect("param file write failure");
        info!("finished writing large params to file");
    }

    // TODO: add conversion from large to small params to phase2 crate, then write initial params as
    // small-raw.
    /*
    let small_path = params_filename(proof, hasher, sector_size, &head, 0, ParamSize::Small, true);
    {
        info!("writing small initial params to file: {}", small_path);
        let file = File::create(&small_path).unwrap();
        let mut writer = BufWriter::with_capacity(1024 * 1024, file);
        params.write_small(&mut writer).unwrap();
        info!("finished writing small params to file");
    }
    */

    info!(
        "successfully created and wrote initial params for circuit: {}-{}-{}-{}, dt_total={}s",
        proof.pretty_print(),
        hasher.pretty_print(),
        sector_size.pretty_print(),
        head,
        start_total.elapsed().as_secs()
    );
}
/// Creates the first phase2 parameters for a circuit and writes them to a file.
Creates the first phase2 parameters for a circuit and writes them to a file.
Creates the first phase2 parameters for a circuit and writes them to a file .
fn create_initial_params<Tree: 'static + MerkleTreeTrait>(
    proof: Proof,
    hasher: Hasher,
    sector_size: Sector,
) {
    let head = get_head_commit();
    info!(
        "creating initial params for circuit: {}-{}-{}-{}",
        proof.pretty_print(),
        hasher.pretty_print(),
        sector_size.pretty_print(),
        head,
    );
    let start_total = Instant::now();
    let dt_create_circuit: u64;
    let dt_create_params: u64;
    let params = match (proof, hasher) {
        (Proof::Sdr, Hasher::Poseidon) => {
            let start = Instant::now();
            let public_params = blank_sdr_poseidon_params(sector_size.as_u64());
            let circuit = <StackedCompound<Tree, Sha256Hasher> as CompoundProof<
                StackedDrg<Tree, Sha256Hasher>,
                _,
            >>::blank_circuit(&public_params);
            dt_create_circuit = start.elapsed().as_secs();
            let start = Instant::now();
            let params = MPCParameters::new(circuit).expect("mpc params new failure");
            dt_create_params = start.elapsed().as_secs();
            params
        }
        (Proof::Winning, Hasher::Poseidon) => {
            let start = Instant::now();
            let public_params = blank_winning_post_poseidon_params::<Tree>(sector_size.as_u64());
            let circuit = <FallbackPoStCompound<Tree> as CompoundProof<
                FallbackPoSt<Tree>,
                FallbackPoStCircuit<Tree>,
            >>::blank_circuit(&public_params);
            dt_create_circuit = start.elapsed().as_secs();
            let start = Instant::now();
            let params = MPCParameters::new(circuit).expect("mpc params new failure");
            dt_create_params = start.elapsed().as_secs();
            params
        }
        (Proof::Window, Hasher::Poseidon) => {
            let start = Instant::now();
            let public_params = blank_window_post_poseidon_params::<Tree>(sector_size.as_u64());
            let circuit = <FallbackPoStCompound<Tree> as CompoundProof<
                FallbackPoSt<Tree>,
                FallbackPoStCircuit<Tree>,
            >>::blank_circuit(&public_params);
            dt_create_circuit = start.elapsed().as_secs();
            let start = Instant::now();
            let params = MPCParameters::new(circuit).expect("mpc params new failure");
            dt_create_params = start.elapsed().as_secs();
            params
        }
    };
    info!(
        "successfully created initial params for circuit, dt_create_circuit={}s, dt_create_params={}s",
        dt_create_circuit,
        dt_create_params
    );
    let large_path = params_filename(
        proof,
        hasher,
        sector_size,
        &head,
        0,
        ParamSize::Large,
        false,
    );
    {
        info!("writing large initial params to file: {}", large_path);
        let file = File::create(&large_path).expect("param file create failure");
        let mut writer = BufWriter::with_capacity(1024 * 1024, file);
        params.write(&mut writer).expect("param file write failure");
        info!("finished writing large params to file");
    }
    // TODO: add conversion from large to small params to phase2 crate, then write initial params as
    // small-raw.
    /*
    let small_path = params_filename(proof, hasher, sector_size, &head, 0, ParamSize::Small, true);
    {
        info!("writing small initial params to file: {}", small_path);
        let file = File::create(&small_path).unwrap();
        let mut writer = BufWriter::with_capacity(1024 * 1024, file);
        params.write_small(&mut writer).unwrap();
        info!("finished writing small params to file");
    }
    */
    info!(
        "successfully created and wrote initial params for circuit: {}-{}-{}-{}, dt_total={}s",
        proof.pretty_print(),
        hasher.pretty_print(),
        sector_size.pretty_print(),
        head,
        start_total.elapsed().as_secs()
    );
}
fn create_initial_params < Tree : ' static + MerkleTreeTrait > ( proof : Proof , hasher : Hasher , sector_size : Sector , ) { let head = get_head_commit ( ) ; info ! ( " " proof pretty_print ( ) hasher pretty_print ( ) sector_size pretty_print ( ) head ) ; let start_total = Instant :: now ( ) ; let dt_create_circuit : u64 ; let dt_create_params : u64 ; let params = match ( proof , hasher ) { ( Proof :: Sdr , Hasher :: Poseidon ) => { let start = Instant :: now ( ) ; let public_params = blank_sdr_poseidon_params ( sector_size . as_u64 ( ) ) ; let circuit = < StackedCompound < Tree , Sha256Hasher > as CompoundProof < StackedDrg < Tree , Sha256Hasher > , _ , > > :: blank_circuit ( & public_params ) ; dt_create_circuit = start . elapsed ( ) . as_secs ( ) ; let start = Instant :: now ( ) ; let params = MPCParameters :: new ( circuit ) . expect ( " " ) ; dt_create_params = start . elapsed ( ) . as_secs ( ) ; params } ( Proof :: Winning , Hasher :: Poseidon ) => { let start = Instant :: now ( ) ; let public_params = blank_winning_post_poseidon_params :: < Tree > ( sector_size . as_u64 ( ) ) ; let circuit = < FallbackPoStCompound < Tree > as CompoundProof < FallbackPoSt < Tree > , FallbackPoStCircuit < Tree > , > > :: blank_circuit ( & public_params ) ; dt_create_circuit = start . elapsed ( ) . as_secs ( ) ; let start = Instant :: now ( ) ; let params = MPCParameters :: new ( circuit ) . expect ( " " ) ; dt_create_params = start . elapsed ( ) . as_secs ( ) ; params } ( Proof :: Window , Hasher :: Poseidon ) => { let start = Instant :: now ( ) ; let public_params = blank_window_post_poseidon_params :: < Tree > ( sector_size . as_u64 ( ) ) ; let circuit = < FallbackPoStCompound < Tree > as CompoundProof < FallbackPoSt < Tree > , FallbackPoStCircuit < Tree > , > > :: blank_circuit ( & public_params ) ; dt_create_circuit = start . elapsed ( ) . as_secs ( ) ; let start = Instant :: now ( ) ; let params = MPCParameters :: new ( circuit ) . expect ( " " ) ; dt_create_params = start . elapsed ( ) . as_secs ( ) ; params } } ; info ! ( " " dt_create_circuit dt_create_params ) ; let large_path = params_filename ( proof , hasher , sector_size , & head , 0 , ParamSize :: Large , false , ) ; { info ! ( " " large_path ) ; let file = File :: create ( & large_path ) . expect ( " " ) ; let mut writer = BufWriter :: with_capacity ( 1024 * 1024 , file ) ; params . write ( & mut writer ) . expect ( " " ) ; info ! ( " " ) ; } // TODO: add conversion from large to small params to phase2 crate, then write initial params as // small-raw. /*
    let small_path = params_filename(proof, hasher, sector_size, &head, 0, ParamSize::Small, true);
    {
        info!("writing small initial params to file: {}", small_path);
        let file = File::create(&small_path).unwrap();
        let mut writer = BufWriter::with_capacity(1024 * 1024, file);
        params.write_small(&mut writer).unwrap();
        info!("finished writing small params to file");
    }
    */ info ! ( " " proof pretty_print ( ) hasher pretty_print ( ) sector_size pretty_print ( ) head start_total elapsed ( ) as_secs ( ) ) ; }
Creates the first phase2 parameters for a circuit and writes them to a file.
Creates the first phase2 parameters for a circuit and writes them to a file .
proof
Proof
hasher
Hasher
sector_size
Sector
proof
Proof
hasher
Hasher
sector_size
Sector