@solana/kit
v8.4.0 (2026-09-28)
Minor Changes
-
[
@solana/codecs-data-structures,@solana/errors] #20610e76741Thanks @lorisleiva! - Add a sentinel size strategy to thearray,set, andmapcodecs. Passing a{ __kind: 'sentinel', sentinel, strategy? }object as thesizeoption ends the collection when the bytes at the next item position match the givensentinel, compared at item boundaries only. The optionalstrategy('required'by default, or'optional'/'omitted') controls whether the sentinel is written when encoding and required when decoding. This provides codec support for Codama'ssentinelCountNode.Two new errors accompany this:
SOLANA_ERROR__CODECS__SENTINEL_MISSING_AT_END_OF_BYTES(thrown under the'required'strategy when the byte array ends without the sentinel) andSOLANA_ERROR__CODECS__SENTINEL_MUST_NOT_BE_EMPTY(thrown when constructing a codec with an empty sentinel). -
[
@solana/errors,@solana/instruction-plans] #20735be269cThanks @lorisleiva! - Add helpers for writing custom message packers.resolveMaxInstructionsPerTransaction,assertMaxInstructionsPerTransactionandassertMessageCanAccommodateSizeenforce the instruction-count and size limits the built-in packers rely on, and a newSOLANA_ERROR__INSTRUCTION_PLANS__MESSAGE_REJECTED_BY_PACKERerror lets a packer refuse a transaction message for any other reason by providing areason. The transaction planner treats this error like the existing capacity errors and opens a new transaction message. UseisMessagePackerErrorThatRequiresNewCandidateto identify every error that calls for a new transaction message.
Patch Changes
-
[
@solana/codecs-numbers] #206756b4960Thanks @latent-9! - FixedgetShortU16Decoder()silently accepting malformed input: a truncated buffer decoded to garbage with an offset past the end of the byte array, and continuation chains longer than the documented three-byte encoding decoded to values outside the u16 domain. Malformed input now throwsSOLANA_ERROR__CODECS__INVALID_BYTE_LENGTH, and decoded values above 65,535 now throwSOLANA_ERROR__CODECS__NUMBER_OUT_OF_RANGE, matching the guards every other number decoder already uses. -
[
@solana/instruction-plans] #207175653e9Thanks @lorisleiva! - FixgetReallocMessagePackerInstructionPlanproducing a 0-byte instruction whentotalSizeis an exact multiple of the realloc limit (10,240 bytes), which left the account one chunk short of the requested size.