Skip to content

Replace @loris-sandbox/litesvm-kit with litesvm v1#178

Merged
lorisleiva merged 1 commit into
mainfrom
04-02-replace_loris-sandbox_litesvm-kit_with_litesvm_v1
Apr 3, 2026
Merged

Replace @loris-sandbox/litesvm-kit with litesvm v1#178
lorisleiva merged 1 commit into
mainfrom
04-02-replace_loris-sandbox_litesvm-kit_with_litesvm_v1

Conversation

@lorisleiva
Copy link
Copy Markdown
Member

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.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 2, 2026

🦋 Changeset detected

Latest commit: 79539e9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@solana/kit-plugin-litesvm Minor
@solana/kit-client-litesvm Minor
@solana/kit-plugins Minor

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

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@lorisleiva lorisleiva force-pushed the 04-02-replace_loris-sandbox_litesvm-kit_with_litesvm_v1 branch from 8f49d11 to cbca056 Compare April 2, 2026 09:10
@lorisleiva lorisleiva marked this pull request as ready for review April 2, 2026 09:11
@lorisleiva
Copy link
Copy Markdown
Member Author

@trevor-cortex

Copy link
Copy Markdown

@trevor-cortex trevor-cortex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Clean migration from the temporary @loris-sandbox/litesvm-kit package to the official litesvm v1.0.0 release. Changes fall into three categories:

  1. Import updates — All imports across source files, tests, and type re-exports are updated from @loris-sandbox/litesvm-kit to litesvm.
  2. API change in transaction-plan-executor.ts — The two-step latestBlockhashLifetime() + setTransactionMessageLifetimeUsingBlockhash() pattern is replaced with a single svm.setTransactionMessageLifetimeUsingLatestBlockhash(tx) call. This simplifies the code and removes the now-unused setTransactionMessageLifetimeUsingBlockhash import.
  3. Test updates — Mocks are updated to match the new API surface. MOCK_BLOCKHASH constant 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 litesvm v1 package has the same native binary structure (platform-specific optional deps for darwin/linux, arm64/x64, gnu/musl) — no new platform gaps.
  • The litesvm v1 lockfile entry pulls in @solana-program/token@0.12.0 as a dep (the sandbox version used 0.9.0). Worth confirming this doesn't conflict with the 0.13.0 version also present in the workspace.
  • The changeset correctly marks this as a minor bump for @solana/kit-plugin-litesvm.

}>({
executeTransactionMessage: async (context, transactionMessage, config) => {
const latestBlockhash = client.svm.latestBlockhashLifetime();
const signedTransaction = await pipe(
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lorisleiva lorisleiva requested a review from mcintyre94 April 2, 2026 09:45
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.
@lorisleiva lorisleiva force-pushed the 04-02-replace_loris-sandbox_litesvm-kit_with_litesvm_v1 branch from cbca056 to 79539e9 Compare April 3, 2026 09:26
Copy link
Copy Markdown
Member

@mcintyre94 mcintyre94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Pleased we have this officially upstreamed now! 🚀

@lorisleiva lorisleiva merged commit 2274816 into main Apr 3, 2026
5 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants