Skip to content

Commit

Permalink
feat: add option to not require a t_aux file to be present
Browse files Browse the repository at this point in the history
The `FFI_USE_FIXED_ROWS_TO_DISCARD` variable will make the proofs
ignore the `FIL_PROOFS_ROWS_TO_DISCARD` setting, hence not relying
on a `t_aux` file to be present. If enabled, then no `t_aux` file
will be written by the proofs and a hard-coded value for
`FIL_PROOFS_ROWS_TO_DISCARD` will be used.
  • Loading branch information
vmx committed Nov 3, 2023
1 parent 821be36 commit aecf491
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 25 deletions.
12 changes: 10 additions & 2 deletions install-filcrypto
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,19 @@ build_from_source() {
use_multicore_sdr=""
fi

# By default the number or rows to discard of the TreeRLast can be set via
# `FIL_PROOFS_ROWS_TO_DISCARD`. When SupraSeal PC2 is used, then this
# number is fixed.
use_fixed_rows_to_discard=""
if [ "${FFI_USE_FIXED_ROWS_TO_DISCARD}" == "1" ]; then
use_fixed_rows_to_discard=",fixed-rows-to-discard"
fi

# Add feature specific rust flags as needed here.
if [ "${FFI_USE_BLST_PORTABLE}" == "1" ]; then
additional_flags="${additional_flags} --no-default-features --features ${use_multicore_sdr},blst-portable${gpu_flags}"
additional_flags="${additional_flags} --no-default-features --features ${use_multicore_sdr},blst-portable${gpu_flags}${use_fixed_rows_to_discard}"
else
additional_flags="${additional_flags} --no-default-features --features ${use_multicore_sdr}${gpu_flags}"
additional_flags="${additional_flags} --no-default-features --features ${use_multicore_sdr}${gpu_flags}${use_fixed_rows_to_discard}"
fi

echo "Using additional build flags: ${additional_flags}"
Expand Down
52 changes: 29 additions & 23 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,12 @@ cuda-supraseal = ["filecoin-proofs-api/cuda-supraseal", "rust-gpu-tools/cuda", "
opencl = ["filecoin-proofs-api/opencl", "rust-gpu-tools/opencl", "fvm2/opencl", "fvm3/opencl", "fvm4/opencl"]
multicore-sdr = ["filecoin-proofs-api/multicore-sdr"]
c-headers = ["safer-ffi/headers"]
# 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-api/fixed-rows-to-discard"]

[patch.crates-io]
filecoin-hashers = { git = "https://github.com/filecoin-project/rust-fil-proofs", branch = "master" }
filecoin-proofs = { git = "https://github.com/filecoin-project/rust-fil-proofs", branch = "master" }
filecoin-proofs-api = { git = "https://github.com/filecoin-project/rust-filecoin-proofs-api", branch = "fixed-rows-to-discard" }
storage-proofs-core = { git = "https://github.com/filecoin-project/rust-fil-proofs", branch = "master" }

0 comments on commit aecf491

Please sign in to comment.