Skip to content

Commit

Permalink
chore: porep_partitions -> from_sector_size
Browse files Browse the repository at this point in the history
  • Loading branch information
hanbu97 committed Nov 16, 2022
1 parent e737c60 commit 4fe5187
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions fil-proofs-tooling/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ impl GitMetadata {
let repo = Repository::discover(&repo_path)?;
let head = repo.head()?;
let commit = head.peel_to_commit()?;
#[allow(deprecated)]
let date = Utc.timestamp(commit.time().seconds(), 0);

Ok(GitMetadata {
Expand Down
4 changes: 2 additions & 2 deletions filecoin-proofs/src/api/seal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ pub fn verify_seal<Tree: 'static + MerkleTreeTrait>(
&proof,
&ChallengeRequirements {
minimum_challenges: POREP_MINIMUM_CHALLENGES
.porep_partitions(u64::from(SectorSize::from(porep_config))),
.from_sector_size(u64::from(SectorSize::from(porep_config))),
},
)
};
Expand Down Expand Up @@ -1110,7 +1110,7 @@ pub fn verify_batch_seal<Tree: 'static + MerkleTreeTrait>(
&proofs,
&ChallengeRequirements {
minimum_challenges: POREP_MINIMUM_CHALLENGES
.porep_partitions(u64::from(SectorSize::from(porep_config))),
.from_sector_size(u64::from(SectorSize::from(porep_config))),
},
)
.map_err(Into::into);
Expand Down
2 changes: 1 addition & 1 deletion filecoin-proofs/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl PorepMinimumChallenges {
self.0.write().expect("POREP_MINIMUM_CHALLENGES poisoned")
}

pub fn porep_partitions(&self, sector_size: u64) -> usize {
pub fn from_sector_size(&self, sector_size: u64) -> usize {
match self
.0
.read()
Expand Down
2 changes: 1 addition & 1 deletion filecoin-proofs/src/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub fn setup_params(
) -> Result<stacked::SetupParams> {
let layer_challenges = select_challenges(
partitions,
POREP_MINIMUM_CHALLENGES.porep_partitions(u64::from(sector_bytes)),
POREP_MINIMUM_CHALLENGES.from_sector_size(u64::from(sector_bytes)),
*LAYERS
.read()
.expect("LAYERS poisoned")
Expand Down

0 comments on commit 4fe5187

Please sign in to comment.