Skip to content

Commit 5c0b466

Browse files
committed
fix: update cache clearing calls
Adapt to the changes in rust-fil-proofs. BREAKING CHANGE: `clear_cache()` and `clear_synthetic_proofs` no longer take the sector size as input.
1 parent 0b5325e commit 5c0b466

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,9 @@ big-tests = []
2828
# This feature enables a fixed number of discarded rows for TreeR. The `FIL_PROOFS_ROWS_TO_DISCARD`
2929
# setting is ignored, no `TemporaryAux` file will be written.
3030
fixed-rows-to-discard = ["filecoin-proofs-v1/fixed-rows-to-discard", "storage-proofs-core/fixed-rows-to-discard"]
31+
32+
[patch.crates-io]
33+
filecoin-proofs = { git = "https://github.com/filecoin-project/rust-fil-proofs", branch = "clear-api-cleanup" }
34+
fr32 = { git = "https://github.com/filecoin-project/rust-fil-proofs", branch = "clear-api-cleanup" }
35+
filecoin-hashers = { git = "https://github.com/filecoin-project/rust-fil-proofs", branch = "clear-api-cleanup" }
36+
storage-proofs-core = { git = "https://github.com/filecoin-project/rust-fil-proofs", branch = "clear-api-cleanup" }

src/seal.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -330,16 +330,13 @@ pub struct SealCommitPhase2Output {
330330
pub proof: Vec<u8>,
331331
}
332332

333-
/// Ensure that any persisted cached data for specified sector size is discarded.
333+
/// Ensure that any persisted cached data is discarded.
334334
///
335335
/// # Arguments
336336
///
337-
/// * `sector_size` - Sector size associated with cache data to clear.
338337
/// * `cache_path` - Path to directory where cached data is stored.
339-
pub fn clear_cache(sector_size: u64, cache_path: &Path) -> Result<()> {
340-
use filecoin_proofs_v1::clear_cache;
341-
342-
with_shape!(sector_size, clear_cache, cache_path)
338+
pub fn clear_cache(cache_path: &Path) -> Result<()> {
339+
filecoin_proofs_v1::clear_cache(cache_path)
343340
}
344341

345342
/// Generate and persist synthetic Merkle tree proofs for sector replica. Must be called with output from [`seal_pre_commit_phase2`].
@@ -424,12 +421,9 @@ fn generate_synth_proofs_inner<Tree: 'static + MerkleTreeTrait>(
424421
///
425422
/// # Arguments
426423
///
427-
/// * `sector_size` - Sector size associated with cache data to clear.
428424
/// * `cache_path` - Path to directory where cached data is stored.
429-
pub fn clear_synthetic_proofs(sector_size: u64, cache_path: &Path) -> Result<()> {
430-
use filecoin_proofs_v1::clear_synthetic_proofs;
431-
432-
with_shape!(sector_size, clear_synthetic_proofs, cache_path)
425+
pub fn clear_synthetic_proofs(cache_path: &Path) -> Result<()> {
426+
filecoin_proofs_v1::clear_synthetic_proofs(cache_path)
433427
}
434428

435429
/// First step in sector sealing process. Called before [`seal_pre_commit_phase2`].

0 commit comments

Comments
 (0)