Testbed Scope Guide — What Can Be Tested¶
Determining whether an attack is reproducible on Crucible. Covers EVM forkability, archive RPC requirements, fidelity level gating, and practical edge cases learned from real validation sessions.
1. Quick Decision Tree¶
flowchart TD
Q1{"Is the attack on an<br>EVM-compatible chain?"}
No1["❌ Cannot be reproduced.<br>Classify as L1 (narrative only).<br><i>Examples: Solana, Harmony, Cosmos, MPC</i>"]
Q2{"Can the chain be forked<br>at the exploit block?"}
No2["No (archive doesn't serve state)<br>Try a different RPC provider (paid).<br>Result: ❌ Limited to L1/L2 on available chains."]
Q3{"What fidelity level is achievable?"}
L1["L1 (narrative)<br>No runtime checks needed"]
L2["L2 (fork-state)<br>Chains + contracts verified"]
L3["L3 (exact replay)<br>Need exploit tx hash + calldata"]
L4["L4 (multi-chain)<br>Need bridge topology + all chains forkable"]
Q1 -- No --> No1
Q1 -- Yes --> Q2
Q2 -- No --> No2
Q2 -- Yes --> Q3
Q3 --> L1
Q3 --> L2
Q3 --> L3
Q3 --> L4
Quick Sizing Guide¶
| Scenario | Estimated Time | Complexity | Archive RPC Needed? |
|---|---|---|---|
| L1 narrative only | 5-10 min | Low | No |
| L2 single-chain replay | 15-30 min | Medium | Yes (Ethereum only) |
| L2 multi-chain (2 chains) | 30-60 min | Medium-High | Yes (2 chains) |
| L3 exact tx replay | 20-40 min | High | Yes |
| L4 bridge demo (blank forks) | 10-20 min | Medium | No (blank forks) |
| L4 production (real history) | 45-120 min | Very High | Yes (all chains) |
2. EVM Forkability — The Primary Gate¶
What Makes A Chain Forkable¶
Crucible uses Foundry's Anvil to fork EVM chains. A chain is forkable if:
- It's an EVM chain — runs the Ethereum Virtual Machine
- An archive RPC is available at the target block
- The RPC provider serves historical state (not just recent blocks)
- The fork block is within the provider's archive depth
Check Forkability¶
# 1. Test RPC connectivity
curl -s -X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' \
$YOUR_RPC_URL
# 2. Test archive depth (request a specific historical block)
curl -s -X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_getBlockByNumber","params":["0xE4E334",false]}' \
$YOUR_RPC_URL
# Returns block data if archive is available, error if not
# 3. Test contract state at fork block
curl -s -X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_getCode","params":["0xContractAddress","0xE4E334"]}' \
$YOUR_RPC_URL
# Returns bytecode if archive serves state, "0x" if no code at that block
What Makes A Chain NOT Forkable¶
| Issue | Example | Workaround |
|---|---|---|
| Non-EVM chain | Solana, Cosmos, Harmony (non-EVM side) | Cannot fork at all — classify as L1 |
| No archive RPC | Some L2s (ZK-rollups) without archive nodes | Use a paid provider or skip the chain |
| Archive too shallow | Free RPCs only keep 128 recent blocks | Paid archive provider (GetBlock, QuickNode) |
| Rate limited | Free tier limits (10-25 req/s) | Add fallback providers, use fork cache |
| Block too old | BSC block 22M+ exceeds free tier depth | Paid provider; or use a more recent fork block if applicable |
Blank Forks (No RPC Needed)¶
For validation testing (not historical reproduction), use blank forks:
# testbed.local.yaml — blank forks (no RPC, no archive)
chains:
ethereum:
fork_block: null
polygon:
fork_block: null
Blank forks start at block 0 with no state. They're useful for: - Testing bridge plugin lifecycle - Validating cross-chain messaging - Exercising the instrumentation pipeline - Determinism checks
Advantage: Zero RPC dependency, runs entirely offline, fully deterministic.
Blank Fork Caveats (Known Issues)¶
Despite being simpler than archive forks, blank forks can fail in non-obvious ways:
-
--accounts 0 --balance 0anvil crash — Anvil nightly builds may reject this combination on blank forks, exiting silently with no error message. The fork command waits 300s before timing out withConnection refused. Fix: Clean stale caches and retry, or remove--accounts 0 --balance 0and start anvil directly. -
Stale fork cache interference — If
.fork_cache/ethereum/latest/has data from a previous archive fork (different chain ID or block), anvil may fail when initializing the cache for a blank fork. Fix:rm -rf .fork_cache/*before switching between archive and blank forks. -
Orphan processes from previous forks — A stale
uv run crucible forkprocess from a prior attempt may still be running, holding the port. Fix:pkill -9 -f anvil; pkill -9 -f 'crucible fork'; sleep 2; rm -f states/*.meta.json. -
First attempt often fails — The very first blank fork may fail due to cache population. A second attempt (after cleanup) typically succeeds. This is a known anvil behavior.
In short: Blank forks are the most reliable mode once running, but the FIRST fork attempt may need cleanup. See Troubleshooting — Blank Fork Never Ready for detailed recovery.
3. Fidelity Level Requirements¶
Each fidelity level has specific requirements that must be met for the experiment to pass enforcement.
L4 — Multi-Chain Full Reproduction¶
| Requirement | Check | How To Meet |
|---|---|---|
| ≥2 chains in topology | historical_scope.chains |
Configure topology with 2+ chains |
| Bridge plugin | topology.bridge |
Use nomad_bridge, poly_network_bridge, or wormhole_bridge |
excluded_components declared |
reproduction_scope.excluded_components |
List what's not reproduced |
| Fork-state execution evidence | Artifact streams (events, gas, storage) | Attack must interact with forked chain(s) |
| Attack result available | Attack plugin returns AttackResult |
Implement execute() method |
| Trace artifacts complete | All transactions traced | No auto_trace failures |
L4 production experiments require archive RPC on all chains. L4 validation experiments (like l4_full_validation) use blank forks and skip archive RPC entirely.
L3 — Exact Transaction Replay¶
| Requirement | Check | How To Meet |
|---|---|---|
| All L2 requirements | — | — |
exact_tx_replay: true |
reproduction_scope.exact_tx_replay |
Set in evidence.yaml |
exploit_transactions not empty |
historical_scope.exploit_transactions |
List the real exploit tx hashes |
| Transaction execution evidence | tx actions in run.jsonl | Attack must submit the real calldata |
L3 is the most demanding level because it requires: - Reconstructing the exact calldata of the historical exploit transaction - Matching the same gas usage, event emissions, and storage changes - Dealing with proxy contracts, delegate calls, and complex ABI resolution
L2 — Fork-State Behavioral Reproduction¶
| Requirement | Check | How To Meet |
|---|---|---|
| Attack result available | _check_result_available() |
Plugin returns AttackResult |
| Chains in topology | _check_chain_state() |
Evidence chains exist in active topology |
| Trace artifacts complete | artifacts_complete |
No auto_trace failures |
| Contract existence | Artifact streams found | events.jsonl, gas_profile.jsonl, etc. exist |
L2 is the standard benchmark level — all 6 attack packs in the benchmark matrix target L2.
L1 — Conceptual / Narrative Only¶
| Requirement | Check | How To Meet |
|---|---|---|
| Attack result available | _check_result_available() |
Plugin returns something (even None is OK) |
L1 is for attacks that cannot be reproduced on-chain — MPC compromises, non-EVM infrastructure hacks, social engineering attacks.
L0 — No Reproduction Attempted¶
| Requirement | Check | How To Meet |
|---|---|---|
| None | — | Description only |
4. Chain-Specific Availability¶
Ethereum ❖ Best Coverage¶
| Aspect | Status |
|---|---|
| Archive RPC (free) | ✅ LlamaNodes, Ankr, PublicNode work for all attack fork blocks (12M-16M) |
| Forkable from | Block 0 (genesis) |
| Free provider limit | ~25 req/s (enough for single-chain forks) |
| Paid alternatives | Alchemy, Infura, GetBlock, QuickNode |
| Verdict | ✅ Fully supported. All 6 benchmark packs run on Ethereum. |
Polygon ❖ Partial Coverage¶
| Aspect | Status |
|---|---|
| Archive RPC (free) | ⚠️ Ankr works up to ~13M blocks; block 16,332,982 (Poly Network) may fail |
| Forkable from | Depends on provider archive depth |
anvil_setBalance at old blocks |
⚠️ Some archives can't serve state for new accounts at old blocks |
| Verdict | ⚠️ Works with paid archive. Free tier may fail at exploit blocks. Bridge plugins skip gracefully on failure. |
BSC ❖ Limited Coverage¶
| Aspect | Status |
|---|---|
| Archive RPC (free) | ❌ Free tier doesn't cover block 22M+ (BNB Token Hub) |
| Forkable from | Depends on provider |
| Verdict | ⚠️ Paid archive required for exploit blocks. See RPC Provider Guide. |
Harmony ❖ Not Forkable (EVM Side Only)¶
| Aspect | Status |
|---|---|
| Harmony chain (non-EVM) | ❌ Not forkable — uses different consensus |
| Ethereum-side bridge contracts | ✅ Forkable on Ethereum |
| Verdict | ⚠️ Ethereum only. The Harmony chain itself cannot be forked. The Horizon multisig drain is reproduced at L2 on Ethereum. |
Non-EVM Chains (Not Forkable)¶
| Chain | Reason | Classification |
|---|---|---|
| Solana | Not EVM | L1 narrative (wormhole_guardian_bypass) |
| Cosmos / Beacon Chain | Not EVM | L1 narrative (bnb_token_hub_proof) |
| Fantom (Multichain) | MPC compromise, not EVM bug | L1 narrative (multichain_router_permit) |
| Moonriver (Multichain) | MPC compromise | L1 narrative |
5. Multi-Chain & Bridge Requirements¶
When Multi-Chain Works¶
A multi-chain experiment succeeds when all chains in the topology are forkable at their respective blocks with the configured RPC providers.
| Configuration | Works? | Notes |
|---|---|---|
| 2 chains, both blank forks (no RPC) | ✅ Always | L4 validation tests, deterministic |
| Ethereum + Polygon (archive RPC) | ✅ Works | Ethereum fine; Polygon may need paid archive at old blocks |
| Ethereum + Polygon + BSC (archive RPC) | ⚠️ Partial | All 3 need working archives; BSC typically needs paid provider |
| Bridge topology without bridge plugin | ❌ Fails | L4 enforcer requires topology.bridge to be set |
When Multi-Chain Fails¶
- Chain not forkable — Non-EVM chain in topology
- Archive can't serve state — Polygon/BSC at old blocks with free RPC
- Bridge plugin not loaded — Topology doesn't specify a bridge
- Port conflict — Previous fork processes still running (see Troubleshooting)
What L4 Bridge Validation Tests¶
The l4_full_validation attack plugin exercises the full L4 pipeline:
| Phase | What It Validates |
|---|---|
| 1. Multi-chain topology | Both chains configured and reachable |
| 2. Bridge plugin | Bridge loaded and operational |
| 3. Bridge deployment | Contracts deployed on both chains |
| 4. Chain reachability | Both chains respond to RPC |
| 5. Message A→B | Cross-chain message sent on source chain |
| 6. Message B→A | Bidirectional messaging confirmed |
| 7. Acceptance verification | Destination chain accepts the forged message |
| 8. Artifact capture | Instrumentation streams exist |
| 9. Correlation tracking | Cross-chain.jsonl entries recorded |
To run:
# Validates without fidelity enforcement (validation mode)
uv run crucible experiment run experiments/l4_full_validation.yaml --no-baseline --no-fidelity
6. In-Scope vs Out-of-Scope¶
✅ In-Scope (Reproducible)¶
| Category | Examples | Fidelity |
|---|---|---|
| EVM smart contract bugs | Reentrancy, access control, integer overflow | L2-L4 |
| Bridge protocol vulnerabilities | Nomad committedRoot == 0x00, Wormhole guardian bypass |
L2-L4 |
| Cross-chain message forgery | Forged IAVL Merkle proofs, fake VAAs | L2-L4 |
| Compromised key on EVM | Using stolen private key to call contract functions | L2 |
| Malformed calldata | Calling functions with crafted arguments | L2-L3 |
❌ Out-of-Scope (Not Reproducible)¶
| Category | Examples | Classify As |
|---|---|---|
| Non-EVM chain state | Solana, Cosmos, Beacon Chain | L1 narrative |
| Off-chain infrastructure | MPC node compromise, social engineering | L1 narrative |
| Private key compromise | Attacker stole keys outside EVM | L1 narrative (effects may be L2) |
| Centralized exchange hacks | Funds stolen from CEX hot wallet | L1 narrative |
| DNS / BGP attacks | Infrastructure-level attacks on RPC endpoints | L1 narrative |
⚠️ Partial Scope¶
| Scenario | What's Reproducible | What's Not |
|---|---|---|
| Wormhole guardian bypass (Feb 2022) | EVM-side VAA processing via completeTransfer() |
Solana-side sysvar validation (root cause) |
| BNB Token Hub (Oct 2022) | EVM-side handlePackage() call on CrossChain contract |
Beacon Chain IAVL proof verification (root cause) |
| Horizon multisig (Jun 2022) | Ethereum-side bridge contracts, multisig authorization | Harmony chain state, off-chain key compromise |
| Multichain router (Jul 2023) | Nothing — MPC infrastructure compromise | Entire attack happened outside EVM |
7. Common Failure Modes¶
"Port 8545 is already in use"¶
Cause: A previous crucible fork or manual anvil process is still running.
Diagnose:
# Check what's on the port
fuser 8545/tcp # Linux
lsof -i :8545 # macOS/Linux
netstat -ano | findstr :8545 # Windows
# Check if crucible still tracks it
crucible status
Fix:
# Proper cleanup
crucible clean --all
# Force kill orphaned processes
pkill -9 -f anvil
rm -f states/*.meta.json
# If the port stays in TIME_WAIT, wait 30-60s or use a different port
Prevention: Always run crucible clean between experiments. If running in CI/automation, clean stale meta files before forking.
"Chain did not become ready within 300s"¶
Cause: Anvil was spawned but never started listening. Usually because:
1. The RPC URL is unreachable or empty
2. The fork block exceeds the provider's archive depth
3. Anvil crashed on startup (check logs/anvil/<chain>.log)
Fix:
# Check the anvil log for crash details
cat logs/anvil/ethereum.log
# Test RPC connectivity
curl -s --max-time 10 -X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' \
$YOUR_RPC_URL
"Fidelity violation"¶
Cause: The experiment's runtime behavior doesn't match the declared fidelity level in evidence.yaml.
Fix: Either:
- Update the attack to meet the requirement (e.g., add trace executions)
- Lower the fidelity level in evidence.yaml
- Use --no-fidelity to skip enforcement (validation mode)
"Evidence validation against live chain failed"¶
Cause: A contract address in evidence.yaml has no code at the fork block — probably a wrong address or EOA.
Fix: Verify the address on Etherscan — confirm it's a Contract (not an EOA).
8. Edge Cases From Validation Sessions¶
Orphaned Anvil Processes¶
Each crucible fork spawns anvil as a child process. If the parent crucible fork process is killed (timeout, Ctrl+C, crash), the child anvil may survive as an orphan, still holding the port.
How to detect:
# Find orphaned anvil processes
ps aux | grep anvil | grep -v grep
# Check for zombie (defunct) processes
ps aux | grep 'defunct' | grep anvil || echo 'No zombie anvils'
How to clean:
# Kill all anvil processes
pkill -9 -f anvil 2>/dev/null
# Remove stale meta files
rm -f states/*.meta.json
# Verify ports are free
ss -tlnp | grep -E '854[5-8]' || echo 'All free'
Zombie Processes¶
Zombie (defunct) processes have exited but haven't been reaped by their parent. They:
- Still appear in the process table
- Cannot receive signals (SIGKILL has no effect)
- Don't hold ports or consume resources (except a PID table entry)
- Are harmless but clutter ps output
Detection: Crucible's ChainManager.process_is_zombie() reads /proc/<pid>/status for State: Z on Linux.
Cleanup: Zombies can only be reaped when their parent calls wait(). If the parent is dead, init (PID 1) will eventually reap them. They will not block new forks.
Persistent uv run crucible fork Processes¶
Each uv run crucible fork spawns a process tree:
uv run crucible fork --topology <name>
└── crucible fork --topology <name>
└── anvil --port 8545 ...
If multiple fork commands were run (e.g., through subagent spawns), multiple process trees accumulate. Each holds a different port.
Cleanup strategy:
# Kill ALL crucible fork + anvil processes at once
pkill -9 -f 'anvil'
pkill -9 -f 'crucible fork'
sleep 2
rm -f states/*.meta.json
Prevention: Run crucible clean before forking, and use the same port configuration consistently.
Ports Being Reoccupied After Kill¶
If a port keeps getting reoccupied after you kill the process:
1. Check for process trees — killing the child anvil doesn't kill the parent crucible fork, which may restart it
2. Check for tmux sessions or systemd services managing the process
3. Check for Docker containers that expose the port
4. Use fuser to find exactly what's on the port, then kill the entire process tree
# Find the exact PID on the port
fuser -v 8545/tcp
# Kill the PID and its parent
kill -9 <PID>
# Or kill the parent PID to prevent respawning
kill -9 <PPID>
# As a last resort, kill all anvil instances
pkill -9 -f anvil
Fork Succeeds But Polygon/BSC Archive Doesn't Serve State¶
Free RPC providers may not serve full historical state for Polygon or BSC at older fork blocks. The bridge plugins handle this gracefully — the chain is skipped with a warning, and the experiment continues on other chains.
If you need the bridge deployed on all chains: 1. Use a paid archive provider (GetBlock, QuickNode) 2. Try a more recent fork block if applicable 3. Run with a topology that excludes the problematic chain
See also: - Troubleshooting Guide — Symptom → cause → fix - Operations Runbook — Daily ops - RPC Provider Guide — Provider comparison - Fidelity Enforcement in CLI Reference - Benchmarks — Per-attack fidelity assessment