Add address lookup table (v0) composition support - #28
Merged
Conversation
Compose v0 transactions through address lookup tables, and create/extend tables on chain, with a clean single compile path rather than legacy/v0 branching. - TransactionComposer#add_address_lookup_table registers a table and opts the transaction into v0; compose_transaction resolves loadable accounts (non-signer, not the fee payer, not an invoked program id) through the tables in a single pass. merge folds another composer's tables in. - AccountContext#compile takes loaded_accounts:, resolving index_of against the combined v0 account space while keeping only static keys in the message and dropping loaded accounts from the header. Legacy compilation unchanged. - Solace::Accounts::AddressLookupTable: on-chain account model with .deserialize (meta + stored addresses) and #reference for the v0 message reference it contributes. - AddressLookupTableProgram Create/Extend composers + instruction builders. - Connection#get_slot. - Version 0.1.7; docs and CHANGELOG updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Extract inline composer instantiations out of the add_instruction chains into named local variables so the setup reads cleanly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Resolve conflicts with main's 0.1.7 release (compute budget + get_block_height): - CHANGELOG: ALT work moves to a 0.1.8 entry above main's 0.1.7 - Connection keeps both get_block_height and get_slot - connection-and-rpc docs list both RPC methods - Bump version to 0.1.8 (main took 0.1.7); @SInCE tags on ALT code updated to 0.1.8 Co-Authored-By: Claude Opus 4.8 (1M context) <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 support to the composer layer (bumps the gem to 0.1.7): compose v0 transactions through existing tables, and create/extend tables on chain — with a single clean compile path rather than legacy/v0 branching.
What's included
TransactionComposer#add_address_lookup_table(account:, addresses:)registers a table and opts the transaction into the v0 format (tracked as explicitversionstate, not derived from whether tables are empty).compose_transactionresolves every loadable account (a non-signer that is not the fee payer and not an invoked program id) through the tables in a single pass over the tables;mergefolds another composer's tables in, deduped by account.AccountContext#compile(loaded_accounts:)rebuildsindex_ofagainst the combined v0 account space ([static..., loaded...]) while keeping only the static keys inaccounts(what the message serializes) and dropping loaded accounts from the header. With no loaded accounts the legacy compilation is byte-for-byte unchanged.Solace::Accountsnamespace for on-chain account models, withAccounts::AddressLookupTable— a table's address + stored addresses,.deserializefor reading on-chain state, and#referencefor the v0 message reference it contributes.AddressLookupTableProgramCreate/Extend composers + instruction builders, so tables can be provisioned on chain.Connection#get_slot.Notes for review
if empty?fork + a post-hocrelocate_loaded_accountsthat hand-patched the header) with one compile path and a loaded-awareAccountContext.Metrics/ClassLengthraised to 125 (our own dial) rather than compacting unrelated methods.Connection#get_address_lookup_tablefetch helper.Testing
Accounts::AddressLookupTableunit tests (deserialize/reference/initialize); AccountContext loaded-compile unit tests.rake test: 373 runs, 0 failures ·rubocop: clean.🤖 Generated with Claude Code