Skip to content

Architecture Change to Workload#163

Open
parthshah1 wants to merge 18 commits intoFilecoinFoundationWeb:mainfrom
parthshah1:parth-workload-upgrade
Open

Architecture Change to Workload#163
parthshah1 wants to merge 18 commits intoFilecoinFoundationWeb:mainfrom
parthshah1:parth-workload-upgrade

Conversation

@parthshah1
Copy link
Collaborator

@parthshah1 parthshah1 commented Feb 10, 2026

Summary

This PR delivers two major upgrades — a complete Go rewrite of the stress workload and a dedicated FilWizard container for smart contract deployment — plus a repo cleanup pass to make the codebase ready for external contributors.


Changes

1. Stress Engine — Full Go Rewrite (workload/)

The old shell-script + monolithic-Go workload has been replaced with a clean, modular Go stress engine.

Removed:

  • workload/main.go — old monolithic driver
  • workload/resources/ — all old Go packages (wallets, RPC, compute, consensus, mempool, miner, etc.)
  • workload/main/ — all shell driver scripts
  • workload/patches/synapse-sdk.patch, workload/entrypoint/setup-synapse.sh

Added (workload/cmd/stress-engine/):

  • main.go — flat global state, Antithesis RNG-weighted action deck, multi-node connection management
  • consensus_vectors.go — chain reorg and height increase assertions.
  • evm_vectors.go — EVM/FVM contract interaction stress
  • mempool_vectors.go — mempool spamming and gas-war scenarios
  • reorg_vectors.go — deliberate reorg vector execution
  • contracts.go — embedded contract bytecodes for on-chain deployment
  • helpers.go — shared signing/nonce utilities

Added (workload/cmd/genesis-prep/):

  • main.go — pre-funded wallet generation written to stress_keystore.json

Internal client (workload/internal/chain/client.go):

  • JSON-RPC client for Lotus + Forest with JWT auth

The engine uses sigs.Sign() + MpoolPush() for local signing (no wallet API dependency), Antithesis SDK for reproducible randomness and liveness/safety assertions, and reads node config from STRESS_* env vars.


2. FilWizard — Dedicated Contract Deployment Container (filwizard/)

Contract deployment logic has been extracted from the workload entrypoint into its own container, keeping concerns separate and enabling the workload to start cleanly after contracts are deployed.

  • filwizard/Dockerfile — multi-stage build: compiles the FilWizard binary, installs Foundry + abigen, pre-clones and compiles FOC contracts at image-build time for air-gapped operation
  • filwizard/entrypoint.sh — orchestrates the full setup sequence: wait for chain → deploy FOC contracts → export contract addresses → generate Curio env → create/fund client wallet → mint USDFC tokens → register Curio SP → add SP to FWSS global whitelist → signal healthy
  • filwizard/scripts/register-service-provider.js — ethers.js script: registers a Curio SP with all required PDP capability keys and 5 FIL fee
  • filwizard/scripts/warm-add.js — ethers.js script: calls addApprovedProvider() (owner-only) on the FWSS contract
  • filwizard/scripts/export-environment.sh — bash+jq script that reads deployments.json and writes a portable .env file

4. Repo Cleanup

Deleted:

  • docker-compose2.yaml — stale alternate compose (no longer needed)
  • workload/stress-engine — accidentally committed 38MB compiled binary

Fixed:

  • docker-compose.yaml — corrected image tags (lotus:testlotus:latest, workload:testworkload:latest); added profiles: ["foc"] to filwizard, curio, and yugabyte so the base protocol stack runs without them (make up) and the full FOC stack opts in (docker compose --profile foc up)
  • Dockerfile — removed broken COPY docker-compose2.yaml and invalid COPY ../data; added COPY ./workload /workload
  • Makefile — removed cd config && from up/down/logs/restart/cleanup (there is no config/ dir); added -include versions.env
  • cleanup.sh — removed unnecessary sudo from rm -rf
  • .env — removed 16 dead variable definitions for Lotus 2–4, Miner 2–4, and Forest 1–2 (none of these nodes exist in compose)
  • build_push_filwizard.yml — fixed input name mismatch (workload_tagfilwizard_tag)
  • run_antithesis_test.yml — added filwizard input parameter; added filwizard:* to all image strings (manual dispatch + all 4 scheduled runs)
  • README.md — updated container count (9 base / 12 with --profile foc), removed stale docker exec workload CLI commands and workload/resources/config.json reference, added FilWizard to architecture, updated directory structure

Added:

  • versions.env — version pinning file; change LOTUS_COMMIT, FOREST_COMMIT, etc. here and push a PR to test a new client version (will be wired into CI in a follow-up)

Test Plan

  • make build-workload builds the workload image without errors
  • make up starts the protocol stack without errors (no cd config failure)
  • docker compose --profile foc up brings all 12 services healthy: drand → lotus → filwizard → curio → workload
  • FilWizard container reaches /tmp/healthy and contract addresses appear in /shared/environment.env
  • Stress engine connects to all nodes, begins action loop, and logs action names from the weighted deck
  • Antithesis assert.Sometimes / assert.Always properties fire correctly during a test run

@parthshah1 parthshah1 requested a review from ryao-01 February 18, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments