Skip to content

Commit

Permalink
fix: update cache clearing calls
Browse files Browse the repository at this point in the history
Adapt to the changes in rust-fil-proofs.

BREAKING CHANGE: `clear_cache()` and `clear_synthetic_proofs` no longer
take the sector size as input.
  • Loading branch information
vmx committed Jan 8, 2025
1 parent 0b5325e commit 5c0b466
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ big-tests = []
# This feature enables a fixed number of discarded rows for TreeR. The `FIL_PROOFS_ROWS_TO_DISCARD`
# setting is ignored, no `TemporaryAux` file will be written.
fixed-rows-to-discard = ["filecoin-proofs-v1/fixed-rows-to-discard", "storage-proofs-core/fixed-rows-to-discard"]

[patch.crates-io]
filecoin-proofs = { git = "https://github.com/filecoin-project/rust-fil-proofs", branch = "clear-api-cleanup" }
fr32 = { git = "https://github.com/filecoin-project/rust-fil-proofs", branch = "clear-api-cleanup" }
filecoin-hashers = { git = "https://github.com/filecoin-project/rust-fil-proofs", branch = "clear-api-cleanup" }
storage-proofs-core = { git = "https://github.com/filecoin-project/rust-fil-proofs", branch = "clear-api-cleanup" }
16 changes: 5 additions & 11 deletions src/seal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,16 +330,13 @@ pub struct SealCommitPhase2Output {
pub proof: Vec<u8>,
}

/// Ensure that any persisted cached data for specified sector size is discarded.
/// Ensure that any persisted cached data is discarded.
///
/// # Arguments
///
/// * `sector_size` - Sector size associated with cache data to clear.
/// * `cache_path` - Path to directory where cached data is stored.
pub fn clear_cache(sector_size: u64, cache_path: &Path) -> Result<()> {
use filecoin_proofs_v1::clear_cache;

with_shape!(sector_size, clear_cache, cache_path)
pub fn clear_cache(cache_path: &Path) -> Result<()> {
filecoin_proofs_v1::clear_cache(cache_path)
}

/// Generate and persist synthetic Merkle tree proofs for sector replica. Must be called with output from [`seal_pre_commit_phase2`].
Expand Down Expand Up @@ -424,12 +421,9 @@ fn generate_synth_proofs_inner<Tree: 'static + MerkleTreeTrait>(
///
/// # Arguments
///
/// * `sector_size` - Sector size associated with cache data to clear.
/// * `cache_path` - Path to directory where cached data is stored.
pub fn clear_synthetic_proofs(sector_size: u64, cache_path: &Path) -> Result<()> {
use filecoin_proofs_v1::clear_synthetic_proofs;

with_shape!(sector_size, clear_synthetic_proofs, cache_path)
pub fn clear_synthetic_proofs(cache_path: &Path) -> Result<()> {
filecoin_proofs_v1::clear_synthetic_proofs(cache_path)
}

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

0 comments on commit 5c0b466

Please sign in to comment.