diff --git a/Cargo.toml b/Cargo.toml index 4203da10..f0d9b568 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" } +fr32 = { git = "https://github.com/filecoin-project/rust-fil-proofs" } +filecoin-hashers = { git = "https://github.com/filecoin-project/rust-fil-proofs" } +storage-proofs-core = { git = "https://github.com/filecoin-project/rust-fil-proofs" } diff --git a/rust-toolchain b/rust-toolchain index 832e9afb..6b4de0a4 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.70.0 +1.83.0 diff --git a/src/registry.rs b/src/registry.rs index cb1789a0..24b0c497 100644 --- a/src/registry.rs +++ b/src/registry.rs @@ -982,6 +982,8 @@ mod tests { } fn test_porep_id_aux(rsp: &RegisteredSealProof) { + use std::fmt::Write; + let expected_porep_id = match rsp { RegisteredSealProof::StackedDrg2KiBV1 => { "0000000000000000000000000000000000000000000000000000000000000000" @@ -1044,11 +1046,10 @@ mod tests { "1300000000000000000000000000000000000000000000000000000000000000" } }; - let hex: String = rsp - .porep_id() - .iter() - .map(|x| format!("{:01$x}", x, 2)) - .collect(); + let hex: String = rsp.porep_id().iter().fold(String::new(), |mut output, x| { + let _ = write!(output, "{:01$x}", x, 2); + output + }); assert_eq!(expected_porep_id, &hex); } diff --git a/src/seal.rs b/src/seal.rs index 9b59c66f..ea3e9a70 100644 --- a/src/seal.rs +++ b/src/seal.rs @@ -330,16 +330,13 @@ pub struct SealCommitPhase2Output { pub proof: Vec, } -/// 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`]. @@ -424,12 +421,9 @@ fn generate_synth_proofs_inner( /// /// # 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`]. @@ -1793,7 +1787,7 @@ pub fn unseal_range + AsRef, R: Read, W: Write>( /// /// * `registered_proof` - Selected seal proof for this byte source. /// * `source` - A readable source of unprocessed piece bytes. The piece's commitment will be -/// generated for the bytes read from the source plus any added padding. +/// generated for the bytes read from the source plus any added padding. /// * `piece_size` - The number of unpadded user-bytes which can be read from source before EOF. /// /// Returns piece commitment in [`PieceInfo`] struct.