Skip to content

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

Open
redpanda-f wants to merge 11 commits intomasterfrom
feat/redpanda/introduce-foc-devnet-info
Open

init: foc-devnet-info library in synapse-core#600
redpanda-f wants to merge 11 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 Updated (UTC)
❌ Deployment failed
View logs
synapse-dev 17f4028 Feb 13 2026, 06:32 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
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.

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK, this one's tricky - I see we didn't update this for 0.37 to use viem so it probably doesn't even work on the current release, but the choices in here front-load foc-devnet, and introduce a lot of confusion for something that's intended to be an example. Our dev concerns should be tucked away and unobtrusive.

I have a lot of the necessary changes in #593 already to modernise this, doing a lot of what you needed to do already like viem support, endorsements support, and a NETWORK flag. I was also trying to push some of the viem complexity lower in the script to hide it.

Let me figure out if (a) we can get that PR merged before this one (fwiw I was wrong when I said that my work wasn't going to get in the way of this PR, this example script not being updated is the main problem), or (b) I'll just backport my changes to here and find a better way to inject the devnet optionality.

At a minimum: USE_CALIBRATION should be NETWORK and we should be able to support mainnet, DETAILS_VIA_ENVVARS shouldn't be a thing and foc-devnet should be opt-in, in fact NETWORK=devnet should probably be the only necessary trigger to load foc-devnet config.

The most minimal form of this should be: NETWORK=devnet PRIVATE_KEY=... node example-storage-e2e.js file.txt

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, most minimal would be this since you don't need privkey: NETWORK=devnet node example-storage-e2e.js file.txt

Copy link
Collaborator

Choose a reason for hiding this comment

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

@redpanda-f see #604 for a PR against this file that works on your branch and merges in some #593 code too.

redpanda-f and others added 2 commits February 12, 2026 22:10
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@socket-security
Copy link

socket-security bot commented Feb 12, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​types/​assert@​1.5.111001007080100
Addediso-web@​2.1.0941007693100
Added@​wagmi/​cli@​2.9.0771007794100
Added@​web3-storage/​data-segment@​5.3.0881008283100
Addedp-retry@​7.1.110010010083100
Addedplaywright-test@​14.1.128710010083100
Addeddnum@​2.17.08610010085100
Addedmultiformats@​13.4.210010010086100
Addedviem@​2.45.39910010098100

View full report

rvagg and others added 3 commits February 12, 2026 22:14
…lity (#604)

Borrowed a lot of this from #593,
and merged with foc-devnet-info support.
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ⌨️ In Progress

Development

Successfully merging this pull request may close these issues.

foc-devnet Chain builder in synpase-core

4 participants