Skip to content

Add a manual 10-actor concurrent Ethereum-to-Solana swap FlowScenario with 21-producer/21-batch-operator settlement, Solana-memory, and post-load epoch-stall diagnostics - #64

Closed
joshglogau wants to merge 1 commit into
feature/cluster-readinessfrom
agent/flow-swap-epoch-stress
Closed

Add a manual 10-actor concurrent Ethereum-to-Solana swap FlowScenario with 21-producer/21-batch-operator settlement, Solana-memory, and post-load epoch-stall diagnostics#64
joshglogau wants to merge 1 commit into
feature/cluster-readinessfrom
agent/flow-swap-epoch-stress

Conversation

@joshglogau

Copy link
Copy Markdown

Summary

Adds a new manual-only flow-swap-epoch-stress FlowScenario that turns the SIM2 swap load which surfaced the Solana terminal/epoch-stall issue into a reproducible, report-first local test.

The existing live-cluster wire-cluster-tool readiness command is unchanged. Readiness remains the read-only SIM2 health tool; this scenario owns a fresh local cluster and applies destructive load for debugging.

Reproduction shape

  • bootstraps 21 producer accounts and 21 batch operators
  • bonds one real underwriter on both Ethereum and Solana using the existing WireUnderwriterTool flow machinery
  • creates 10 distinct prefunded Ethereum HD wallets and 10 distinct Solana recipients
  • computes one live pre-load ETH-to-SOL quote from the seeded PRIMARY reserves
  • launches all 10 ReserveManager.requestSwap writes in a single parallel FlowScenario phase
  • verifies all 10 Solana destination payouts independently
  • compares typed sysio.uwrit::uwreqs rows against the pre-load baseline and requires exactly 10 new CONFIRMED requests
  • requires three WIRE epoch advances after load, which converts the observed epoch stall into an explicit failing Step
  • inspects the 100 most recent Solana outpost transactions for memory-allocation, out-of-memory, or heap-violation evidence

Report/debugging behavior

Every on-chain write is its own typed Step. The standard Markdown, HTML, and CSV FlowScenario report captures:

  • actor index, Ethereum sender, Solana recipient, source amount, target amount, transaction hash, and block
  • per-recipient balance before/after and payout expectation
  • pre-load and post-load epoch indices
  • new UWREQ IDs, statuses, total count, and CONFIRMED count
  • Solana program-log read failures and matching memory/heap errors
  • all automatically recorded WIRE, Ethereum, and Solana client calls

The stress phases use collect-mode failure handling so terminal diagnostics still execute after individual request or payout failures.

Manual execution

Run locally with the canonical runner and heartbeat monitor in separate terminals:

node scripts/run-flow.mjs flow-swap-epoch-stress \
  --cluster-path /tmp/wire-flow-swap-epoch-stress \
  --wire-build-path ../wire-sysio/build/debug \
  --ethereum-path ../wire-ethereum \
  --solana-path ../wire-solana

node scripts/flow-heartbeat-monitor.mjs \
  --cluster-path /tmp/wire-flow-swap-epoch-stress

The flow is intentionally not part of normal E2E execution because it can take at least 138 minutes. The companion build-system draft PR Wire-Network/wire-platform-build-system#25 makes flow-swap-epoch-stress the default FLOW_EXCLUDE value while preserving explicit on-demand runs.

Expected regression signal

On a Solana revision with the previously observed terminal/validator failure, the report should show incomplete destination payouts and/or UWREQ settlement, a post-load epoch that cannot advance by three, and any available memory/heap log evidence. On a corrected revision, all 10 requests and payouts should complete, all 10 UWREQs should be CONFIRMED, recent logs should be clean, and the epoch should advance by at least three.

Validation performed

  • isolated TypeScript check passed: tsc -p packages/flow-swap-epoch-stress/tsconfig.src.json --noEmit --composite false
  • ESLint passed for packages/flow-swap-epoch-stress/src
  • Prettier applied to the new TypeScript sources
  • git diff --check passed
  • full live run not executed in this PR preparation because the scenario is a 138+ minute on-demand test

The full referenced build is currently blocked by a pre-existing type error outside this package: packages/cluster-tool/tests/readiness/ExternalReserveCustodyReader.test.ts constructs an outpost config fixture without the newly required authority field. No readiness source or fixture is changed here.

Branch/base note

This draft targets feature/cluster-readiness so it contains only the new FlowScenario work and does not duplicate the already-open readiness changes from #53. After #53 merges, this PR can be retargeted/rebased onto master without changing the scenario design.

@joshglogau

Copy link
Copy Markdown
Author

Superseded by #65, rebuilt from wire-tools-ts master on feature/swap-epoch-stress-flow so the FlowScenario is fully independent of the cluster-readiness branch.

@joshglogau joshglogau closed this Aug 11, 2026
@siliconswampio
siliconswampio deleted the agent/flow-swap-epoch-stress branch August 11, 2026 17:41
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