From 4f0e2d0a47de0fdb2938eb6bfde03d8c4ada13de Mon Sep 17 00:00:00 2001 From: galargh Date: Mon, 4 May 2026 10:30:02 +0200 Subject: [PATCH 1/4] fix: support latest synapse sdk localnet --- .github/workflows/ci_run.yml | 4 ++-- src/config.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci_run.yml b/.github/workflows/ci_run.yml index adb1d91..bf29b7c 100644 --- a/.github/workflows/ci_run.yml +++ b/.github/workflows/ci_run.yml @@ -173,14 +173,14 @@ jobs: if: steps.cache-docker-images.outputs.cache-hit == 'true' run: | ./foc-devnet clean --all - ./foc-devnet init --no-docker-build + ./foc-devnet init --no-docker-build ${{ inputs.init_flags }} # If Docker images are not cached, do full init (downloads YugabyteDB and builds all images) - name: "EXEC: {Initialize without cache}, independent" if: steps.cache-docker-images.outputs.cache-hit != 'true' run: | ./foc-devnet clean --all - ./foc-devnet init + ./foc-devnet init ${{ inputs.init_flags }} # CACHE-DOCKER: Save Docker images as tarballs for caching - name: "EXEC: {Save Docker images for cache}, DEP: {C-docker-images-cache}" diff --git a/src/config.rs b/src/config.rs index 3146f73..750c167 100644 --- a/src/config.rs +++ b/src/config.rs @@ -291,9 +291,9 @@ impl Default for Config { url: "https://github.com/filecoin-project/curio.git".to_string(), commit: "60f77a618eee24cd3482be5fea545e01f26052a4".to_string(), }, - filecoin_services: Location::GitCommit { + filecoin_services: Location::GitTag { url: "https://github.com/FilOzone/filecoin-services.git".to_string(), - commit: "c79e2c6b37372e9b381d3e2b79e787dc132195dc".to_string(), + tag: "v1.2.0".to_string(), }, multicall3: Location::GitTag { url: "https://github.com/mds1/multicall3.git".to_string(), From 87dcf63983540f760673fe5e82145339f8b7ce61 Mon Sep 17 00:00:00 2001 From: galargh Date: Mon, 4 May 2026 20:12:08 +0200 Subject: [PATCH 2/4] fix: predeploy latest pdp verifier dependencies --- src/commands/start/foc_deployer/mod.rs | 34 ++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/commands/start/foc_deployer/mod.rs b/src/commands/start/foc_deployer/mod.rs index fb6b2fa..ff4f4b2 100644 --- a/src/commands/start/foc_deployer/mod.rs +++ b/src/commands/start/foc_deployer/mod.rs @@ -129,6 +129,40 @@ pub fn deploy_foc_contracts( mkdir -p /home/foc-user/.foundry/keystores cast wallet import foc-deployer --private-key {} --unsafe-password '' cd /service_contracts + +# filecoin-services v1.2.0 added three PDPVerifier constructor arguments, but +# warm-storage-deploy-all.sh still deploys it with only the initializer version. +# Predeploy the dependencies for that ABI shape and let the upstream script reuse +# the exported addresses. +PDP_CONSTRUCTOR_INPUTS="$(jq '[.[] | select(.type == "constructor") | .inputs[]] | length' abi/PDPVerifier.abi.json)" +if [ "$PDP_CONSTRUCTOR_INPUTS" = "4" ] && [ -z "$PDP_VERIFIER_IMPLEMENTATION_ADDRESS" ]; then + PDP_INIT_COUNTER=1 + if [ -n "$PDP_VERIFIER_PROXY_ADDRESS" ]; then + PDP_INIT_COUNTER="$(expr "$(tools/get-initialized-counter.sh "$PDP_VERIFIER_PROXY_ADDRESS")" + "1")" + fi + PDP_USDFC_SYBIL_FEE="${{PDP_USDFC_SYBIL_FEE:-100000000000000000}}" + + if [ -z "$FILECOIN_PAY_ADDRESS" ]; then + echo "Predeploying FilecoinPayV1 for PDPVerifier constructor" + FILECOIN_PAY_OUTPUT="$(forge create --password "$PASSWORD" --broadcast lib/fws-payments/src/FilecoinPayV1.sol:FilecoinPayV1)" + echo "$FILECOIN_PAY_OUTPUT" + export FILECOIN_PAY_ADDRESS="$(echo "$FILECOIN_PAY_OUTPUT" | grep "Deployed to" | awk '{{print $3}}')" + if [ -z "$FILECOIN_PAY_ADDRESS" ]; then + echo "Failed to extract FilecoinPayV1 address" + exit 1 + fi + fi + + echo "Predeploying PDPVerifier implementation with USDFC constructor args" + PDP_VERIFIER_OUTPUT="$(forge create --password "$PASSWORD" --broadcast lib/pdp/src/PDPVerifier.sol:PDPVerifier --constructor-args "$PDP_INIT_COUNTER" "$USDFC_TOKEN_ADDRESS" "$PDP_USDFC_SYBIL_FEE" "$FILECOIN_PAY_ADDRESS")" + echo "$PDP_VERIFIER_OUTPUT" + export PDP_VERIFIER_IMPLEMENTATION_ADDRESS="$(echo "$PDP_VERIFIER_OUTPUT" | grep "Deployed to" | awk '{{print $3}}')" + if [ -z "$PDP_VERIFIER_IMPLEMENTATION_ADDRESS" ]; then + echo "Failed to extract PDPVerifier implementation address" + exit 1 + fi +fi + bash /service_contracts/tools/warm-storage-deploy-all.sh 2>&1 | tee /tmp/foc-deploy.log"#, private_key ); From ebf17534439e35da8e4c80335d7abab2534b0dd0 Mon Sep 17 00:00:00 2001 From: Piotr Galar Date: Thu, 7 May 2026 11:50:37 +0100 Subject: [PATCH 3/4] test: add multi-copy upload testing scenario with filecion-pin (#103) Co-authored-by: Rod Vagg --- .github/workflows/ci_pull_request.yml | 1 - scenarios/run.py | 3 +- scenarios/test_multi_copy_upload.py | 366 ++++++++++++++++++++++++++ 3 files changed, 368 insertions(+), 2 deletions(-) create mode 100644 scenarios/test_multi_copy_upload.py diff --git a/.github/workflows/ci_pull_request.yml b/.github/workflows/ci_pull_request.yml index 5e218f2..d911cde 100644 --- a/.github/workflows/ci_pull_request.yml +++ b/.github/workflows/ci_pull_request.yml @@ -9,7 +9,6 @@ name: CI (Pull Request) on: pull_request: - branches: ['main'] push: branches: ['main'] diff --git a/scenarios/run.py b/scenarios/run.py index 8eac053..8a366a6 100755 --- a/scenarios/run.py +++ b/scenarios/run.py @@ -26,7 +26,8 @@ ORDER = [ ("test_containers", 5), ("test_basic_balances", 10), - ("test_storage_e2e", 100), + ("test_storage_e2e", 200), + ("test_multi_copy_upload", 600), ("test_caching_subsystem", 200), ] diff --git a/scenarios/test_multi_copy_upload.py b/scenarios/test_multi_copy_upload.py new file mode 100644 index 0000000..fd2b9d8 --- /dev/null +++ b/scenarios/test_multi_copy_upload.py @@ -0,0 +1,366 @@ +#!/usr/bin/env python3 +"""Multi-copy upload test: upload a random file via filecoin-pin against the devnet.""" + +import os +import re +import subprocess +import sys +import tempfile +import time +from pathlib import Path +from urllib.error import URLError +from urllib.request import urlopen + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from scenarios.helpers import ( + assert_eq, + assert_ok, + fail, + info, + run_cmd, + write_random_file, +) + +ANSI_RE = re.compile(r"\x1b\[[0-?]*[ -/]*[@-~]") +RAND_FILE_NAME = "random_file" +RAND_FILE_SIZE = 20 * 1024 * 1024 +RAND_FILE_SEED = 42 +ADD_DEADLINE_SECS = 240 +ADD_INTERVAL_SECS = 10 +ADD_ATTEMPT_TIMEOUT_SECS = 180 +RETRIEVAL_DEADLINE_SECS = 90 +RETRIEVAL_INTERVAL_SECS = 5 +RETRIEVAL_REQUEST_TIMEOUT_SECS = 10 +VERIFY_CID_SCRIPT = """ +import { readFileSync } from "node:fs"; +import { CID } from "multiformats"; +import { sha256 } from "multiformats/hashes/sha2"; + +const [cidString, filePath] = process.argv.slice(1); + +if (!cidString || !filePath) { + console.error("usage: node --input-type=module --eval