From 605d6aa2888fee1db4e78a60ee134af13b3fe1a7 Mon Sep 17 00:00:00 2001 From: nemo Date: Fri, 4 Oct 2024 09:03:12 -0400 Subject: [PATCH] feat: add a special case for MacOS verification --- filecoin-proofs/tests/regression.rs | 72 +++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/filecoin-proofs/tests/regression.rs b/filecoin-proofs/tests/regression.rs index 11a79c6f5..16211d09c 100644 --- a/filecoin-proofs/tests/regression.rs +++ b/filecoin-proofs/tests/regression.rs @@ -108,8 +108,80 @@ pub(crate) fn load_regression_records(records: &Path) -> Result Result { + let r = record; + + let sector_size: u64 = r.porep_config.sector_size.into(); + let verified = match sector_size { + SECTOR_SIZE_2_KIB => verify_seal::( + &r.porep_config, + r.comm_r, + r.comm_d, + r.prover_id, + r.sector_id, + r.ticket, + r.seed, + &r.proof, + ), + SECTOR_SIZE_4_KIB | SECTOR_SIZE_16_KIB | SECTOR_SIZE_32_KIB => true, + SECTOR_SIZE_8_MIB => verify_seal::( + &r.porep_config, + r.comm_r, + r.comm_d, + r.prover_id, + r.sector_id, + r.ticket, + r.seed, + &r.proof, + ), + SECTOR_SIZE_512_MIB => verify_seal::( + &r.porep_config, + r.comm_r, + r.comm_d, + r.prover_id, + r.sector_id, + r.ticket, + r.seed, + &r.proof, + ), + SECTOR_SIZE_1_GIB => true, + SECTOR_SIZE_32_GIB => verify_seal::( + &r.porep_config, + r.comm_r, + r.comm_d, + r.prover_id, + r.sector_id, + r.ticket, + r.seed, + &r.proof, + ), + SECTOR_SIZE_64_GIB => verify_seal::( + &r.porep_config, + r.comm_r, + r.comm_d, + r.prover_id, + r.sector_id, + r.ticket, + r.seed, + &r.proof, + ), + _ => { + error!( + "Cannot verify proof: Unsupported sector size [{}]", + sector_size + ); + Ok(false) + } + }?; + + Ok(verified) +} + #[allow(non_snake_case)] #[allow(unused_variables)] +#[cfg(not(target_os = "macos"))] pub(crate) fn regression_verify_seal_proof(record: &SealRegressionRecord) -> Result { let r = record;