feat(synapse): run local client using synapse as library - #182
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors Synapse scenario execution to run the local E2E client code from this repo while treating @filoz/synapse-sdk as a dependency (consumer-style), with an alternate “source runtime” mode that can run against a Synapse checkout by mapping public dist/ exports to src/ TypeScript.
Changes:
- Replace the previous “clone + build Synapse” flow with a new
SynapseRuntimethat can install a minimal consumerpackage.json(npm) or reuse a source checkout (pnpm + runtime hook). - Split and expand Synapse scenario scripts into explicit TypeScript entrypoints under
scenarios/synapse-e2e/. - Extend CI dependency resolution to normalize npm version outputs and (for synapse-sdk) record exact runtime dependencies (
@filoz/synapse-core,viem), plus update Renovate + docs accordingly.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/tests/test_scenario_dependencies.py | Updates tests to validate the new SynapseRuntime behaviors and node script invocation. |
| scripts/tests/test_resolve_ci_dependencies.py | Adds tests for npm version normalization and synapse-sdk runtime dependency resolution. |
| scripts/setup-scenarios-prerequisites.sh | Updates prerequisites to include npm in tool checks. |
| scripts/resolve-ci-dependencies.py | Adds npm_version() normalization and resolves synapse-sdk runtime dependencies for consumer installs. |
| scenarios/test_synapse_e2e.py | Switches synapse E2E runner to use prepare_synapse_runtime() + local TypeScript entrypoint execution. |
| scenarios/test_create_dataset_smoke.py | Switches create-dataset smoke scenario to the new runtime + TypeScript entrypoint. |
| scenarios/test_caching_subsystem.py | Refactors upload probe in caching scenario to call a local TypeScript entrypoint via the runtime. |
| scenarios/test_basic_balances.py | Adjusts cast preflight check to use command -v (now tied to updated Foundry path logic). |
| scenarios/synapse.py | Removes the old shared helpers that cloned/built Synapse and ran JS from its repo. |
| scenarios/synapse-e2e/upload-probe.ts | New local TS probe to upload a file and verify Synapse + on-chain outcomes. |
| scenarios/synapse-e2e/system-e2e.ts | New local TS “full journey” scenario entrypoint exercising upload/replication/retrieval/on-chain checks. |
| scenarios/synapse-e2e/storage.ts | New TS storage helpers for upload milestones and retrieval assertions. |
| scenarios/synapse-e2e/source-runtime.mjs | New Node hook to remap @filoz/* public exports from dist/src → src TS when running against a source checkout. |
| scenarios/synapse-e2e/onchain.ts | New TS helpers for on-chain assertions tied to the Synapse upload results. |
| scenarios/synapse-e2e/environment.ts | New TS environment resolver for devnet vs non-devnet configuration. |
| scenarios/synapse-e2e/create-dataset.ts | New TS probe for createDataSet flow and on-chain verification. |
| scenarios/synapse-e2e/account.ts | New TS helpers for account prep and confirmation polling. |
| scenarios/synapse_runtime.py | New Python runtime manager for consumer vs source Synapse execution and node invocation with retry behavior. |
| scenarios/run.py | Updates scenario runner to execute the new synapse E2E scenario and adjusts timeouts. |
| scenarios/helpers.py | Updates base dir handling and Foundry binary resolution for scenarios. |
| scenarios/create-dataset-smoke.ts | Removes the previous TS script that was copied into a Synapse checkout before execution. |
| renovate.json | Updates Renovate regex manager to track synapse-sdk via npm versions (and tightens filecoin-pin matching). |
| README.md | Updates usage docs to include filecoin-pin and the new Synapse-driven scenario entrypoint. |
| ci/README.md | Documents synapse-sdk runtime dependency resolution + clarifies override support in npm mode. |
| ci/dependency-profiles.json | Switches synapse-sdk default/stability selections from git tags to npm version (incl. latest). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Instead of cloning example-storage-e2e.js and having to npm install the whole of synapse, we instead implement all of our client code in here and pull in Synapse as a dependency as it's supposed to be used. Frontier runs will still clone Synapse but will do a minimal prod npm install and avoid build. We use the Typescript directly, without compile, and rewrite the source paths from dist/ to src/ dynamically. This change also splits up the storage e2e testing in a way that's more explicit and verbose for our needs and also easier to extend to cover new variations of concerns. Closes: #179 Closes: #180
rvagg
force-pushed
the
rvagg/synapse-npm
branch
from
August 24, 2026 11:48
071fa51 to
1de0350
Compare
Contributor
Author
|
Will follow this up with a replacement of the master clone strategy when we have the intertmediate commits for synapse available for download as an npm tarball. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of cloning example-storage-e2e.js and having to npm install the whole of synapse, we instead implement all of our client code in here and pull in Synapse as a dependency as it's supposed to be used. Frontier runs will still clone Synapse but will do a minimal prod npm install and avoid build. We use the Typescript directly, without compile, and rewrite the source paths from dist/ to src/ dynamically.
This change also splits up the storage e2e testing in a way that's more explicit and verbose for our needs and also easier to extend to cover new variations of concerns.
Closes: #179
Closes: #180