Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: remove artificial requirement that config sector count be 1 #1283

Merged
merged 1 commit into from
Sep 18, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions filecoin-proofs/src/api/post.rs
Original file line number Diff line number Diff line change
Expand Up @@ -537,17 +537,7 @@ pub fn generate_single_vanilla_proof<Tree: 'static + MerkleTreeTrait>(
let comm_c = replica.safe_comm_c();
let comm_r_last = replica.safe_comm_r_last();

// There is only enough information in the arguments to generate a
// single vanilla proof, so the behaviour is unexpected if the
// sector_count provided is > 1.
let sector_count = post_config.sector_count;
ensure!(
post_config.sector_count == 1,
"invalid post config sector size ({} required)",
sector_count
);

let mut priv_sectors = Vec::with_capacity(sector_count);
let mut priv_sectors = Vec::with_capacity(1);
priv_sectors.push(fallback::PrivateSector {
tree,
comm_c,
Expand Down
17 changes: 2 additions & 15 deletions filecoin-proofs/tests/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -387,25 +387,12 @@ fn window_post<Tree: 'static + MerkleTreeTrait>(
prover_id,
)?;

// This 'single config' is used when generating a single vanilla proof.
let single_config = PoStConfig {
sector_size: sector_size.into(),
sector_count: 1,
challenge_count: WINDOW_POST_CHALLENGE_COUNT,
typ: PoStType::Window,
priority: false,
};

let mut vanilla_proofs = Vec::with_capacity(replica_sectors.len());

for (sector_id, replica) in priv_replicas.iter() {
let sector_challenges = &challenges[sector_id];
let single_proof = generate_single_vanilla_proof::<Tree>(
&single_config,
*sector_id,
replica,
sector_challenges,
)?;
let single_proof =
generate_single_vanilla_proof::<Tree>(&config, *sector_id, replica, sector_challenges)?;

vanilla_proofs.push(single_proof);
}
Expand Down