filecoin-project / rust-fil-proofs

Proofs for Filecoin in Rust
Other
491 stars 314 forks source link

refactor: better select challenges function #1731

Closed vmx closed 11 months ago

vmx commented 1 year ago

The function to select the challenges changes a lot over time and now is hardly comprehensible. Hence it's refacored into a more understandable version. It uses a div_ceil function which is expecte to be included in the Rust standard library at some point in the future.

vmx commented 1 year ago

Just FYI if you're interested, I believe challenges_count_all is a leftover from when PoRep's design included a specific number of challenges per layer (and challenges_count_all meant the "total number of challenges across all layers per partition"). And a potential future refactor that I would also support is renaming challenges_count_all to something like partition_challenge_count.

Exactly! I tackle that in a later commit on the ni-porep work: https://github.com/filecoin-project/rust-fil-proofs/pull/1734/commits/d2505cb15fd3c83192caff3ca569b66767394812.