Skip to content

Commit 4f55a65

Browse files
authored
fix: remove ClearLayerData call (#436)
The `ClearLayerData` FFI call was accidentally introduced with the Synthetic PoRep. The call does under the hood exactly what `ClearCache` is doing. It was already removed from Lotus in [PR 11352], so that we can remove it here as well (and as a next steps from the Rust side). This reduces the API surface, which is generally a good idea. [PR 11352]: filecoin-project/lotus#11352
1 parent 821be36 commit 4f55a65

File tree

3 files changed

+2
-21
lines changed

3 files changed

+2
-21
lines changed

cgo/proofs.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,6 @@ func ClearSyntheticProofs(sectorSize uint64, cacheDirPath SliceRefUint8) error {
229229
defer resp.destroy()
230230
return CheckErr(resp)
231231
}
232-
func ClearLayerData(sectorSize uint64, cacheDirPath SliceRefUint8) error {
233-
resp := C.clear_layer_data(C.uint64_t(sectorSize), cacheDirPath)
234-
defer resp.destroy()
235-
return CheckErr(resp)
236-
}
237232

238233
func GenerateSynthProofs(
239234
registered_proof RegisteredSealProof,

proofs.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -666,10 +666,6 @@ func ClearSyntheticProofs(sectorSize uint64, cacheDirPath string) error {
666666
return cgo.ClearSyntheticProofs(sectorSize, cgo.AsSliceRefUint8([]byte(cacheDirPath)))
667667
}
668668

669-
func ClearLayerData(sectorSize abi.SectorSize, cacheDirPath string) error {
670-
return cgo.ClearLayerData(uint64(sectorSize), cgo.AsSliceRefUint8([]byte(cacheDirPath)))
671-
}
672-
673669
func GenerateSynthProofs(
674670
proofType abi.RegisteredSealProof,
675671
sealedCID, unsealedCID cid.Cid,

rust/src/proofs/api.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1210,16 +1210,6 @@ fn clear_synthetic_proofs(
12101210
})
12111211
}
12121212

1213-
#[ffi_export]
1214-
fn clear_layer_data(
1215-
sector_size: u64,
1216-
cache_dir_path: c_slice::Ref<u8>,
1217-
) -> repr_c::Box<ClearCacheResponse> {
1218-
catch_panic_response("clear_layer_data", || {
1219-
seal::clear_layer_data(sector_size, &as_path_buf(&cache_dir_path)?)
1220-
})
1221-
}
1222-
12231213
/// Returns the number of user bytes that will fit into a staged sector.
12241214
#[ffi_export]
12251215
fn get_max_user_bytes_per_staged_sector(registered_proof: RegisteredSealProof) -> u64 {
@@ -1846,15 +1836,15 @@ pub mod tests {
18461836

18471837
destroy_generate_synth_proofs_response(resp_p1);
18481838

1849-
let resp_clear = clear_layer_data(
1839+
let resp_clear = clear_cache(
18501840
api::RegisteredSealProof::from(registered_proof_seal)
18511841
.sector_size()
18521842
.0,
18531843
cache_dir_path_ref.into(),
18541844
);
18551845
if resp_clear.status_code != FCPResponseStatus::NoError {
18561846
let msg = str::from_utf8(&resp_clear.error_msg).unwrap();
1857-
panic!("clear_layer_data failed: {:?}", msg);
1847+
panic!("clear_cache failed: {:?}", msg);
18581848
}
18591849
destroy_clear_cache_response(resp_clear);
18601850
}

0 commit comments

Comments
 (0)