-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: minimal changes to fix the open 'grindability issue'
Some more details here: #1270
- Loading branch information
1 parent
1680ad0
commit 845d2e1
Showing
9 changed files
with
118 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
mod circuit; | ||
mod compound; | ||
mod utils; | ||
mod vanilla; | ||
|
||
pub use circuit::*; | ||
pub use compound::*; | ||
pub use utils::*; | ||
pub use vanilla::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use storage_proofs_core::api_version::ApiVersion; | ||
|
||
/// Selects the challenge index used to determine the leaf challenge for PoSt | ||
pub fn get_challenge_index( | ||
api_version: ApiVersion, | ||
sector: usize, | ||
sector_chunk_index: usize, | ||
num_sectors_per_chunk: usize, | ||
challenge_count: usize, | ||
challenge_index: usize, | ||
) -> u64 { | ||
(match api_version { | ||
ApiVersion::V1_2_0 => challenge_index, | ||
_ => { | ||
(sector * num_sectors_per_chunk + sector_chunk_index) * challenge_count | ||
+ challenge_index | ||
} | ||
} as u64) | ||
} |
Oops, something went wrong.