Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci_run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,12 +286,12 @@ jobs:
# Download and extract Filecoin proof parameters from S3
- name: "EXEC: {Download proof parameters from S3}, independent"
run: |
mkdir -p ~/.foc-devnet/docker/volumes/cache/filecoin-proof-parameters/
mkdir -p /var/tmp/filecoin-proof-parameters/
curl -L https://fil-proof-params-2k-cache.s3.us-east-2.amazonaws.com/filecoin-proof-params-2k.tar -o /tmp/filecoin-proof-params-2k.tar
tar -xf /tmp/filecoin-proof-params-2k.tar -C ~/.foc-devnet/docker/volumes/cache/filecoin-proof-parameters/
tar -xf /tmp/filecoin-proof-params-2k.tar -C /var/tmp/filecoin-proof-parameters/
rm /tmp/filecoin-proof-params-2k.tar
ls -lath ~/.foc-devnet/docker/volumes/cache/filecoin-proof-parameters/
PROOF_PARAMS_HASH=$(find ~/.foc-devnet/docker/volumes/cache/filecoin-proof-parameters -type f -exec sha256sum {} \; | cut -d' ' -f1 | sort | sha256sum | cut -d' ' -f1)
ls -lath /var/tmp/filecoin-proof-parameters/
PROOF_PARAMS_HASH=$(find /var/tmp/filecoin-proof-parameters -type f -exec sha256sum {} \; | cut -d' ' -f1 | sort | sha256sum | cut -d' ' -f1)
echo "Downloaded proof parameters with hash: $PROOF_PARAMS_HASH"

# Verify cluster is running correctly
Expand Down
14 changes: 11 additions & 3 deletions README_ADVANCED.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ foc-devnet init [OPTIONS]
- `--lotus <SOURCE>` - Lotus source location
- `--filecoin-services <SOURCE>` - Filecoin Services source location
- `--pdp <SOURCE>` - PDP source location. If omitted, uses the PDP submodule bundled with Filecoin Services.
- `--proof-params-dir <PATH>` - Local proof params directory
- `--proof-params-dir <PATH>` - Local proof params directory to copy into the global cache at `/var/tmp/filecoin-proof-parameters`
- `--rand` - Use random mnemonic instead of deterministic one. Use this for unique test scenarios.

**Source Format:**
Expand Down Expand Up @@ -359,6 +359,15 @@ $FOC_DEVNET_BASEDIR/
└── tmp/
```

Filecoin proof parameters are not stored under `FOC_DEVNET_BASEDIR`. They use the standard global host cache at `/var/tmp/filecoin-proof-parameters`, which is bind-mounted into Lotus, lotus-miner, and Curio containers at the same path.

To reuse parameters from an older foc-devnet-private cache, copy them manually before starting:

```bash
mkdir -p /var/tmp/filecoin-proof-parameters
cp -R ~/.foc-devnet/docker/volumes/cache/filecoin-proof-parameters/. /var/tmp/filecoin-proof-parameters/
```

---

## Directory Structure
Expand All @@ -374,8 +383,7 @@ $FOC_DEVNET_BASEDIR/
│ └── multicall3/ # Multicall3 contracts
├── docker/
│ └── volumes/
│ ├── cache/ # Shared cache (proof params, etc.)
│ │ └── filecoin-proof-parameters/
│ ├── cache/ # Shared foc-devnet build/cache data
│ └── run-specific/ # Run-isolated volumes
│ └── <run-id>/ # Each run has its own volumes
│ ├── lotus-data/ # Lotus blockchain data
Expand Down
10 changes: 9 additions & 1 deletion src/commands/init/artifacts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub fn stage_artifacts(proof_params_dir: Option<String>) -> Result<(), Box<dyn s
Ok(())
}

/// Copy filecoin-proof-params from a local directory.
/// Copy filecoin-proof-params from a local directory into the global cache.
///
/// This function copies proof parameters from a local directory instead of downloading them.
///
Expand Down Expand Up @@ -58,6 +58,14 @@ fn copy_proof_params_from_local(params_path: &str) -> Result<(), Box<dyn std::er
// Create destination directory
fs::create_dir_all(&dest_path)?;

if params_path.canonicalize()? == dest_path.canonicalize()? {
info!(
"Proof parameters already use the global cache: {}",
dest_path.display()
);
return Ok(());
}

// Copy all files from source to destination
let pb = ProgressBar::new_spinner();
pb.set_style(
Expand Down
Loading