[2025-11-11 00:16:14] ======================================== [2025-11-11 00:16:14] MEV Bot V2 - Safety Mechanisms Testing [2025-11-11 00:16:14] ======================================== [2025-11-11 00:16:14] [2025-11-11 00:16:14] TEST 1: Starting Anvil fork... [2025-11-11 00:16:16] Waiting for Anvil to start (PID: 700525)... ✅ PASS: Anvil started successfully at block 398938510 [2025-11-11 00:16:21] Test account balance: 10000000000000000000000 wei ✅ PASS: Test account has balance [2025-11-11 00:16:21] TEST 2: Creating safety configuration... ✅ PASS: Safety configuration created [2025-11-11 00:16:21] Configuration file: /docker/mev-beta/.env.safety.test [2025-11-11 00:16:21] TEST 3: Building Docker image... ✅ PASS: Docker image built successfully [2025-11-11 00:18:03] TEST 4: Deploying bot with safety configuration... [2025-11-11 00:18:04] Waiting for bot initialization (10 seconds)... ✅ PASS: Bot deployed and running [2025-11-11 00:18:15] Initial bot logs: {"time":"2025-11-10T23:18:19.553853136Z","level":"INFO","msg":"connected to sequencer","component":"sequencer_reader"} {"time":"2025-11-10T23:18:19.554597142Z","level":"ERROR","msg":"subscription failed","component":"sequencer_reader","error":"subscription response failed: read tcp 127.0.0.1:50720->127.0.0.1:8545: i/o timeout"} {"time":"2025-11-10T23:18:19.558147557Z","level":"INFO","msg":"connected to sequencer","component":"sequencer_reader"} {"time":"2025-11-10T23:18:19.558393174Z","level":"ERROR","msg":"subscription failed","component":"sequencer_reader","error":"subscription response failed: read tcp 127.0.0.1:50724->127.0.0.1:8545: i/o timeout"} {"time":"2025-11-10T23:18:19.560142193Z","level":"INFO","msg":"connected to sequencer","component":"sequencer_reader"} {"time":"2025-11-10T23:18:19.56020455Z","level":"ERROR","msg":"subscription failed","component":"sequencer_reader","error":"subscription response failed: read tcp 127.0.0.1:50740->127.0.0.1:8545: i/o timeout"} {"time":"2025-11-10T23:18:19.562229352Z","level":"INFO","msg":"connected to sequencer","component":"sequencer_reader"} {"time":"2025-11-10T23:18:19.5623034Z","level":"ERROR","msg":"subscription failed","component":"sequencer_reader","error":"subscription response failed: read tcp 127.0.0.1:50756->127.0.0.1:8545: i/o timeout"} {"time":"2025-11-10T23:18:19.563225047Z","level":"INFO","msg":"connected to sequencer","component":"sequencer_reader"} {"time":"2025-11-10T23:18:19.563288796Z","level":"ERROR","msg":"subscription failed","component":"sequencer_reader","error":"subscription response failed: read tcp 127.0.0.1:50772->127.0.0.1:8545: i/o timeout"} {"time":"2025-11-10T23:18:19.564072176Z","level":"INFO","msg":"connected to sequencer","component":"sequencer_reader"} {"time":"2025-11-10T23:18:19.564132338Z","level":"ERROR","msg":"subscription failed","component":"sequencer_reader","error":"subscription response failed: read tcp 127.0.0.1:50782->127.0.0.1:8545: i/o timeout"} {"time":"2025-11-10T23:18:19.564845165Z","level":"INFO","msg":"connected to sequencer","component":"sequencer_reader"} {"time":"2025-11-10T23:18:19.564923832Z","level":"ERROR","msg":"subscription failed","component":"sequencer_reader","error":"subscription response failed: read tcp 127.0.0.1:50798->127.0.0.1:8545: i/o timeout"} {"time":"2025-11-10T23:18:19.5655022Z","level":"INFO","msg":"connected to sequencer","component":"sequencer_reader"} {"time":"2025-11-10T23:18:19.565600643Z","level":"ERROR","msg":"subscription failed","component":"sequencer_reader","error":"subscription response failed: read tcp 127.0.0.1:50814->127.0.0.1:8545: i/o timeout"} {"time":"2025-11-10T23:18:19.566620042Z","level":"INFO","msg":"connected to sequencer","component":"sequencer_reader"} {"time":"2025-11-10T23:18:19.566684413Z","level":"ERROR","msg":"subscription failed","component":"sequencer_reader","error":"subscription response failed: read tcp 127.0.0.1:50816->127.0.0.1:8545: i/o timeout"} {"time":"2025-11-10T23:18:19.567953186Z","level":"INFO","msg":"connected to sequencer","component":"sequencer_reader"} {"time":"2025-11-10T23:18:19.568272852Z","level":"ERROR","msg":"subscription failed","component":"sequencer_reader","error":"subscription response failed: read tcp 127.0.0.1:50824->127.0.0.1:8545: i/o timeout"} [2025-11-11 00:18:19] TEST 5: Verifying safety configuration loaded... [2025-11-11 00:18:24] ✓ Dry-run mode detected in logs [2025-11-11 00:18:24] ✓ Circuit breaker mentioned in logs [2025-11-11 00:18:25] ✓ Position size limits mentioned [2025-11-11 00:18:25] ✓ Chain ID (42161) confirmed [2025-11-11 00:18:25] ✓ RPC URL pointing to local Anvil ✅ PASS: Safety configuration verified (5/5 checks) [2025-11-11 00:18:25] TEST 6: Testing emergency stop mechanism... [2025-11-11 00:18:25] Bot is running, creating emergency stop file... ❌ FAIL: Emergency stop file not created [2025-11-11 00:18:25] WARNING: Emergency stop needs verification [2025-11-11 00:18:25] TEST 7: Testing circuit breaker (simulation)... [2025-11-11 00:18:26] Checking circuit breaker configuration in logs... ✅ PASS: Circuit breaker configuration detected [2025-11-11 00:18:33] Circuit breaker settings: {"time":"2025-11-10T23:18:05.358310578Z","level":"INFO","msg":"circuit breaker","enabled":true,"max_consecutive_losses":3,"max_hourly_loss_eth":"0.1000","max_daily_loss_eth":"0.5000"} [2025-11-11 00:18:33] WARNING: Full circuit breaker testing requires actual losing trades (testnet recommended) [2025-11-11 00:18:33] TEST 8: Verifying position size limits... ✅ PASS: Position size limits configured [2025-11-11 00:18:43] Position limit settings: {"time":"2025-11-10T23:18:05.358293387Z","level":"INFO","msg":"risk limits","max_position_size_eth":"-8.4467","max_daily_volume_eth":"7.7663","max_slippage_bps":200,"max_gas_price_gwei":50} [2025-11-11 00:18:43] TEST 9: Creating test swap to trigger detection... [2025-11-11 00:18:44] Pool accessible, creating test swap... ✅ PASS: Test swap created: 0xd9840410a8469f02fe8f026e72e3fb00f12bacaa0c6416cc87feca9e908579e4 [2025-11-11 00:18:47] Waiting 5 seconds for bot to detect swap... [2025-11-11 00:19:00] WARNING: Bot may not have detected swap (expected for dry-run mode) [2025-11-11 00:19:00] Recent logs: {"time":"2025-11-10T23:19:00.616702976Z","level":"INFO","msg":"connected to sequencer","component":"sequencer_reader"} {"time":"2025-11-10T23:19:00.616745655Z","level":"ERROR","msg":"subscription failed","component":"sequencer_reader","error":"subscription response failed: read tcp 127.0.0.1:35910->127.0.0.1:8545: i/o timeout"} {"time":"2025-11-10T23:19:00.642343076Z","level":"INFO","msg":"connected to sequencer","component":"sequencer_reader"} {"time":"2025-11-10T23:19:00.642480482Z","level":"ERROR","msg":"subscription failed","component":"sequencer_reader","error":"subscription response failed: read tcp 127.0.0.1:35918->127.0.0.1:8545: i/o timeout"} {"time":"2025-11-10T23:19:00.657531724Z","level":"INFO","msg":"connected to sequencer","component":"sequencer_reader"} {"time":"2025-11-10T23:19:00.657698034Z","level":"ERROR","msg":"subscription failed","component":"sequencer_reader","error":"subscription response failed: read tcp 127.0.0.1:35920->127.0.0.1:8545: i/o timeout"} {"time":"2025-11-10T23:19:00.688846047Z","level":"INFO","msg":"connected to sequencer","component":"sequencer_reader"} {"time":"2025-11-10T23:19:00.689098528Z","level":"ERROR","msg":"subscription failed","component":"sequencer_reader","error":"subscription response failed: read tcp 127.0.0.1:35922->127.0.0.1:8545: i/o timeout"} {"time":"2025-11-10T23:19:00.710854682Z","level":"INFO","msg":"connected to sequencer","component":"sequencer_reader"} {"time":"2025-11-10T23:19:00.715868554Z","level":"ERROR","msg":"subscription failed","component":"sequencer_reader","error":"subscription response failed: read tcp 127.0.0.1:35932->127.0.0.1:8545: i/o timeout"} [2025-11-11 00:19:00] TEST 10: Verifying dry-run mode (no real transactions)... [2025-11-11 00:19:00] Wallet transaction count: 14036 ❌ FAIL: Unexpected transactions detected (nonce: 14036) [2025-11-11 00:19:20] WARNING: Dry-run confirmation not explicit in logs [2025-11-11 00:19:20] [2025-11-11 00:19:20] ======================================== [2025-11-11 00:19:20] Test Summary [2025-11-11 00:19:20] ======================================== [2025-11-11 00:19:20] Tests Passed: 9 [2025-11-11 00:19:20] Tests Failed: 2 [2025-11-11 00:19:20] Total Tests: 11 [2025-11-11 00:19:20] [2025-11-11 00:19:20] Generating test report... [2025-11-11 00:19:20] Test report generated: /docker/mev-beta/SAFETY_TEST_RESULTS.md [2025-11-11 00:19:20] ======================================== [2025-11-11 00:19:20] Test Complete [2025-11-11 00:19:20] ======================================== [2025-11-11 00:19:20] Results: /docker/mev-beta/SAFETY_TEST_RESULTS.md [2025-11-11 00:19:20] Logs: /docker/mev-beta/safety_test.log [2025-11-11 00:19:20] [2025-11-11 00:19:20] ⚠️ Some tests failed. Review results before proceeding. [2025-11-11 00:19:20] Cleaning up test environment... mev-bot-v2-safety-test mev-bot-v2-safety-test [2025-11-11 00:19:21] Cleanup complete