Skip to content

sdk: Add resize feature#347

Draft
febo wants to merge 5 commits intomainfrom
febo/resize
Draft

sdk: Add resize feature#347
febo wants to merge 5 commits intomainfrom
febo/resize

Conversation

@febo
Copy link
Collaborator

@febo febo commented Feb 11, 2026

Problem

As described in anza-xyz/solana-sdk#569, account resize cannot be safely performed using a delta value. Therefore, entrypoints need to store the original data size to reliably track differences. But doing so consume CUs and not every program needs to resize accounts.

Additionally, AccountView::resize was removed since the resize logic is dependent on what the entrypoint does.

Solution

This PR enables account resizing in pinocchio by:

  • Adding a "resize" feature to indicate to the entrypoint that the original data size needs to be stored. This consumes 2 CUs per account.
  • When the feature is enabled, an impl of the new Resize trait is provided forAccountView, offering resize and resize_unchecked.

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.

1 participant