8000 Defend against transactions that source nonce account addresses from lookup tables · Issue #309 · anza-xyz/kit · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Defend against transactions that source nonce account addresses from lookup tables #309

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
steveluscher opened this issue Mar 28, 2025 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@steveluscher
Copy link
Collaborator
steveluscher commented Mar 28, 2025

Motivation

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.

Details

  1. Make sure that createAdvanceNonceAccountInstruction() does not produce an IAccountLookupMeta (already the case, I think)
  2. isAdvanceNonceAccountInstructionForNonce() must assert that the nonce account in an AdvanceNonce instruction is not an IAccountLookupMeta
  3. compressTransactionMessageUsingAddressLookupTables() should refuse to convert an AdvanceNonce instruction's nonce account from an IAccountMeta to an IAccountLookupMeta. Note: this will be bad for package efficiency, because this will mean putting nonce-specific logic in a place where it will almost never be used. Think hard about whether this is worth it or not.
  4. getAddressMapFromInstructions() should always upgrade lookup table entries to static entries if they belong to a nonce account that is subject to an AdvanceNonce instruction. Note: like 3, this will be bad for package efficiency, because this will mean putting nonce-specific logic into the message compiler where it will almost never be used. Think hard about whether this is worth it or not.

Note

There is a world where, if we're OK with taking the hit on package efficiency to implement 4, then we can ignore all of the other changes. That is to say we can play fast and loose with whether we allow an AdvanceNonceInstruction to contain an IAccountLookupMeta knowing that eventually the transaction message compiler will ‘upgrade’ it to a static entry. Thoughts?

@steveluscher steveluscher added the enhancement New feature or request label Mar 28, 2025
@steveluscher steveluscher added the good first issue Good for newcomers label May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant
0