Skip to content

Commit 389b197

Browse files
committed
feat(api)!: remove unused sectorSize from cache functions
BREAKING CHANGE: ClearCache and ClearSyntheticProofs no longer accept sectorSize parameter.
1 parent a823243 commit 389b197

3 files changed

Lines changed: 6 additions & 19 deletions

File tree

cgo/proofs.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,17 +322,15 @@ func GetNumPartitionForFallbackPost(registeredProof RegisteredPoStProof, numSect
322322
return uint(resp.value), nil
323323
}
324324

325-
func ClearCache(sectorSize uint64, cacheDirPath SliceRefUint8) error {
325+
func ClearCache(cacheDirPath SliceRefUint8) error {
326326
resp := (*resultVoid)(C.clear_cache(
327-
C.uint64_t(sectorSize),
328327
(C.slice_ref_uint8_t)(cacheDirPath)))
329328
defer resp.destroy()
330329
return CheckErr(resp)
331330
}
332331

333-
func ClearSyntheticProofs(sectorSize uint64, cacheDirPath SliceRefUint8) error {
332+
func ClearSyntheticProofs(cacheDirPath SliceRefUint8) error {
334333
resp := (*resultVoid)(C.clear_synthetic_proofs(
335-
C.uint64_t(sectorSize),
336334
(C.slice_ref_uint8_t)(cacheDirPath)))
337335
defer resp.destroy()
338336
return CheckErr(resp)

proofs.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -664,13 +664,13 @@ func GetNumPartitionForFallbackPost(proofType abi.RegisteredPoStProof, numSector
664664
}
665665

666666
// ClearCache
667-
func ClearCache(sectorSize uint64, cacheDirPath string) error {
668-
return cgo.ClearCache(sectorSize, cgo.AsSliceRefUint8([]byte(cacheDirPath)))
667+
func ClearCache(cacheDirPath string) error {
668+
return cgo.ClearCache(cgo.AsSliceRefUint8([]byte(cacheDirPath)))
669669
}
670670

671671
// ClearSyntheticProofs
672-
func ClearSyntheticProofs(sectorSize uint64, cacheDirPath string) error {
673-
return cgo.ClearSyntheticProofs(sectorSize, cgo.AsSliceRefUint8([]byte(cacheDirPath)))
672+
func ClearSyntheticProofs(cacheDirPath string) error {
673+
return cgo.ClearSyntheticProofs(cgo.AsSliceRefUint8([]byte(cacheDirPath)))
674674
}
675675

676676
func GenerateSynthProofs(

rust/src/proofs/api.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,6 @@ fn generate_data_commitment(
12211221

12221222
#[ffi_export]
12231223
fn clear_cache(
1224-
_sector_size: u64,
12251224
cache_dir_path: c_slice::Ref<'_, u8>,
12261225
) -> repr_c::Box<ClearCacheResponse> {
12271226
catch_panic_response("clear_cache", || {
@@ -1231,7 +1230,6 @@ fn clear_cache(
12311230

12321231
#[ffi_export]
12331232
fn clear_synthetic_proofs(
1234-
_sector_size: u64,
12351233
cache_dir_path: c_slice::Ref<'_, u8>,
12361234
) -> repr_c::Box<ClearCacheResponse> {
12371235
catch_panic_response("clear_synthetic_proofs", || {
@@ -1871,9 +1869,6 @@ pub mod tests {
18711869
destroy_generate_synth_proofs_response(resp_p1);
18721870

18731871
let resp_clear = clear_cache(
1874-
api::RegisteredSealProof::from(registered_proof_seal)
1875-
.sector_size()
1876-
.0,
18771872
cache_dir_path_ref.into(),
18781873
);
18791874
if resp_clear.status_code != FCPResponseStatus::NoError {
@@ -1900,9 +1895,6 @@ pub mod tests {
19001895
if registered_proof_seal == RegisteredSealProof::StackedDrg2KiBV1_1_Feat_SyntheticPoRep
19011896
{
19021897
let resp_clear = clear_synthetic_proofs(
1903-
api::RegisteredSealProof::from(registered_proof_seal)
1904-
.sector_size()
1905-
.0,
19061898
cache_dir_path_ref.into(),
19071899
);
19081900
if resp_clear.status_code != FCPResponseStatus::NoError {
@@ -2230,9 +2222,6 @@ pub mod tests {
22302222
}
22312223

22322224
let resp_clear = clear_cache(
2233-
api::RegisteredSealProof::from(registered_proof_seal)
2234-
.sector_size()
2235-
.0,
22362225
cache_dir_path_ref.into(),
22372226
);
22382227
if resp_clear.status_code != FCPResponseStatus::NoError {

0 commit comments

Comments
 (0)