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 Opt - Sector size options for fetching.
Constants§
- CLOUDFLARE_
PROOF_ 🔒PARAMETER_ DOMAIN - Domain bound to the Cloudflare R2 bucket.
- DEFAULT_
IPFS_ 🔒GATEWAY - Default IPFS gateway to use for fetching parameters.
Set via the
IPFS_GATEWAY_ENVenvironment variable. - IPFS_
GATEWAY_ 🔒ENV - 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/
- PROOFS_
ONLY_ 🔒IPFS_ GATEWAY_ ENV - If set to 1, enforce using the IPFS gateway for fetching parameters.
Functions§
- download_
from_ 🔒cloudflare - 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.
- ensure_
proof_ params_ downloaded - Ensures the parameter files are downloaded to cache dir
- fetch_
params_ 🔒cloudflare - Downloads the parameter file from Cloudflare R2 to the given path. It wraps the
download_from_cloudflarefunction with a retry and timeout mechanisms. - fetch_
params_ 🔒ipfs_ gateway - fetch_
verify_ 🔒params - get_
params - Get proofs parameters and all verification keys for a given sector size given a parameter JSON manifest.
- get_
params_ default - Get proofs parameters and all verification keys for a given sector size using default manifest.