Skip to content

feat(synapse): run local client using synapse as library - #182

Merged
rvagg merged 1 commit into
mainfrom
rvagg/synapse-npm
Aug 25, 2026
Merged

feat(synapse): run local client using synapse as library#182
rvagg merged 1 commit into
mainfrom
rvagg/synapse-npm

Conversation

@rvagg

@rvagg rvagg commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

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

Copilot AI lite review requested due to automatic review settings August 24, 2026 10:40
@rvagg
rvagg requested a review from beck-8 as a code owner August 24, 2026 10:40
@FilOzzy FilOzzy added this to FOC Aug 24, 2026
@github-project-automation github-project-automation Bot moved this to 📌 Triage in FOC Aug 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 SynapseRuntime that can install a minimal consumer package.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/srcsrc 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.

Comment thread scenarios/test_basic_balances.py
Comment thread scripts/tests/test_scenario_dependencies.py
Comment thread scenarios/helpers.py
Comment thread scenarios/synapse_runtime.py
Comment thread scenarios/synapse_runtime.py
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
rvagg force-pushed the rvagg/synapse-npm branch from 071fa51 to 1de0350 Compare August 24, 2026 11:48
@FilOzzy FilOzzy moved this from 📌 Triage to 🔎 Awaiting review in FOC Aug 25, 2026
@rvagg

rvagg commented Aug 25, 2026

Copy link
Copy Markdown
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.

@rvagg
rvagg merged commit d059da1 into main Aug 25, 2026
3 checks passed
@rvagg
rvagg deleted the rvagg/synapse-npm branch August 25, 2026 05:23
@github-project-automation github-project-automation Bot moved this from 🔎 Awaiting review to 🎉 Done in FOC Aug 25, 2026
rvagg added a commit that referenced this pull request Aug 26, 2026
Install only the production dependency closure and resolve peers under
Synapse's pnpm security policy. Add EIP-2612 support to MockUSDFC so
fresh devnet accounts can fund uploads through Synapse.

#182 didn't quite work in
resolving #179
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.

Extract synapse scripts to this repository

3 participants