refactor(deps): drop @solana/spl-token and @bonfida/spl-name-service - #1200
Open
amilz wants to merge 2 commits into
Open
refactor(deps): drop @solana/spl-token and @bonfida/spl-name-service#1200amilz wants to merge 2 commits into
amilz wants to merge 2 commits into
Conversation
|
@amilz is attempting to deploy a commit to the Solana Foundation Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Greptile SummaryThe PR removes the legacy SPL Token and Bonfida SNS dependencies while preserving token constants, account decoding, and
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (3): Last reviewed commit: "docs(openspec): correct the rejected-alt..." | Re-trigger Greptile |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
2 tasks
Replace @solana/spl-token program-address constants with the equivalents from @solana-program/token, and its MintLayout/AccountLayout decodes with getMintDecoder/getTokenDecoder. The kit token decoder validates the account state enum, so post-simulation decoding now guards against accounts that pass the size and discriminator filters without being token accounts. Removing the direct spl-token dependency let @bonfida/spl-name-service's peer range re-resolve 0.1.8 to 0.4.14, which reaches a client chunk through the @entities/domain barrel and added 200 KB of client JS. Vendor the three primitives Explorer used from that SDK into app/entities/domain/lib, built on kit codecs and @noble/hashes, and drop the dependency. The derivation is locked to address vectors captured from the SDK it replaces. Client JS: 8644 KB to 8244 KB. Refs: DEV-882
@solana-name-service/sns-sdk-kit 1.0.1 does exist as the kit-native successor to @bonfida/spl-name-service. The proposal previously claimed no such release existed, which was wrong. The vendoring decision stands, but on footprint: the SDK peers on @solana/kit ^6.9.0 against our 6.5.0, adds a duplicate @solana-program/token major, and exposes ~95 exports for the three primitives Explorer uses. Refs: DEV-882
amilz
force-pushed
the
refactor/DEV-882-drop-spl-token
branch
from
August 17, 2026 20:26
78bdcb4 to
ade08ca
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Kit-migration task 0.2: removes the
@solana/spl-token0.1.8 dependency.TOKEN_PROGRAM_ID,ASSOCIATED_TOKEN_PROGRAM_ID,NATIVE_MINT) come from@solana-program/tokeninstead.MintLayout/AccountLayoutdecodes becomegetMintDecoder()/getTokenDecoder().@bonfida/spl-name-service— see below for why that got pulled in.Net client JS: 8644 KB → 8244 KB (clean builds, measured against the base branch).
Why the second dependency
Removing the direct
@solana/spl-tokenpin let@bonfida/spl-name-service's peer range re-resolve 0.1.8 → 0.4.14, pulling inspl-token-groupandspl-token-metadata. That reaches a client chunk through the@entities/domainbarrel — a 200 KB regression on a PR whose whole point was removing a dependency. A scoped pnpm override does not bind a peer dep (verified).Explorer used exactly three things from that SDK: a SHA-256 name hash, a 3-seed PDA, and a 96-byte header decode. Those are now ~40 lines in
app/entities/domain/lib/sns-name-service.tson kit codecs and@noble/hashes(both already bundled), which also removesethers— which Bonfida pulled in solely for its SHA-256 — andbn.js.Rationale and rejected alternatives:
openspec/changes/vendor-sns-name-derivation/.Type of change
Testing
Full local pipeline green:
format:ci,lint,openspec:validate,build,test:ci.SNS derivation was equivalence-tested against
@bonfida/spl-name-service0.1.30 across 6 name vectors (including a unicode and an empty label), plus registry decoding of an account with trailing data. The resulting addresses are locked as literal vectors inapp/entities/domain/lib/__tests__/sns-name-service.spec.ts, so the derivation cannot drift once the SDK is gone.Pre-existing on the base branch and unchanged by this PR: 7 test files / 46 failures, all
localStorage-dependent — verified by running the same files on base. They fail because the dev machine runs Node v26 while the repo requires^22.Related Issues
Closes DEV-882. Part of the DEV-881 kit-migration epic.
Stacked on #1199. That PR is on a fork branch, so GitHub cannot use it as a base here — the first two commits belong to #1199 and will drop out of this diff once it merges. Review only
refactor(deps): drop @solana/spl-token and @bonfida/spl-name-service.Checklist
pnpm test,pnpm lint,pnpm typecheck)build:infoscript to update build informationAdditional Notes
Two things reviewers may want to weigh in on:
build-token-balances.tsgains atry/catch. The kit token decoder validates the account-state enum where buffer-layout did not, so a Token-2022 multisig that passes the size and discriminator filters would otherwise throw and take down the entire simulation result rather than dropping one row.borshis deliberately not removed, even though this PR deletes our last directborshimport.@onsol/tldparserneeds the 0.xdeserializeUnchecked, and our direct pin is what holds its transitive resolution there — dropping it silently re-resolves tldparser to borsh 2.0.0 and breaks ANS domain resolution. That pin should come out together with tldparser.