Research Workflow¶
1. Reproduction Standard¶
A benchmark is typically classified as "historically reproduced" once the corresponding attack pack exhibits:
- A declared fidelity level.
- A complete
evidence.yamlmanifest. - Explicit fork blocks.
- Affected contract addresses.
- Historical exploit transactions (if the target fidelity is L3 or L4).
- Expected state, balance, and event assertions.
- A deterministic rerun comparison.
- An exported artifact bundle.
While Crucible is capable of executing scaffold packs prior to the completion of these fields, such executions constitute engineering validation rather than rigorous research evidence.
Fidelity Note: Crucible enforces strict adherence to a 5-level fidelity system (L0-L4). Please refer to the Fidelity Guide for detailed definitions of each level and the Capabilities Matrix for supported topologies and bridge plugins. Fidelity enforcement is enabled by default. The
--no-fidelityflag may be utilized to bypass this check during early development.
2. Attack Pack Lifecycle¶
The development of a robust reproduction follows a sequential lifecycle. For comprehensive instructions regarding research, evidence attribution, plugin development, and validation, refer to the Attack Pack Guide.
Phase A: Scaffold Generation¶
Accelerated Generation (via Transaction Hash):
This procedure automatically generates the complete scaffold structure (plugin.yaml, evidence.yaml, attack.py, scenario.yaml, ABI mapping).
Manual Generation:
Validate the structural integrity of the scaffold:
Phase B: Evidence Aggregation¶
Evidence aggregation is a strictly manual intelligence-gathering process. Researchers typically conduct off-chain analysis to ascertain the exact parameters of the historical exploit.
This verified data is then manually incorporated into evidence.yaml, which generally includes:
- Official Postmortems: Links to Rekt News, BlockSec, or protocol postmortems.
- Block Explorer References: Etherscan (or equivalent) links to the attacker's wallet and the vulnerable contracts.
- Contract Addresses: The exact deployment addresses of the exploited contracts.
- Vulnerable Function Selectors: The specific function signatures utilized to trigger the exploit.
- Fork Block Numbers: The specific block number immediately preceding the attack transaction (used by Anvil to initialize the fork state).
- Exploit Transaction Hashes: The authoritative transaction(s) that executed the attack.
- State and Balance Expectations: The anticipated financial impact (e.g., token drain amounts).
Phase C: Scenario Definition¶
Populate scenarios/<scenario>/scenario.yaml with concrete state assertions.
A comprehensive reproduction typically demonstrates:
- The vulnerable execution path succeeds.
- The attacker's on-chain position improves.
- Protected state (e.g., bridge vaults) is materially altered.
Phase D: Baseline Capture¶
Initialize the topology (the setup command may be used to execute the fork and bootstrap phases concurrently):
Capture and verify the environmental baseline:
Phase E: Formal Execution¶
Execute the experiment against the deterministic baseline:
crucible experiment run experiments/<attack>_replay.yaml
crucible history --rebuild
crucible logs list
Phase F: Export & Verification¶
Export the resulting telemetry and artifacts for publication:
crucible export <run_id> # Export as directory
crucible export <run_id> --format tar-gz # Export as compressed archive
crucible verify datasets/<run_id> # Verify bundle integrity
3. Validation & Verification¶
Determinism Verification¶
Execute the identical experiment twice following the restoration of the exact baseline:
crucible reset --scenario <scenario>
crucible experiment run experiments/<attack>_replay.yaml
crucible reset --scenario <scenario>
crucible experiment run experiments/<attack>_replay.yaml
crucible diff <run_a> <run_b>
The diff result should ideally display:
storage_equal: trueevents_equal: truegas_equal: true(unless the experiment explicitly declares a gas tolerance)
Patch Validation Workflow¶
If evaluating a patch, validation necessitates two parallel experiments:
- Vulnerable Replay: The historical exploit succeeds.
- Patched Replay: The exploit fails, but standard protocol operations remain functional.
The patch artifact should be structured as follows:
A complete patch evaluation generally includes both positive assertions (normal behavior succeeds) and negative assertions (exploit behavior fails).