init: foc-devnet-info library in synapse-core#600
init: foc-devnet-info library in synapse-core#600redpanda-f wants to merge 11 commits intomasterfrom
foc-devnet-info library in synapse-core#600Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
synapse-dev | 17f4028 | Feb 13 2026, 06:32 AM |
|
Things to fix (synced with @hugomrdias ) :
|
|
Did more debugging on this, this needs some more work, and a sister PR on the foc-devnet side as well. |
|
Works with latest foc-devnet: Needs the sister PR on foc-devnet for working well: FilOzone/foc-devnet#61 |
|
This is being done in support of FilOzone/foc-devnet#7, and more specifically I believe it closes #589 |
There was a problem hiding this comment.
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-infolibrary (Zod schema +toChainconverter) and export it from@filoz/synapse-core. - Add unit tests covering devnet-info validation and chain conversion.
- Update
utils/example-storage-e2e.jsto 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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Sorry, most minimal would be this since you don't need privkey: NETWORK=devnet node example-storage-e2e.js file.txt
There was a problem hiding this comment.
@redpanda-f see #604 for a PR against this file that works on your branch and merges in some #593 code too.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Rod Vagg <rod@vagg.org>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Co-authored-by: Rod Vagg <rod@vagg.org>
|
@rvagg request re-review. Especially biome.json? not opinionated, but needs fixing. |
hugomrdias
left a comment
There was a problem hiding this comment.
LGTM just rebase from master to fix biome things
Introduce:
foc-devnet-infolibraryChainfromDevnetInfoexported byfoc-devnete2etest uses this library now, as an example to interface withfoc-devnet