Repository navigation
fix(js-legacy): handle uninitialized extension padding - #1610
Merged
samkim-crypto merged 1 commit intoNov 22, 2026
Merged
samkim-crypto merged 1 commit into
samkim-crypto merged 1 commit into
Conversation
mobydih
force-pushed
the
fix/legacy-token-extension-padding
branch
from
November 21, 2026 20:08
a597ee1 to
606c0e2
Compare
Contributor
Author
|
yep rebased. thanks |
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.
Valid Token-2022 mints whose unpadded size equals
Multisig::LENend with a two-byteUninitializedmarker. The legacy JavaScript parser currently tries to read a length after that marker and throwsRangeError. This also breaksgetAccountLenForMintandcreateAccountwhen a keypair is supplied.Stop before reading the length of an
Uninitializedentry, and ignore a final byte that cannot contain a type, matching the Rust TLV reader. Add regression coverage for multisig-size padding, overallocated data, zero-length initialized extensions, truncated length fields, and token account sizing. This changes the legacy@solana/spl-tokenclient.Closes #1587.
Validation in
clients/js-legacy:pnpm test:unit: 119 passing. The new padding regressions failed before the parser change.pnpm build,pnpm exec tsc --project tsconfig.json --noEmit,pnpm format, andpnpm lint: passed.[MetadataPointer, TokenMetadata], andcreateAccountconstructs the expected instructions using an in-memory connection stub.The validator-backed end-to-end suites have not been run locally.