From 8c82df7abd77323644a004d8015f241c99e71bdf Mon Sep 17 00:00:00 2001 From: nemo Date: Wed, 25 Sep 2024 11:49:32 -0400 Subject: [PATCH] feat: only test snarkpack v2 in api version 1.2.x fix: apply review feedback --- filecoin-proofs/tests/api.rs | 14 ++++++++++---- storage-proofs-porep/tests/common.rs | 4 +++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/filecoin-proofs/tests/api.rs b/filecoin-proofs/tests/api.rs index 417aacbce..0661bd730 100644 --- a/filecoin-proofs/tests/api.rs +++ b/filecoin-proofs/tests/api.rs @@ -943,10 +943,16 @@ fn aggregate_seal_proofs( let mut prover_id = [0u8; 32]; prover_id.copy_from_slice(AsRef::<[u8]>::as_ref(&prover_fr)); - let aggregate_versions = vec![ - groth16::aggregate::AggregateVersion::V1, - groth16::aggregate::AggregateVersion::V2, - ]; + // Note that ApiVersion 1.2.0 only supports SnarkPack v2, so only + // allow that testing here. + let aggregate_versions = match porep_config.api_version { + ApiVersion::V1_2_0 => vec![groth16::aggregate::AggregateVersion::V2], + ApiVersion::V1_1_0 => vec![ + groth16::aggregate::AggregateVersion::V1, + groth16::aggregate::AggregateVersion::V2, + ], + ApiVersion::V1_0_0 => vec![groth16::aggregate::AggregateVersion::V1], + }; info!( "Aggregating {} seal proof with ApiVersion {}, Features {:?}, and PoRep ID {:?}", num_proofs_to_aggregate, diff --git a/storage-proofs-porep/tests/common.rs b/storage-proofs-porep/tests/common.rs index 94e04d9c6..eb37f7948 100644 --- a/storage-proofs-porep/tests/common.rs +++ b/storage-proofs-porep/tests/common.rs @@ -13,7 +13,9 @@ use storage_proofs_porep::stacked::{PersistentAux, PublicParams, StackedDrg, Tau // This method should ONLY be used in purposed test code. #[allow(dead_code)] -pub fn remove_replica_and_tree_r(cache_path: &Path) -> Result<()> { +pub(crate) fn remove_replica_and_tree_r( + cache_path: &Path, +) -> Result<()> { let replica_path = cache_path.join("replica-path"); let tree_r_last_config = StoreConfig { path: cache_path.to_path_buf(),