Skip to content

Commit 605d6aa

Browse files
committed
feat: add a special case for MacOS verification
1 parent 8976839 commit 605d6aa

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

filecoin-proofs/tests/regression.rs

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,80 @@ pub(crate) fn load_regression_records(records: &Path) -> Result<Vec<SealRegressi
108108
Ok(records)
109109
}
110110

111+
// On MacOS, we only verify production parameter sizes and published test sector sizes
112+
#[cfg(target_os = "macos")]
113+
pub(crate) fn regression_verify_seal_proof(record: &SealRegressionRecord) -> Result<bool> {
114+
let r = record;
115+
116+
let sector_size: u64 = r.porep_config.sector_size.into();
117+
let verified = match sector_size {
118+
SECTOR_SIZE_2_KIB => verify_seal::<SectorShape2KiB>(
119+
&r.porep_config,
120+
r.comm_r,
121+
r.comm_d,
122+
r.prover_id,
123+
r.sector_id,
124+
r.ticket,
125+
r.seed,
126+
&r.proof,
127+
),
128+
SECTOR_SIZE_4_KIB | SECTOR_SIZE_16_KIB | SECTOR_SIZE_32_KIB => true,
129+
SECTOR_SIZE_8_MIB => verify_seal::<SectorShape8MiB>(
130+
&r.porep_config,
131+
r.comm_r,
132+
r.comm_d,
133+
r.prover_id,
134+
r.sector_id,
135+
r.ticket,
136+
r.seed,
137+
&r.proof,
138+
),
139+
SECTOR_SIZE_512_MIB => verify_seal::<SectorShape512MiB>(
140+
&r.porep_config,
141+
r.comm_r,
142+
r.comm_d,
143+
r.prover_id,
144+
r.sector_id,
145+
r.ticket,
146+
r.seed,
147+
&r.proof,
148+
),
149+
SECTOR_SIZE_1_GIB => true,
150+
SECTOR_SIZE_32_GIB => verify_seal::<SectorShape32GiB>(
151+
&r.porep_config,
152+
r.comm_r,
153+
r.comm_d,
154+
r.prover_id,
155+
r.sector_id,
156+
r.ticket,
157+
r.seed,
158+
&r.proof,
159+
),
160+
SECTOR_SIZE_64_GIB => verify_seal::<SectorShape64GiB>(
161+
&r.porep_config,
162+
r.comm_r,
163+
r.comm_d,
164+
r.prover_id,
165+
r.sector_id,
166+
r.ticket,
167+
r.seed,
168+
&r.proof,
169+
),
170+
_ => {
171+
error!(
172+
"Cannot verify proof: Unsupported sector size [{}]",
173+
sector_size
174+
);
175+
Ok(false)
176+
}
177+
}?;
178+
179+
Ok(verified)
180+
}
181+
111182
#[allow(non_snake_case)]
112183
#[allow(unused_variables)]
184+
#[cfg(not(target_os = "macos"))]
113185
pub(crate) fn regression_verify_seal_proof(record: &SealRegressionRecord) -> Result<bool> {
114186
let r = record;
115187

0 commit comments

Comments
 (0)