Quickstart
Install the engine, verify it compiles, run the full test suite, then simulate a real transaction against devnet. Start to finish this takes under two minutes on a machine with Rust already installed.
Prerequisites
- Rust 1.80 or newer (tested on 1.94).
- A working C toolchain (required by a handful of transitive dependencies on Windows and Linux).
- Network access to
crates.ioand, for the integration test, toapi.devnet.solana.com.
1. Clone and build
install$ git clone https://github.com/Nulltx-xyz/crif $ cd crif $ cargo build --release
The first build resolves the Solana 2.0 dependency tree and takes roughly 90 seconds on a warm cache. Subsequent incremental builds are in the 5–10 second range.
2. Run the test suite
cargo test$ cargo test running tests: decoder_unit ........... 5 passed squads_unit ............ 6 passed protocol_decoders ..... 15 passed drift_attack_e2e ....... 2 passed devnet_integration ..... 1 ignored total ................... 28 passed, 0 failed
The devnet integration test is marked #[ignore] by default so that cargo test stays offline. To include it, run:
devnet integration$ cargo test --test devnet_integration -- --ignored --nocapture
This test loads ~/.config/solana/id.json, fetches its devnet balance, builds a real SOL transfer transaction, feeds it through build_report, and asserts the engine produces a coherent diff. If the keypair has less than 0.01 SOL on devnet, the test skips.
3. Simulate a transaction
sle simulate$ cargo run --release -- simulate \ --tx "$BASE64_TX" \ --rpc devnet
Replace $BASE64_TX with a base64-encoded VersionedTransaction. The engine will fetch the writable-account pre-state from devnet, call simulateTransaction, diff the result, decode every instruction, and print a human-readable report.
4. Reproduce the Drift 2026 attack
drift attack reproduction$ cargo run --example drift_attack > overall_risk = Critical > uses_durable_nonce = true
This example synthesizes a transaction whose shape matches the April 2026 Drift exploit (AdvanceNonceAccount followed by Squads.config_transaction_execute), serializes it to base64, and runs it through the offline report pipeline. The verdict is CRITICAL.