From f75af0059c608ab6e06dc2d6e7de7b7b1183a47f Mon Sep 17 00:00:00 2001 From: gegezai Date: Fri, 27 Aug 2021 14:33:14 +0800 Subject: [PATCH] * init decoupling-post-worker code --- filecoin-proofs/src/api/post_util.rs | 23 +++++++++++++++++++---- storage-proofs-core/src/compound_proof.rs | 7 +++++++ 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/filecoin-proofs/src/api/post_util.rs b/filecoin-proofs/src/api/post_util.rs index 1c76fd96e5..e2e7eefce9 100644 --- a/filecoin-proofs/src/api/post_util.rs +++ b/filecoin-proofs/src/api/post_util.rs @@ -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..325fd5044a 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, +} \ No newline at end of file