Replace @loris-sandbox/litesvm-kit with litesvm v1#178
Conversation
🦋 Changeset detectedLatest commit: 79539e9 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
8f49d11 to
cbca056
Compare
trevor-cortex
left a comment
There was a problem hiding this comment.
Summary
Clean migration from the temporary @loris-sandbox/litesvm-kit package to the official litesvm v1.0.0 release. Changes fall into three categories:
- Import updates — All imports across source files, tests, and type re-exports are updated from
@loris-sandbox/litesvm-kittolitesvm. - API change in
transaction-plan-executor.ts— The two-steplatestBlockhashLifetime()+setTransactionMessageLifetimeUsingBlockhash()pattern is replaced with a singlesvm.setTransactionMessageLifetimeUsingLatestBlockhash(tx)call. This simplifies the code and removes the now-unusedsetTransactionMessageLifetimeUsingBlockhashimport. - Test updates — Mocks are updated to match the new API surface.
MOCK_BLOCKHASHconstant is removed since it's no longer needed. The integration test amounts are bumped (1,000 → 100,000,000 lamports for the transfer).
Looks good to me! 👍
Notes for subsequent reviewers
- The
litesvmv1 package has the same native binary structure (platform-specific optional deps for darwin/linux, arm64/x64, gnu/musl) — no new platform gaps. - The
litesvmv1 lockfile entry pulls in@solana-program/token@0.12.0as a dep (the sandbox version used0.9.0). Worth confirming this doesn't conflict with the0.13.0version also present in the workspace. - The changeset correctly marks this as a
minorbump for@solana/kit-plugin-litesvm.
| }>({ | ||
| executeTransactionMessage: async (context, transactionMessage, config) => { | ||
| const latestBlockhash = client.svm.latestBlockhashLifetime(); | ||
| const signedTransaction = await pipe( |
There was a problem hiding this comment.
Nice — this is a cleaner API. The old two-step pattern (latestBlockhashLifetime() → setTransactionMessageLifetimeUsingBlockhash()) was easy to misuse if the blockhash went stale between the two calls. Having the SVM instance handle it atomically is a good improvement.
| .use(litesvmTransactionPlanner()) | ||
| .use(litesvmTransactionPlanExecutor()); | ||
| client.svm.airdrop(payer.address, lamports(1_000_000_000n)); | ||
| client.svm.airdrop(payer.address, lamports(1_000_000_000n)); // 1 SOL |
There was a problem hiding this comment.
The bump from 1,000 to 100,000,000 lamports — is this needed because the v1 runtime now enforces minimum rent-exempt balances or fee requirements that the old version didn't? Might be worth a brief comment explaining why this specific amount was chosen.
There was a problem hiding this comment.
@trevor-cortex That's exactly right. The test transferred 1,000 lamports to a fresh destination address but the minimum balance for a 0-data account is 890,880 lamports. The official litesvm v1 package enforces this whereas my previous temporary package was forked from an older version that was lenient enough to let the test pass.
There was a problem hiding this comment.
Makes sense, thanks for the context! Good that the official v1 enforces rent-exemption properly — better to catch that in tests than have it silently pass.
This PR replaces the temporary `@loris-sandbox/litesvm-kit` package with the official `litesvm` v1.0.0 release. All imports are updated across source files, tests, and type re-exports.
cbca056 to
79539e9
Compare
mcintyre94
left a comment
There was a problem hiding this comment.
Nice! Pleased we have this officially upstreamed now! 🚀

This PR replaces the temporary
@loris-sandbox/litesvm-kitpackage with the officiallitesvmv1.0.0 release. All imports are updated across source files, tests, and type re-exports.