Skip to content

init: foc-devnet-info library in synapse-core#600

Merged
rjan90 merged 2 commits intomasterfrom
feat/redpanda/introduce-foc-devnet-info
Feb 16, 2026
Merged

init: foc-devnet-info library in synapse-core#600
rjan90 merged 2 commits intomasterfrom
feat/redpanda/introduce-foc-devnet-info

Conversation

@redpanda-f
Copy link
Contributor

@redpanda-f redpanda-f commented Feb 10, 2026

Introduce: foc-devnet-info library

  • Parses and produces synapse type Chain from DevnetInfo exported by foc-devnet
  • e2e test uses this library now, as an example to interface with foc-devnet
  • mocked tests to check for functionality

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 10, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
synapse-dev ff67e43 Commit Preview URL

Branch Preview URL
Feb 16 2026, 11:47 AM

@redpanda-f
Copy link
Contributor Author

Things to fix (synced with @hugomrdias ) :

  • Instead of returning ViemChain, we need to return Chain from synapse-sdk?
  • Use synapse-core/mocks for JSON-RPC testing

@redpanda-f redpanda-f marked this pull request as draft February 10, 2026 15:51
@redpanda-f
Copy link
Contributor Author

Did more debugging on this, this needs some more work, and a sister PR on the foc-devnet side as well.

@redpanda-f
Copy link
Contributor Author

Works with latest foc-devnet:

Loading devnet info from: /Users/redpanda/.foc-devnet/state/latest/devnet-info.json
Devnet run: 20260211T1206_DitzyPip (started: 2026-02-11T06:43:31.713665+00:00)
Using user: USER_1 (0x47cc9101fd026fc112d7fadf6b3c9df5be7d4a8c)
SPs available: 1
No file paths provided, using default test file: /Users/redpanda/.foc-devnet/state/latest/devnet-info.json
=== Synapse SDK Storage E2E Example ===

Mode: FOC DevNet
Reading file...
  Reading file: /Users/redpanda/.foc-devnet/state/latest/devnet-info.json

--- Initializing Synapse SDK ---
RPC URL: http://localhost:5701/rpc/v1
Chain: FOC DevNet (ID: 31415926)
Warm Storage Address: 0x4A8a81765bFBe09D6fDd167EF954a1D3401340e5
Multicall3 Address: 0x2e1F1424b41ad7b2E34b0a60501edFc82FEf5BE8
USDFC Address: 0xB514FeE11119E0923950C09A181F1fa3aa62C80b
Endorsements Address: 0x583456fB91a637807d480d1B6E37029805C1978E
✓ Synapse instance created
Wallet address: 0x47CC9101fD026fC112D7FADf6B3c9DF5bE7D4A8c

--- Checking Balances ---
FIL balance: 999.9999900506001 FIL
USDFC balance: 99999.000000 USDFC

--- Setting Up Storage Context ---
✓ Selected service provider: 0x446339aE7245e3cd1FeD701b685C196C69af695e
✓ Using existing data set: 1
Data set ID: 1
Data set contains 1 piece CIDs

--- Service Provider Details ---
Provider ID: 1
Provider Address: 0x446339aE7245e3cd1FeD701b685C196C69af695e
Provider Name: PDP_SP_1
Active: undefined
PDP Service URL: http://host.docker.internal:5714

--- Preflight Upload Check ---
Estimated costs:
  Per epoch (30s): 0.000000 USDFC
  Per day: 0.000000 USDFC
  Per month: 0.000000 USDFC
✓ Sufficient allowances available

--- Uploading ---
Uploading file to service provider...

  Upload progress: 2.95 KB / 2.95 KB (100.0%)
✓ Upload complete! PieceCID: bafkzcibdsyeapurw4m5m6mu7kjhyatucbdkkernmau6qpjua7mll7wnc35islyz5
✓ Piece addition transaction: 0xfc1bd442a78d722c79b4bf447da7886b721f4aad0c9cac51510d3d9a679f296c
✓ Piece addition confirmed! ID(s): 1

--- Upload Summary ---
File 1: /Users/redpanda/.foc-devnet/state/latest/devnet-info.json
    PieceCID: bafkzcibdsyeapurw4m5m6mu7kjhyatucbdkkernmau6qpjua7mll7wnc35islyz5
    Size: 2.95 KB
    Piece ID: 1

--- Downloading Files ---
Downloading file...

  Downloading file 1: bafkzcibdsyeapurw4m5m6mu7kjhyatucbdkkernmau6qpjua7mll7wnc35islyz5

✓ Downloaded 1 file successfully

--- Verifying Data ---
File 1 (/Users/redpanda/.foc-devnet/state/latest/devnet-info.json): ✅ MATCH (2.95 KB)

✅ SUCCESS: All downloaded files match originals!

--- Piece Status ---
Data set exists on provider: true
Data set last proven: 1/1/1970, 6:20:30 AM
Data set next proof due: 1/1/1970, 7:25:30 AM
Hours until challenge window: 0.9

--- Storage Information ---
Your 1 file is now stored on the Filecoin network:
- Data set ID: 1
- Service provider: 0x446339aE7245e3cd1FeD701b685C196C69af695e

Uploaded pieces:

  File 1: /Users/redpanda/.foc-devnet/state/latest/devnet-info.json
    PieceCID: bafkzcibdsyeapurw4m5m6mu7kjhyatucbdkkernmau6qpjua7mll7wnc35islyz5
    Piece ID: 1
    Size: 2.95 KB
    Retrieval URL: http://host.docker.internal:5714/piece/bafkzcibdsyeapurw4m5m6mu7kjhyatucbdkkernmau6qpjua7mll7wnc35islyz5

The service provider(s) will periodically prove they still have your data.

Needs the sister PR on foc-devnet for working well: FilOzone/foc-devnet#61

@redpanda-f redpanda-f marked this pull request as ready for review February 11, 2026 06:53
@rjan90 rjan90 moved this from 📌 Triage to 🔎 Awaiting review in FOC Feb 11, 2026
@BigLep BigLep requested a review from Copilot February 11, 2026 17:36
@BigLep
Copy link
Contributor

BigLep commented Feb 11, 2026

This is being done in support of FilOzone/foc-devnet#7, and more specifically I believe it closes #589

@BigLep BigLep linked an issue Feb 11, 2026 that may be closed by this pull request
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Introduces a new foc-devnet-info helper in @filoz/synapse-core to validate foc-devnet’s devnet-info.json and convert it into a Synapse Chain, and updates the utils E2E example to use this new flow.

Changes:

  • Add foc-devnet-info library (Zod schema + toChain converter) and export it from @filoz/synapse-core.
  • Add unit tests covering devnet-info validation and chain conversion.
  • Update utils/example-storage-e2e.js to load config from devnet-info by default and switch from ethers-based usage to viem-based usage.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
utils/package.json Add workspace dependency on @filoz/synapse-core and switch utils to viem.
utils/example-storage-e2e.js Load devnet config from devnet-info by default; update to viem + new foc-devnet-info helpers.
packages/synapse-sdk/src/test/synapse.test.ts Remove unused session-key-related import.
packages/synapse-core/test/foc-devnet-info.test.ts Add tests for devnet-info validation and chain construction.
packages/synapse-core/src/index.ts Export the new focDevnetInfo module from synapse-core.
packages/synapse-core/src/foc-devnet-info/src/schema.ts New Zod schema + validation wrapper for devnet-info.json.
packages/synapse-core/src/foc-devnet-info/src/index.ts New public API: loadDevnetInfo + toChain (+ re-exports).
packages/synapse-core/package.json Add package export + typesVersions mapping for ./foc-devnet-info.
package.json Adjust Node devEngine version constraint.
examples/script-tag/biome.json Update Biome schema reference URL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@redpanda-f
Copy link
Contributor Author

@rvagg request re-review. Especially biome.json? not opinionated, but needs fixing.

Copy link
Member

@hugomrdias hugomrdias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM just rebase from master to fix biome things

@github-project-automation github-project-automation bot moved this from 🔎 Awaiting review to ⌨️ In Progress in FOC Feb 13, 2026
@rjan90 rjan90 added this to the M4.1: mainnet ready milestone Feb 16, 2026
remove: submodule

add: lint fix
test: mocked JSON RPC

Update packages/synapse-core/test/foc-devnet-info.test.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Update packages/synapse-core/src/foc-devnet-info/src/index.ts

Co-authored-by: Rod Vagg <rod@vagg.org>

fix: make example script work again, refactor for maximum example utility (#604)

Borrowed a lot of this from #593,
and merged with foc-devnet-info support.

Update packages/synapse-core/src/foc-devnet-info/src/index.ts

Co-authored-by: Rod Vagg <rod@vagg.org>

fixes: PR review

fix: remove redundant loadDevnetInfo() function
@redpanda-f redpanda-f force-pushed the feat/redpanda/introduce-foc-devnet-info branch from 17f4028 to ff67e43 Compare February 16, 2026 11:41
@redpanda-f
Copy link
Contributor Author

LGTM just rebase from master to fix biome things

Request signoff and merge @hugomrdias @rjan90

@rjan90
Copy link
Collaborator

rjan90 commented Feb 16, 2026

Given that this has been rebased, and Hugo gave a thumbs up for merging here in slack, I will go ahead and merge this

@rjan90 rjan90 dismissed hugomrdias’s stale review February 16, 2026 19:41

PR has been rebased

@rjan90 rjan90 merged commit 97fcd38 into master Feb 16, 2026
12 checks passed
@rjan90 rjan90 deleted the feat/redpanda/introduce-foc-devnet-info branch February 16, 2026 19:42
@github-project-automation github-project-automation bot moved this from ⌨️ In Progress to 🎉 Done in FOC Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

foc-devnet Chain builder in synpase-core

5 participants