Skip to content

Research Workflow

1. Reproduction Standard

A benchmark is typically classified as "historically reproduced" once the corresponding attack pack exhibits:

  1. A declared fidelity level.
  2. A complete evidence.yaml manifest.
  3. Explicit fork blocks.
  4. Affected contract addresses.
  5. Historical exploit transactions (if the target fidelity is L3 or L4).
  6. Expected state, balance, and event assertions.
  7. A deterministic rerun comparison.
  8. 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-fidelity flag 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):

crucible attack extract <tx_hash> --name my_attack --chain ethereum

This procedure automatically generates the complete scaffold structure (plugin.yaml, evidence.yaml, attack.py, scenario.yaml, ABI mapping).

Manual Generation:

attacks/<attack>/
  plugin.yaml
  evidence.yaml
  <attack>.py

Validate the structural integrity of the scaffold:

crucible plugin validate attacks/<attack>

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):

crucible setup --topology bridge
# OR manually:
crucible fork --topology bridge

Capture and verify the environmental baseline:

crucible baseline capture <scenario> --topology bridge
crucible baseline verify <scenario>

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: true
  • events_equal: true
  • gas_equal: true (unless the experiment explicitly declares a gas tolerance)

Patch Validation Workflow

If evaluating a patch, validation necessitates two parallel experiments:

  1. Vulnerable Replay: The historical exploit succeeds.
  2. Patched Replay: The exploit fails, but standard protocol operations remain functional.

The patch artifact should be structured as follows:

patches/<name>/
  patch.yaml
  validation.yaml
  contracts-or-scripts/

A complete patch evaluation generally includes both positive assertions (normal behavior succeeds) and negative assertions (exploit behavior fails).