UNPKG

@nori-zk/mina-token-bridge

Version:

Nori ethereum state settelment and nETH token bridge zkApp

55 lines (54 loc) 1.9 kB
/** * loadRunner.ts — Continuous Nori bridge load generator * * Long-running script that mimics N users repeatedly exercising the * bridge (Ethereum lock → Mina mint) to stress-test WSS, worker * lifecycle, and the 32-root deposit window on mesa-testnet. * * Per flow: * - Fresh TokenBridgeWorker (spawned and signalTerminate'd each run). * - Dedicated WSS connection per user (not shared). * - Full flow mirrors minimal-client/src/index.spec.ts. * - Randomised post-canMint delay (see pickClaimDelayUpdates). * * Minimal env: * ETH_RPC_URL=https://sepolia.infura.io/v3/<key> * LOAD_USER_ETH_PRIV_KEYS=0x<key1>,0x<key2>,0x<key3> * LOAD_USER_MINA_PRIV_KEYS=EKE<key1>,EKE<key2>,EKE<key3> * * Common optional env: * LOAD_USER_LABELS=alice,bob,carol * LOAD_LOCK_AMOUNTS_ETH=0.0001 * LOAD_BASE_TICK_MINUTES=2 * LOAD_MAX_CONCURRENT=2 * LOAD_MAX_CONCURRENT_COMPILES=5 * LOAD_PER_USER_COOLDOWN_MINUTES=5 * LOAD_MINT_GATE_TIMEOUT_MINUTES=120 * LOAD_LOG_DIR=./logs/loadRunner * * See parseEnv() for the full list and defaults. * * Logs under LOAD_LOG_DIR: * loadRunner.log — scheduler decisions + user state transitions * loadRunner.<label>.log — per-user stage log * loadRunner.summary.jsonl — one JSON line per completed flow * stdout — everything + live bridge observer * * Shutdown: SIGINT/SIGTERM = immediate exit (in-flight flows NOT drained). */ import 'dotenv/config'; export type ObserverSnapshot = { wsState: string; latestBridge: { stage_name: string; input_slot: number | string; output_slot: number | string; elapsed_sec: number | string; } | null; latestEth: { latest_finality_slot: number | string; latest_finality_block_number: number | string; } | null; lastBridgeAt: number; lastEthAt: number; };