diff --git a/filecoin-proofs/src/api/post_util.rs b/filecoin-proofs/src/api/post_util.rs index 1c76fd96e5..8013fb6152 100644 --- a/filecoin-proofs/src/api/post_util.rs +++ b/filecoin-proofs/src/api/post_util.rs @@ -7,9 +7,9 @@ use bincode::deserialize; use filecoin_hashers::Hasher; use log::{info, trace}; use storage_proofs_core::{ - cache_key::CacheKey, merkle::MerkleTreeTrait, proof::ProofScheme, sector::SectorId, + cache_key::CacheKey, merkle::MerkleTreeTrait, sector::SectorId, }; -use storage_proofs_post::fallback::{self, generate_leaf_challenge, FallbackPoSt, SectorProof}; +use storage_proofs_post::fallback::{self, generate_leaf_challenge, SectorProof}; use crate::{ api::as_safe_commitment, @@ -288,10 +288,11 @@ pub fn partition_vanilla_proofs( info!("partition_vanilla_proofs:finish"); - ensure!( - FallbackPoSt::::verify_all_partitions(pub_params, pub_inputs, &partition_proofs)?, - "partitioned vanilla proofs failed to verify" - ); + /* After splitting partitions, all partitions cannot be checked */ + // ensure!( + // FallbackPoSt::::verify_all_partitions(pub_params, pub_inputs, &partition_proofs)?, + // "partitioned vanilla proofs failed to verify" + // ); Ok(partition_proofs) } @@ -308,3 +309,17 @@ pub(crate) fn get_partitions_for_window_post( None } } + +pub fn get_post_vanilla_params( + post_config: &PoStConfig, +) -> Result { + use storage_proofs_core::compound_proof::PubVanRsp; + + let rsp = PubVanRsp { + challengecount: post_config.challenge_count, + sectorcount: post_config.sector_count, + }; + let rs = serde_json::to_string(&rsp)?; + + Ok(rs) +} diff --git a/storage-proofs-core/src/compound_proof.rs b/storage-proofs-core/src/compound_proof.rs index 6532a835fb..4823a74360 100644 --- a/storage-proofs-core/src/compound_proof.rs +++ b/storage-proofs-core/src/compound_proof.rs @@ -16,6 +16,7 @@ use rand::{rngs::OsRng, RngCore}; use rayon::prelude::{ IndexedParallelIterator, IntoParallelIterator, IntoParallelRefIterator, ParallelIterator, }; +use serde::{Deserialize, Serialize}; use crate::{ error::Result, @@ -497,3 +498,9 @@ where Ok(res) } } + +#[derive(Serialize, Deserialize)] +pub struct PubVanRsp { + pub challengecount: usize, + pub sectorcount: usize, +}