Skip to content

feat: Remove synapse-sdk dependency, --notest becomes the norm, cleanup unused scripts.#70

Merged
redpanda-f merged 5 commits intomainfrom
rvagg/synapse038
Mar 2, 2026
Merged

feat: Remove synapse-sdk dependency, --notest becomes the norm, cleanup unused scripts.#70
redpanda-f merged 5 commits intomainfrom
rvagg/synapse038

Conversation

@rvagg
Copy link
Contributor

@rvagg rvagg commented Feb 28, 2026

Replace JS post-deploy-setup.js dependency with native cast send calls for client payment setup (ERC20 approve, FP deposit, FWSS operator approval). Switch from individual contract address env vars to NETWORK=devnet with mounted devnet-info.json. Update default synapse-sdk commit to v0.38.0.

…for synapse E2E

Replace JS post-deploy-setup.js dependency with native cast send calls for
client payment setup (ERC20 approve, FP deposit, FWSS operator approval).
Switch from individual contract address env vars to NETWORK=devnet with
mounted devnet-info.json. Update default synapse-sdk commit to v0.38.0.
Copilot AI review requested due to automatic review settings February 28, 2026 04:51
@FilOzzy FilOzzy added this to FOC Feb 28, 2026
@github-project-automation github-project-automation bot moved this to 📌 Triage in FOC Feb 28, 2026
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

This PR updates the Synapse E2E test step to configure client payments using cast send transactions (instead of the synapse-sdk post-deploy-setup.js helper) and to drive synapse-sdk configuration via a mounted devnet-info.json (using NETWORK=devnet), while also bumping the default synapse-sdk pinned commit.

Changes:

  • Replace JS post-deploy setup dependency with Rust-driven cast send calls for ERC20 approve, FilecoinPay deposit, and FWSS operator approval.
  • Export devnet-info.json during the Synapse E2E step and mount it into the test container for synapse-sdk consumption.
  • Update default synapse-sdk pinned commit.

Reviewed changes

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

Show a summary per file
File Description
src/external_api/export.rs Allows early devnet-info.json export by defaulting startup_duration when step timing isn’t present yet.
src/external_api/devnet_info.rs Documents user funding/FOC setup expectations for Synapse E2E usage.
src/config.rs Bumps the default synapse-sdk commit pin.
src/commands/start/synapse_test_e2e/synapse_test_step.rs Implements cast-based client payment setup and switches synapse-sdk config to devnet-info mounting.
README_ADVANCED.md Updates the documented Synapse E2E step behavior and outputs.
README.md Updates “Use the Network” guidance to reference devnet-info export and synapse-sdk usage.

Comment on lines 43 to +45
startup_duration: ctx
.get("step_timing_total_execution_time")
.expect("step_timing_total_execution_time not found in context"),
.unwrap_or_else(|| "in-progress".to_string()),
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

startup_duration is now defaulted to "in-progress" when step_timing_total_execution_time is missing. This avoids the early-export panic, but it also makes missing step timing silent in the final export. Consider logging a warning when the key is absent (and optionally keeping the hard failure for the final export path) so regressions don’t go unnoticed while still supporting the early devnet-info export needed by the Synapse step.

Copilot uses AI. Check for mistakes.
See [examples/README.md](examples/README.md) for how you can easily consume network addresses, parameters, etc. and hook them into Synapse, etc.
After startup, `USER_1` is fully configured for FOC: USDFC deposited into FilecoinPay and FWSS approved as an operator. You can use it immediately with synapse-sdk:

```bash
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

The README example runs node utils/example-storage-e2e.js ... without indicating that it must be executed from the synapse-sdk repo directory (or via a wrapper command). As written, this will fail for users running it from the foc-devnet repo root because utils/example-storage-e2e.js isn’t present there. Update the snippet to cd into ~/.foc-devnet/code/synapse-sdk (or document the correct working directory) before running the command.

Suggested change
```bash
```bash
cd ~/.foc-devnet/code/synapse-sdk

Copilot uses AI. Check for mistakes.
Comment on lines +228 to +234
&[
"run",
"--name",
container_name,
"--network",
"host",
BUILDER_DOCKER_IMAGE,
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

cast_send uses docker run --name ... without --rm and without removing any existing container of the same name. If a previous run left the container behind (or this step is re-run after a failure), docker run will fail with a name conflict and these one-shot containers will accumulate on disk. Align with other cast invocations in the repo by adding --rm and/or calling stop_and_remove_container(container_name) before docker run.

Copilot uses AI. Check for mistakes.
Comment on lines 272 to 279
let mut args = vec![
"run".to_string(),
"--name".to_string(),
format!("foc-{}-synapse-test", params.run_id),
format!("foc-{}-synapse-test", run_id),
"--network".to_string(),
"host".to_string(),
"-u".to_string(),
"root".to_string(),
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

The test container is started with a fixed --name but without --rm (and without pre-removal). This can cause the Synapse E2E step to fail on subsequent runs due to container name conflicts, and it leaves stopped containers behind. Consider adding --rm and/or ensuring the container is removed before starting it (e.g., via stop_and_remove_container).

Copilot uses AI. Check for mistakes.
Comment on lines +221 to +241
context: &SetupContext,
container_name: &str,
cast_cmd: &str,
log_key: &str,
) -> Result<(), Box<dyn Error>> {
let output = run_and_log_command(
"docker",
&[
"run",
"--name",
container_name,
"--network",
"host",
BUILDER_DOCKER_IMAGE,
"bash",
"-c",
cast_cmd,
],
context,
log_key,
)?;
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

The cast commands include --private-key ... inside cast_cmd, and run_and_log_command persists the full command string into step_context.json via context.save_command(...). This effectively writes USER_1’s private key to disk in command history, which is an unnecessary exposure even for a devnet. Consider redacting the private key before logging (e.g., replace it with <redacted> in the saved command) or pass the key via an environment variable / stdin so it isn’t recorded verbatim.

Suggested change
context: &SetupContext,
container_name: &str,
cast_cmd: &str,
log_key: &str,
) -> Result<(), Box<dyn Error>> {
let output = run_and_log_command(
"docker",
&[
"run",
"--name",
container_name,
"--network",
"host",
BUILDER_DOCKER_IMAGE,
"bash",
"-c",
cast_cmd,
],
context,
log_key,
)?;
_context: &SetupContext,
container_name: &str,
cast_cmd: &str,
log_key: &str,
) -> Result<(), Box<dyn Error>> {
let output = docker_command(&[
"run",
"--name",
container_name,
"--network",
"host",
BUILDER_DOCKER_IMAGE,
"bash",
"-c",
cast_cmd,
])
.output()?;

Copilot uses AI. Check for mistakes.
Comment on lines 77 to 104
let synapse_sdk_path = foc_devnet_synapse_sdk_repo();
let builder_volumes_dir =
foc_devnet_docker_volumes_cache().join(crate::constants::BUILDER_CONTAINER);
let random_file_path = create_random_test_file(&self.run_dir)?;
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

execute is doing several distinct responsibilities (exporting devnet-info, on-chain payment setup, waiting, file generation, docker invocation, and output handling) and has grown well beyond the project’s guideline of keeping functions small. To improve maintainability, consider extracting these into focused helpers (e.g., export_devnet_info_for_e2e, run_storage_e2e_container, etc.) and/or splitting the step into submodules (payments, docker runner, script).

Copilot generated this review using guidance from repository custom instructions.
@BigLep BigLep moved this from 📌 Triage to 🔎 Awaiting review in FOC Feb 28, 2026
@BigLep BigLep requested a review from redpanda-f February 28, 2026 22:17
@redpanda-f
Copy link
Collaborator

redpanda-f commented Mar 2, 2026

In general, if we are going this direction, we should make --notest the norm for foc-devnet start. We are essentially hoisting up the code that was earlier in a separate repo (synapse-sdk). This way:

  • we are reducing inter-repo code issues
  • But, duplicating logic in some ways

However, it is net good. Much of foc-devnet does hoist a lot of other setup scripts anyways.

My recommendation here would be to strip synapse_test_step.rs entirely, and move it into something like post_setup.rs etc, and remove the e2e testing script (utils/example-storage-e2e.js) call entirely, as even that is going to have PNPM issues.

We are going into a regime where testing / nightlies are separate workflows and actions anyways, so CI.yml can just be checking for foc-devnet "start"/"stop" health. These other e2e tests should be separate workflows.

@rvagg
Copy link
Contributor Author

rvagg commented Mar 2, 2026

Some additional constraints to consider: the utils/ dir in Synapse needs to be retired. The post-deploy-setup script dind't get updated in the last batch of work because it basically doesn't get used by anyone now in practice, except here, so we should have caught that and migrated away here earlier. We may expose the examples/cli stuff as a separate package in future, I think that might work out well. But, maybe what we should be doing is using filecoin-pin to do the final e2e testing. I'm just finishing up the multi-copy/durability work in there but when that's in, we should consider just running it in here with npx, so we get deterministic package contents to run and pin to a specific version. There's not really a whole lot of value in even cloning synapse in here since it's not used for anything other than running that example script, so we should move away from that eventually.

@redpanda-f
Copy link
Collaborator

Taking over this PR

  • Will make --notest the norm
  • Will remove any JS test
  • Will remove synapse-sdk dependency

@redpanda-f redpanda-f changed the title feat(synapse-test): use cast-based client setup and devnet-info.json for synapse E2E feat: Remove synapse-sdk dependency, --notest becomes the norm, cleanup unused scripts. Mar 2, 2026
@redpanda-f
Copy link
Collaborator

redpanda-f commented Mar 2, 2026

I am fine with all of @rvagg 's changes prior to my commits. Would request review from @rvagg , flipping assignees and reviewer.

Edit: seems like I cannot get rod to be a reviewer :P

@redpanda-f redpanda-f assigned redpanda-f and unassigned rvagg Mar 2, 2026
@redpanda-f redpanda-f removed their request for review March 2, 2026 04:32
redpanda-f added a commit that referenced this pull request Mar 2, 2026
redpanda-f added a commit that referenced this pull request Mar 2, 2026
feat: workflow testing for pdp-caching-layer being populated
feat: devnet-setup is a separate composable action
add: matrix for CI, allow testing with and without synapse-sdk
remove: synapse-sdk dependency, part of #70
remove: e2e-test-pdp-caching-layers.yml
remove: Testing Procedure document
fix: include StdErr in logs, go uses it
fix: matrix uses notest
fix: constants add:
fix: CURIO_LOG_LEVEL hoist
fix: remove advertised_address so CQL does not fail on DDL
Update src/commands/start/curio/db_setup.rs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@redpanda-f
Copy link
Collaborator

Have approval from @rvagg here, merging

@github-project-automation github-project-automation bot moved this from 🔎 Awaiting review to ✔️ Approved by reviewer in FOC Mar 2, 2026
@redpanda-f redpanda-f merged commit f6e4721 into main Mar 2, 2026
2 checks passed
@github-project-automation github-project-automation bot moved this from ✔️ Approved by reviewer to 🎉 Done in FOC Mar 2, 2026
@redpanda-f redpanda-f deleted the rvagg/synapse038 branch March 2, 2026 13:50
@redpanda-f redpanda-f added this to the M4.2: mainnet GA milestone Mar 2, 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.

3 participants