feat: Remove synapse-sdk dependency, --notest becomes the norm, cleanup unused scripts.#70
feat: Remove synapse-sdk dependency, --notest becomes the norm, cleanup unused scripts.#70redpanda-f merged 5 commits intomainfrom
--notest becomes the norm, cleanup unused scripts.#70Conversation
…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.
There was a problem hiding this comment.
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 sendcalls for ERC20 approve, FilecoinPay deposit, and FWSS operator approval. - Export
devnet-info.jsonduring 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. |
| 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()), |
There was a problem hiding this comment.
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.
| 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 |
There was a problem hiding this comment.
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.
| ```bash | |
| ```bash | |
| cd ~/.foc-devnet/code/synapse-sdk |
| &[ | ||
| "run", | ||
| "--name", | ||
| container_name, | ||
| "--network", | ||
| "host", | ||
| BUILDER_DOCKER_IMAGE, |
There was a problem hiding this comment.
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.
| 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(), |
There was a problem hiding this comment.
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).
| 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, | ||
| )?; |
There was a problem hiding this comment.
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.
| 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()?; |
| 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)?; |
There was a problem hiding this comment.
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).
|
In general, if we are going this direction, we should make
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 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. |
|
Some additional constraints to consider: the |
|
Taking over this PR
|
--notest becomes the norm, cleanup unused scripts.
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>
|
Have approval from @rvagg here, merging |
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.