Skip to content

prohibit adding nonce account to address lookup table #659

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

shubhiscoding
Copy link
Contributor

Problem

solana-foundation/solana-improvement-documents#242 will make it impossible to load a nonce account from an address lookup table, so we must adjust the ergonomics of the JS SDK to prohibit creating such a transaction message.

Summary of Changes

  • made createAdvanceNonceAccountInstruction() produces an AdvanceNonce instruction having an StaticAccount<WritableAccount<TNonceAccountAddress>>.
  • made isAdvanceNonceAccountInstructionForNonce() to assert that the nonce account in an AdvanceNonce instruction has static set to true.
  • made compressTransactionMessageUsingAddressLookupTables() to refuse to convert any account to a lookup account, if its incompressible property is true.
  • made getAccountMetas() to mark every address in staticAccounts array with property static: true (discussed here).
  • made changes to tests to acknowledge new StaticAccount type.

Fixes #309

Copy link

changeset-bot bot commented Jul 15, 2025

⚠️ No Changeset found

Latest commit: 65802ca

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@steveluscher steveluscher requested a review from lorisleiva July 16, 2025 22:11
Copy link
Member

@lorisleiva lorisleiva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! However, before I review this in more details, I think we should first figure out if this change is really worth it (as discussed here).

@github-actions github-actions bot added the stale label Aug 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Defend against transactions that source nonce account addresses from lookup tables
2 participants