filecoin-project / rust-fil-proofs

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

feat: add fallback option if no t_aux file exists #1715

Closed vmx closed 1 year ago

vmx commented 1 year ago

The only information from the t_aux file that is used during Commitphase 1 (C1) is the number of rows that are discarded from TreeC. If that value is either the default, or set via FIL_PROOFS_ROWS_TO_DISCARD accordingly, then all other parts of t_aux can be inferred from the function call.

When FIL_PROOFS_T_AUX_IMPLICIT_FALLBACK=1 is set, then those inferred values will be used, in case the t_aux file cannot be read or doesn't exist.

vmx commented 1 year ago

I thought about this again. Would it help that we make it clear in the README that you're on your own if you set the FIL_PROOFS_T_AUX_IMPLICIT_FALLBACK env variable? When you use the code in the current stack and there is a t_aux, nothing changes, it will also error if there is none.

If you don't have a t_aux and set FIL_PROOFS_T_AUX_IMPLICIT_FALLBACK, then it uses the default value, which is either the hard-coded one, or the one you can set dynamically via FIL_PROOFS_ROWS_TO_DISCARD. So even in case someone has set FIL_PROOFS_ROWS_TO_DISCARD to a custom value, I'd expect it to be set all the time. This means that even if then t_aux would be deleted FIL_PROOFS_T_AUX_IMPLICIT_FALLBACK would be set, it would still return the correct result.

vmx commented 1 year ago

Superseded by https://github.com/filecoin-project/rust-fil-proofs/pull/1717.