Skip to content

fix: include v0 preamble in offchain message size checks#1741

Open
ChargingFoxSec wants to merge 2 commits into
anza-xyz:mainfrom
ChargingFoxSec:fix/offchain-v0-preamble-size-1726
Open

fix: include v0 preamble in offchain message size checks#1741
ChargingFoxSec wants to merge 2 commits into
anza-xyz:mainfrom
ChargingFoxSec:fix/offchain-v0-preamble-size-1726

Conversation

@ChargingFoxSec

Copy link
Copy Markdown

Problem

The v0 1232-byte message size check only counted the message body. This allowed messages to pass validation when the body was under the limit, even if the full encoded message with the v0 preamble was over 1232 bytes.

Summary of Changes

Fixes #1726.

This updates the v0 offchain message validation to account for the preamble size when checking the 1232-byte formats.

It also adds encode and decode tests for the boundary case where the body alone fits, but the full v0 encoded message does not.

@changeset-bot

changeset-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 24667a6

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

This PR includes changesets to release 47 packages
Name Type
@solana/offchain-messages Patch
@solana/kit Patch
@solana/signers Patch
@solana/plugin-interfaces Patch
@solana/program-client-core Patch
@solana/react Patch
@solana/wallet-account-signer Patch
@solana/accounts Patch
@solana/addresses Patch
@solana/assertions Patch
@solana/codecs-core Patch
@solana/codecs-data-structures Patch
@solana/codecs-numbers Patch
@solana/codecs-strings Patch
@solana/codecs Patch
@solana/compat Patch
@solana/errors Patch
@solana/fast-stable-stringify Patch
@solana/fixed-points Patch
@solana/functional Patch
@solana/instruction-plans Patch
@solana/instructions Patch
@solana/keys Patch
@solana/nominal-types Patch
@solana/options Patch
@solana/plugin-core Patch
@solana/programs Patch
@solana/promises Patch
@solana/rpc-api Patch
@solana/rpc-graphql Patch
@solana/rpc-parsed-types Patch
@solana/rpc-spec-types Patch
@solana/rpc-spec Patch
@solana/rpc-subscriptions-api Patch
@solana/rpc-subscriptions-channel-websocket Patch
@solana/rpc-subscriptions-spec Patch
@solana/rpc-subscriptions Patch
@solana/rpc-transformers Patch
@solana/rpc-transport-http Patch
@solana/rpc-types Patch
@solana/rpc Patch
@solana/subscribable Patch
@solana/sysvars Patch
@solana/transaction-confirmation Patch
@solana/transaction-messages Patch
@solana/transactions Patch
@solana/webcrypto-ed25519-polyfill Patch

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

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.

v0 offchain message size checks exclude the preamble

1 participant