Skip to content

Conversation

@jochemarends
Copy link
Contributor

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_tables option is non-empty.

  • :lookup_tables (default: %{}) — A map of address lookup tables to use. Each key is a t:Solana.Key.t/0 representing the address of a lookup table account, and each value is a list of t:Solana.Key.t/0 representing the addresses of that lookup table.

    When non-empty, the transaction is encoded using the version 0 format.

Solana.Transaction.to_binary/2 now accepts two options; however, there's currently no way to use these with Solana.RPC.Request.send_transaction/2.
It might be nice to allow Solana.RPC.Request.send_transaction/2 to either accept pre-compiled transactions or forward these options to Solana.Transaction.to_binary/2.

Version 0 transaction cannot be parsed without an RPC connection.
Because Solana.Transaction.parse/1 currently 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/1 because 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.

…ns (dcrck#6)

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_tables` option is non-empty:

- `:lookup_tables` (default: `%{}`) — A map of address lookup tables to use.
  Each key is a `t:Solana.Key.t/0` representing the address of a lookup table
  account, and each value is a list of `t:Solana.Key.t/0` representing the
  addresses of that lookup table.

  When non-empty, the transaction is encoded using the [version 0
  format](https://docs.anza.xyz/proposals/versioned-transactions#versioned-transactions).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant