Skip to content
Merged
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
82 changes: 82 additions & 0 deletions .github/workflows/filecoin-calibration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Filecoin Calibration

on:
push:
paths: ['services/filecoin/**', 'backend/**', 'frontend/**', '.github/workflows/filecoin-calibration.yml']
pull_request:
paths: ['services/filecoin/**', 'backend/**', 'frontend/**', '.github/workflows/filecoin-calibration.yml']
workflow_dispatch:

permissions:
contents: read

jobs:
frontend:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: '1.4.4'
- run: bun install --frozen-lockfile
- run: bun run test:filecoin
- run: bun run test:proxy
- run: bun x tsc --noEmit
sdk:
runs-on: ubuntu-latest
defaults:
run:
working-directory: services/filecoin
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
cache-dependency-path: services/filecoin/package-lock.json
- run: npm ci --ignore-scripts
- run: npm test
- run: npm run check
backend:
runs-on: ubuntu-latest
services:
mongodb:
image: mongo:7
ports: ['27017:27017']
options: >-
--health-cmd "mongosh --quiet --eval 'db.runCommand({ping:1})'"
--health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: actions/setup-node@v4
with:
node-version: '22'
- run: npm ci --ignore-scripts --prefix services/filecoin
- name: Install integration test dependencies
run: >-
python -m pip install pytest ruff 'pydantic>=2.8,<3' 'httpx>=0.27,<1'
'beanie>=1.27,<3' 'pymongo>=4.11,<5' 'web3>=7.6,<8'
'fastapi>=0.115,<1' pyyaml python-dotenv 'pyunormalize<18'
'py-cid==0.5.0' 'libp2p==0.6.0' 'python-multipart==0.0.32'
'qiskit==2.3.0' 'qiskit-aer==0.17.2' 'qiskit-algorithms==0.4.0'
- run: python -m pip install --no-deps -e backend
- name: Lint Filecoin integration
run: >-
ruff check backend/src/quantum_backend_v2/artifacts/filecoin.py
backend/src/quantum_backend_v2/application/filecoin_*.py
backend/src/quantum_backend_v2/api/routers/filecoin.py
backend/scripts/filecoin.py backend/tests/unit/test_filecoin*.py
- name: Filecoin and adjacent regressions
env:
QMESH_TEST_MONGODB_URI: mongodb://localhost:27017
run: >-
python -m pytest backend/tests/unit/test_filecoin*.py
backend/tests/unit/test_peer_tasks.py backend/tests/unit/test_provenance_job.py
backend/tests/unit/test_provenance_storage_check.py
backend/tests/unit/test_financial_api.py backend/tests/unit/test_finance_provenance.py -q
40 changes: 40 additions & 0 deletions backend/docs/evidence/filecoin-calibration-20261111/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Live Filecoin Calibration evidence

Implementation: [PR #145](https://github.com/QMeshPy/distributed-quantum/pull/145), [issue #144](https://github.com/QMeshPy/distributed-quantum/issues/144).

Five public objects were confirmed in dataset **52518**, provider **9**, using faucet test FIL and test USDFC. No custom contract was deployed. Every object was downloaded in a fresh, key-free verification process and checked against its PieceCID, SHA256 and byte length; package/dataset/checkpoint schemas were also validated.

| Object | Bytes | Piece ID | Evidence |
| --- | ---: | ---: | --- |
| Bell experiment + NEAR provenance | 7,292 | 0 | [Transaction](https://beryx.io/fil/calibration/txs/0xece0512aca548d03f5222406c305e389aa9ac565a5f741f3bdf36810e87ad8b2) / [receipt](bell-receipt.json) |
| Synthetic finance CSV | 847 | 1 | [Transaction](https://beryx.io/fil/calibration/txs/0xe895434a95b4ca30c653278236016c5a1358f17f9507dbc599a5c186dda2529f) / [receipt](finance-dataset-receipt.json) |
| NCN toy Hamiltonian dataset | 1,106 | 2 | [Transaction](https://beryx.io/fil/calibration/txs/0x77e79da32215090106677d56d85dd5590eefbc84faf2552637d4189ef15404a3) / [receipt](pharma-dataset-receipt.json) |
| Completed VQE task checkpoint | 448 | 3 | [Transaction](https://beryx.io/fil/calibration/txs/0xeec3df365fb20c6f6d4bfabd89df94e379e85502dfb50a6c25b2d325338abc8f) / [receipt](pharma-checkpoint-receipt.json) |
| Finance result, input CSV and circuit archive | 20,499 | 4 | [Transaction](https://beryx.io/fil/calibration/txs/0xedc6401aa5aa80085aafb3298baddbb3c504da45f4fe233bf3132efb44859449) / [receipt](finance-package-receipt.json) |

[Machine-readable observations](retrieval-and-status.json) record live registration for all five pieces. **PDP was pending for the current period** at these observations; successful retrieval is independently verified and is not presented as a completed PDP proof. This demonstration used one provider, not replicated storage.

## What ran

- **Bell archive:** the downloaded package's input, result, execution plan and bundle commitments passed verification, as did both existing NEAR testnet anchors. See [verification report](bell-near-verification.json).
- **Pharma:** the actual local VQE handler consumed the Filecoin-hosted NCN/STO-3G toy Hamiltonian (four qubits, two active electrons). It completed 35 evaluations at **-148.33704862401328 Ha** and published a completed-task checkpoint. A separate process retrieved the dataset and checkpoint, restored the identical outcome hash, and made **zero compute calls and zero uploads**. This reused an earlier Hamiltonian; it was not a new molecule-generation or safety-validation experiment.
- **Finance:** the real portfolio builder consumed the Filecoin-hosted **synthetic** CSV (13 rows, four assets). It selected SYN_A and SYN_B with objective **0.554655045676**, matching exact enumeration across six feasible portfolios. Its inputs, result and QASM circuit were archived together. These are local CPU demonstrations, not live mesh or market-performance measurements.

[Summary and result hashes](summary.json) distinguish execution, storage and provenance evidence.

## Independently retrieve

Install the backend and `npm ci --ignore-scripts --prefix services/filecoin`, then run from the repository root (no wallet key required):

```sh
python backend/scripts/filecoin.py download backend/docs/evidence/filecoin-calibration-20261111/finance-package-receipt.json finance-package.json
python backend/scripts/filecoin.py status backend/docs/evidence/filecoin-calibration-20261111/pharma-checkpoint-receipt.json
```

For the Bell archive's independent NEAR check, set `QB2_NEAR_REGISTRY_CONTRACT` and `QB2_NEAR_REGISTRY_PUBLISHER` to `qmesh-provenance-20261110.testnet`, then run `filecoin.py verify` with `bell-receipt.json`. Status is a fresh observation and can change as funding and provider health change.

## Funding and operational boundaries

The active demo wallet is `0xA63A33e52589c761F90ce46F7c86aeEe8644112f`. Its [one-test-USDFC deposit](https://beryx.io/fil/calibration/txs/0xbee3642018b40a0fdbd4708d6e3a4f26835123a5a0e05916ff94079235986e9a) and [finite operator approval](https://beryx.io/fil/calibration/txs/0xde85d6ed9a228071593c37a3fb8caf2c4a1ec8bed2fbf26bcab8a560077acc4e) used existing faucet funds. Approval limits were 0.25 test USDFC/month, one test USDFC lockup and the contract-required 30-day lockup period. A seven-day runway target does not schedule deletion. Earlier uncertain setup activity was quarantined by revoking the old wallet's operator approval; it is excluded from successful-object counts.

The production UI built successfully and its interactions were exercised with an explicitly isolated account/API fixture. The real email-OTP session could not be tested because the available computer-use runtime failed to initialize. Hosted use still requires operator configuration of MongoDB, authentication and a funded agent key as documented in [setup](../../filecoin-calibration.md).
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"bundle_id": "provenance-near-demo-20261110T170703Z-bell-pair",
"status": "verified",
"checks": [
{
"kind": "hash",
"name": "bundle_hash",
"status": "passed",
"message": "Commitment matches",
"reference": null,
"url": null
},
{
"kind": "hash",
"name": "input_hash",
"status": "passed",
"message": "Commitment matches",
"reference": null,
"url": null
},
{
"kind": "hash",
"name": "plan_id",
"status": "passed",
"message": "Commitment matches",
"reference": null,
"url": null
},
{
"kind": "hash",
"name": "result_hash",
"status": "passed",
"message": "Commitment matches",
"reference": null,
"url": null
},
{
"kind": "hash",
"name": "fragment_hashes",
"status": "passed",
"message": "Commitment matches",
"reference": null,
"url": null
},
{
"kind": "storage",
"name": "storage_content",
"status": "not_applicable",
"message": "No storage references recorded",
"reference": null,
"url": null
},
{
"kind": "anchor",
"name": "anchor_proof",
"status": "passed",
"message": "Merkle inclusion matches",
"reference": "near:testnet:FbM5wgccrreiuA9UDc1Dzyn34qwNBoWu6UjvpvNQ7vvX",
"url": null
},
{
"kind": "anchor",
"name": "anchor_transaction",
"status": "passed",
"message": "Confirmed anchor root matches",
"reference": "near:testnet:FbM5wgccrreiuA9UDc1Dzyn34qwNBoWu6UjvpvNQ7vvX",
"url": "https://testnet.nearblocks.io/txns/FbM5wgccrreiuA9UDc1Dzyn34qwNBoWu6UjvpvNQ7vvX"
},
{
"kind": "anchor",
"name": "anchor_proof",
"status": "passed",
"message": "Merkle inclusion matches",
"reference": "near:testnet:Cge8aNb4w3HXH61roPFLY9qyYwoSfHm8kvuao2rQeDax",
"url": null
},
{
"kind": "anchor",
"name": "anchor_transaction",
"status": "passed",
"message": "Confirmed anchor root matches",
"reference": "near:testnet:Cge8aNb4w3HXH61roPFLY9qyYwoSfHm8kvuao2rQeDax",
"url": "https://testnet.nearblocks.io/txns/Cge8aNb4w3HXH61roPFLY9qyYwoSfHm8kvuao2rQeDax"
}
],
"checked_at": "2026-11-10T21:31:03.625300Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"network": "calibration",
"chain_id": 314159,
"piece_cid": "bafkzcibdyqdarmlrnos4iu6tpqjyr3b7ln4vwxoo35qzumgi75oemx6qefdoqmzc",
"sha256": "abd163263016cdbdd5c05aae5b40bb0fadea0d8f7f6046734d27ce88875cba39",
"size_bytes": 7292,
"complete": true,
"copies": [
{
"provider_id": "9",
"data_set_id": "52518",
"piece_id": "0",
"transaction_hash": "0xece0512aca548d03f5222406c305e389aa9ac565a5f741f3bdf36810e87ad8b2",
"provider_address": "0xa3971A7234a3379A1813d9867B531e7EeB20ae07",
"retrieval_url": "https://calib.ezpdpz.net/piece/bafkzcibdyqdarmlrnos4iu6tpqjyr3b7ln4vwxoo35qzumgi75oemx6qefdoqmzc"
}
],
"transaction_hashes": [
"0xece0512aca548d03f5222406c305e389aa9ac565a5f741f3bdf36810e87ad8b2"
],
"payer_address": "0xA63A33e52589c761F90ce46F7c86aeEe8644112f"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"network": "calibration",
"chain_id": 314159,
"piece_cid": "bafkzcibdveaqk6e5peub6bsn2n7ds2n6xgnwkbsgdkge6zdpa2juzamgcgwh3gb4",
"sha256": "05881c4397aabfdf25f0e5211af280b6a582d11bc7e611095c73f6ccf47f2393",
"size_bytes": 847,
"complete": true,
"copies": [
{
"provider_id": "9",
"data_set_id": "52518",
"piece_id": "1",
"transaction_hash": "0xe895434a95b4ca30c653278236016c5a1358f17f9507dbc599a5c186dda2529f",
"provider_address": "0xa3971A7234a3379A1813d9867B531e7EeB20ae07",
"retrieval_url": "https://calib.ezpdpz.net/piece/bafkzcibdveaqk6e5peub6bsn2n7ds2n6xgnwkbsgdkge6zdpa2juzamgcgwh3gb4"
}
],
"transaction_hashes": [
"0xe895434a95b4ca30c653278236016c5a1358f17f9507dbc599a5c186dda2529f"
],
"payer_address": "0xA63A33e52589c761F90ce46F7c86aeEe8644112f"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"network": "calibration",
"chain_id": 314159,
"piece_cid": "bafkzcibd5voqunvk3t67szzdlt67vl4ipgjlh5vlamrjefkkuuxxypqrjcaiiwba",
"sha256": "06145b9339ca58698d9977f6ef6fc2c5675e1004de20ff6c9a8c167bec1a5000",
"size_bytes": 20499,
"complete": true,
"copies": [
{
"provider_id": "9",
"data_set_id": "52518",
"piece_id": "4",
"transaction_hash": "0xedc6401aa5aa80085aafb3298baddbb3c504da45f4fe233bf3132efb44859449",
"provider_address": "0xa3971A7234a3379A1813d9867B531e7EeB20ae07",
"retrieval_url": "https://calib.ezpdpz.net/piece/bafkzcibd5voqunvk3t67szzdlt67vl4ipgjlh5vlamrjefkkuuxxypqrjcaiiwba"
}
],
"transaction_hashes": [
"0xedc6401aa5aa80085aafb3298baddbb3c504da45f4fe233bf3132efb44859449"
],
"payer_address": "0xA63A33e52589c761F90ce46F7c86aeEe8644112f"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"network": "calibration",
"chain_id": 314159,
"piece_cid": "bafkzcibchqcjsv7tvkjyon2znkusp6hywkruuk2vfoia37pgacdj2ryrg3kjoky",
"sha256": "66bbd36b5684e404e0c242725cc4fbfa52b4db17a67be0f64aa19e2f06306cd1",
"size_bytes": 448,
"complete": true,
"copies": [
{
"provider_id": "9",
"data_set_id": "52518",
"piece_id": "3",
"transaction_hash": "0xeec3df365fb20c6f6d4bfabd89df94e379e85502dfb50a6c25b2d325338abc8f",
"provider_address": "0xa3971A7234a3379A1813d9867B531e7EeB20ae07",
"retrieval_url": "https://calib.ezpdpz.net/piece/bafkzcibchqcjsv7tvkjyon2znkusp6hywkruuk2vfoia37pgacdj2ryrg3kjoky"
}
],
"transaction_hashes": [
"0xeec3df365fb20c6f6d4bfabd89df94e379e85502dfb50a6c25b2d325338abc8f"
],
"payer_address": "0xA63A33e52589c761F90ce46F7c86aeEe8644112f"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"network": "calibration",
"chain_id": 314159,
"piece_cid": "bafkzcibdtydqnjm3hkbkx6yxryhhl2dug2ny4ansdaqydteemvmboba4iu5477yk",
"sha256": "eac417517674d3b53e73321e5a1f58034bc005e0876474f5ecf051af0e892f41",
"size_bytes": 1106,
"complete": true,
"copies": [
{
"provider_id": "9",
"data_set_id": "52518",
"piece_id": "2",
"transaction_hash": "0x77e79da32215090106677d56d85dd5590eefbc84faf2552637d4189ef15404a3",
"provider_address": "0xa3971A7234a3379A1813d9867B531e7EeB20ae07",
"retrieval_url": "https://calib.ezpdpz.net/piece/bafkzcibdtydqnjm3hkbkx6yxryhhl2dug2ny4ansdaqydteemvmboba4iu5477yk"
}
],
"transaction_hashes": [
"0x77e79da32215090106677d56d85dd5590eefbc84faf2552637d4189ef15404a3"
],
"payer_address": "0xA63A33e52589c761F90ce46F7c86aeEe8644112f"
}
Loading
Loading