Add address lookup table support to TransactionComposer - #27
Closed
fulf wants to merge 4 commits into
Closed
Conversation
- Utils::LookupTableContext: the lookup-table counterpart to AccountContext — table registry, v0 loading rules (never signers, the fee payer, or invoked program ids; first table wins; runtime loaded-address order), and the AddressLookupTable references a v0 message carries - AccountContext#relocate_loaded_accounts: rebuilds a compiled account list into the combined v0 account space [static, loaded writable, loaded readonly] and adjusts the readonly-unsigned header count (calculate_header and merge_from compacted to stay within the class-length limit) - Connection#get_slot Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
TransactionComposer#add_lookup_table registers an on-chain table (address + full ordered address list). Registering a table opts the transaction into the v0 format, matching @solana/web3.js: compose_transaction loads every eligible compiled account through the tables instead of a static account slot and rebuilds instruction indices against the combined v0 account space. With no tables the legacy path is untouched. Unit tests cover v0 emission, the static/loaded split, header adjustment, table references, index resolution, serialization round-trip, and the legacy path; a validator-backed test provisions a real lookup table (create + extend via test-support composers for the ALT program) and lands a v0 transfer through it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Transaction composer page: add_lookup_table + lookup_tables entries and an "Address lookup tables (v0)" section - ALT concepts page: composer example; scope tip now reflects that composing v0 transactions from existing tables is covered - Account context page: the v0 relocation step - Connection page: get_slot Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds address lookup table (v0 transaction) support to the composer layer and bumps the gem to 0.1.8:
TransactionComposer#add_lookup_table(account:, addresses:)registers an on-chain table; registering a table opts the transaction into the v0 format (matching@solana/web3.js):compose_transactionloads every eligible compiled account — non-signer, not the fee payer, not an invoked program id — through the tables and resolves instruction indices against the combined v0 account space. With no tables, the legacy path is byte-for-byte untouched.Utils::LookupTableContext— the lookup-table counterpart toAccountContext: table registry, v0 loading rules (first table wins, runtime loaded-address order), and the message'sAddressLookupTablereferences. Program ids are derived from the built instructions, so composers that emit multiple instructions for different programs are covered.Utils::AccountContext#relocate_loaded_accountsrebuilds the compiled account list into[static, loaded writable, loaded readonly]and adjusts the readonly-unsigned header count. Note: the small compactions tocalculate_headerandmerge_fromare there so the class still fits theMetrics/ClassLengthcop after the new method — no behavior change.Connection#get_slotSelection rules, ordering, and wire format verified against the versioned-transactions spec, the Rust SDK message compiler, and web3.js
MessageV0.compile.Testing
rake test: 375 runs, 0 failures ·rubocop: clean🤖 Generated with Claude Code