All articles
solanarusttestinglitesvm

What is LiteSVM on Solana

LiteSVM is a fast, lightweight in-process Solana runtime for testing programs in Rust — an alternative to solana-program-test that runs ~10x faster.

Share
devrels.xyz/a/1short link

LiteSVM is a fast, lightweight library for testing Solana programs in Rust. It's an alternative to solana-program-test (the official testing framework) that prioritises speed and ergonomics.

What is LiteSVM on Solana

What it does

LiteSVM wraps Solana's SVM (Sealevel Virtual Machine) component directly, giving you an in-process Solana runtime without spinning up a validator. You load programs, send transactions, and inspect state — all synchronously, in milliseconds.

Why people use it

  • Speed. Tests run roughly 10x faster than solana-program-test because there's no validator, no async runtime, and no RPC layer.
  • Simple API. Synchronous send_transaction, get_account, airdrop, etc. No tokio, no BanksClient round-trips.
  • Time and slot control. Warp the clock, jump slots, override sysvars, and set account state arbitrarily — useful for testing time-locked logic, vesting, and governance epochs.
  • Program cloning. Load real mainnet or devnet programs and accounts into the test environment.

Typical usage

use litesvm::LiteSVM;

let mut svm = LiteSVM::new();
svm.airdrop(&payer.pubkey(), 1_000_000_000).unwrap();
svm.add_program_from_file(program_id, "target/deploy/my_program.so").unwrap();

let tx = Transaction::new_signed_with_payer(/* ... */);
let result = svm.send_transaction(tx);

Trade-offs

It's not a full validator — no networking, no gossip, no consensus. So it's purely for unit and integration tests of program logic, not for testing RPC behaviour or multi-node scenarios. For that, you'd still want solana-test-validator or a devnet.

LiteSVM is maintained by the LiteSVM contributors (originating from Anza and community work) and lives at github.com/LiteSVM/litesvm.

Keep reading

Get new articles in your inbox

Technical deep-dives on Solana tooling, infrastructure, and ecosystem. No noise.

What is LiteSVM on Solana | devrels.xyz