#!/usr/bin/env bash # Runs every execution-layer attack in priority order (1, 2, 5, 3, 6, 4), starting and stopping the right network # for each, and prints a one-line pass/fail per scenario. Detail in results/*.json. set -u HERE="$(cd "$(dirname "$0")" && pwd)" cd "$HERE" mkdir -p results wait_rpc() { local t=0; until [ "$(curl -s -m2 -X POST http://127.0.0.1:$1 -H 'content-type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' | grep -o '0x[0-9a-f]*' | head -1)" != "0x0" ] 2>/dev/null || [ $t -ge 40 ]; do sleep 2; t=$((t+2)); done; } echo "== build check ==" test -x ../../vendor/igneum-node-exec-attacks/target/release/igneum-inject || { echo "build igneum-inject first (see README)"; exit 1; } node compile.mjs >/dev/null # Scenarios 1, 2, 5, 3 run on the hub network with one honest miner. ./net.sh stop >/dev/null 2>&1 ./net.sh start 1 >/dev/null 2>&1 wait_rpc 27690 for s in scenario1_malformed scenario2_nonce scenario5_rpcfuzz scenario3_pgas; do echo "== $s ==" node $s.mjs | tail -1 done ./net.sh stop >/dev/null 2>&1 # Scenario 6 manages its own split network across several partition depths. echo "== scenario6_reorg ==" ./run_scenario6.sh | tail -2 # Scenario 4 needs the single-miner hub (sender = payee = miner for self-dealing). ./net.sh start 1 >/dev/null 2>&1 wait_rpc 27690 echo "== scenario4_registry ==" node scenario4_registry.mjs | tail -1 ./net.sh stop >/dev/null 2>&1 echo "== done; see results/*.json =="