
Coverage-guided fuzzing framework for Solana smart contracts
Built on LibAFL and LiteSVM for fast, local transaction simulation with edge-level coverage tracking.
Crucible enables property-based testing and stateful invariant checking for Solana programs through randomly generated action sequences. Define your program's actions, write invariants, and let the fuzzer find violations.
Upperbound throughput on small/medium programs with MacBook Pro M3:
| Mode | 1 core | 12 cores | 12 cores, no tracing |
|---|---|---|---|
| Stateless | 1,200/s | 9,600/s | 22,000/s |
| Stateful | 8,200/s | 67,000/s | 130,000/s |
raw_call()ctx.program(...).call(...).accounts(...).signers(...).send(). Helpers cover time control (advance_epoch, warp_to_slot), account creation, and mint setup. Reduces testing boilerplate by 50-70%. See API Reference. Vec<Action> entries directly. Sequence operations (insert, delete, swap, splice) and parameter rewrites (numeric values biased toward boundaries and declared #[range(..)] endpoints) keep every generated input structurally valid. Roughly a 5x improvement in bug discovery rate over arbitrary. crucible tmin and replayed with crucible show. Programs compiled with debug symbols produce LCOV reports viewable with genhtml. See Crash Analysis and Coverage Reports.From source:
git clone https://github.com/asymmetric-research/crucible
cd crucible
cargo install --path crates/crucible-fuzz-cli
crucible init <program_name>
Defaults to fuzz/<program_name>/
crucible run <program_name> <test_name> --release
| Topic | Description |
|---|---|
| Getting Started | Setup, running, project structure, feature flags |
| IDL Code Generation | Using crucible-idl-gen for standalone harnesses |
| API Reference | TestContext API — program loading, accounts, transactions, RPC cloning, time, oracles |
| Writing Tests | Fixtures, actions, range constraints, simple & invariant fuzzing, assertion macros |
| CLI Reference | All crucible commands and execution modes |
| Crash Analysis | Listing, viewing, replaying, and minimizing crashes |
| Coverage Reports | Bytecode & source-level coverage, LCOV, genhtml |
| Harness Guide | In-depth guide to writing effective fuzz harnesses |
Licensed under the MIT License.
$ claude mcp add crucible \
-- python -m otcore.mcp_server <graph>