Module forest_filecoin::utils::proofs_api::paramfetch
source · Expand description
This module contains the logic for fetching the proofs parameters from the network.
As a general rule, the parameters are first fetched from ChainSafe’s Cloudflare R2 bucket, if
that fails (or is overridden by PROOFS_ONLY_IPFS_GATEWAY_ENV
), the IPFS gateway is used as a fallback.
The reason for this is that the IPFS gateway is not as reliable and performant as the centralized solution, which contributed to issues in CI in the past.
Enums§
- Sector size options for fetching.
Constants§
- Domain bound to the Cloudflare R2 bucket.
- Default IPFS gateway to use for fetching parameters. Set via the
IPFS_GATEWAY_ENV
environment variable. - Running Forest requires the download of chain’s proof parameters which are large files, by default are hosted outside of China and very slow to download there. To get around that, users should set this variable to: https://proof-parameters.s3.cn-south-1.jdcloud-oss.com/ipfs/
- If set to 1, enforce using the IPFS gateway for fetching parameters.
Functions§
- Downloads the parameter file from Cloudflare R2 to the given path. In case of an error, the file is not written to the final path to avoid corrupted files.
- Ensures the parameter files are downloaded to cache dir
- Downloads the parameter file from Cloudflare R2 to the given path. It wraps the
download_from_cloudflare
function with a retry and timeout mechanisms. - Get proofs parameters and all verification keys for a given sector size given a parameter JSON manifest.
- Get proofs parameters and all verification keys for a given sector size using default manifest.