add Address Lookup Table program and support for version 0 transactions #7
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.
Hello,
Since transactions can now use address lookup tables, this commit adds support for the version 0 transaction format. This format is implicitly used when the
:lookup_tablesoption is non-empty.:lookup_tables(default:%{}) — A map of address lookup tables to use. Each key is at:Solana.Key.t/0representing the address of a lookup table account, and each value is a list oft:Solana.Key.t/0representing the addresses of that lookup table.When non-empty, the transaction is encoded using the version 0 format.
Solana.Transaction.to_binary/2now accepts two options; however, there's currently no way to use these withSolana.RPC.Request.send_transaction/2.It might be nice to allow
Solana.RPC.Request.send_transaction/2to either accept pre-compiled transactions or forward these options toSolana.Transaction.to_binary/2.Version 0 transaction cannot be parsed without an RPC connection.
Because
Solana.Transaction.parse/1currently does not have access to an RPC client, I have left it out the parsing of version 0 transactions for now.I also left out the test for
Solana.LookupTable.close_lookup_table/1because closing a lookup table requires a cool-down period after deactivation, which caused the tests to time out.Once there is way to send transactions that are compiled with options, I will add tests for version 0 transactions.