Skip to content

Add Transactions V2 support #2220

Closed
Closed

Description

@fabioberger

This feature of Solana went live yesterday: https://docs.solana.com/proposals/transactions-v2

Can Anchor upgrade it's Solana dependencies so that provider.connect.sendTransaction accepts VersionedTransactions?

Thank you!

Activity

  1. Henry-E commented on Oct 11, 2022

    @Henry-E
  2. Henry-E commented on Oct 12, 2022

    @Henry-E

    As well as updating dependencies we will need to look into where the internals of anchor have to be updated in order to start passing VersionedTransaction objects instead of Transaction objects to sendTransaction.

  3. broskicodes commented on Oct 26, 2022

    @broskicodes

    How is progress on support for versioned transactions in Anchor going? I see that the PR bumping the web3.js package version was merged. Will that update be in the next release of the @project-serum/anchor package?

  4. Henry-E commented on Oct 26, 2022

    @Henry-E

    With the updated version of the package you should be able to pass in versioned transactions. I'll have to check with armani what the plan is for updating packages etc.

  5. broskicodes commented on Oct 27, 2022

    @broskicodes

    Ok, great! I imagine we will also be able to create and query lookup tables as well? If possible, could you give me an ETA for when the package will be updated? Once you've talked with Armani ofc.

  6. Henry-E commented on Oct 27, 2022

    @Henry-E
  7. broskicodes commented on Oct 27, 2022

    @broskicodes

    Thanks for the reply! Yes all LUT functionality is handled by the updated web3.js version, so once this is released all the functionality should work. And thanks for taking note. I'll keep an eye out for the next release.

  8. RustySol commented on Oct 29, 2022

    @RustySol

    Hey there 👋,

    Wonder if there are any updates? Our team is super pumped to be able to integrate transaction v2 with Anchor!

  9. pindaroso commented on Dec 6, 2022

    @pindaroso

    Hi guys, just checking in, any word on this update @Henry-E?

  10. Henry-E commented on Dec 6, 2022

    @Henry-E

    I still haven't gotten any response from anyone about what integration with transactions v2 would look like? What support does anchor need to add in. It's all in the web3 library?

  11. pindaroso commented on Dec 6, 2022

    @pindaroso

    The local validator that runs during tests needs a version update. I didn't see any other issues or PRs for this unless I'm missing something. Should I create one?

  12. Henry-E commented on Dec 6, 2022

    @Henry-E

    The Solana and web3 versions have all been updated for the next version.

  13. pindaroso commented on Dec 6, 2022

    @pindaroso

    Ah, beautiful, ty. When is that coming out?

  14. 1 remaining item

  15. adilcpm commented on Dec 15, 2022

    @adilcpm

    Any update on this?

  16. Henry-E commented on Dec 15, 2022

    @Henry-E

    We released a new version

  17. adilcpm commented on Dec 16, 2022

    @adilcpm

    how to handle it in anchor web3. I am not able to see any example or test leveraging lookup tables.

  18. Henry-E commented on Dec 16, 2022

    @Henry-E

    It's a Solana web3.js package feature, unrelated to anchor. Though with the updated web3.js package in the new anchor you should be able to pass the new arguments in

  19. Henry-E commented on Dec 16, 2022

    @Henry-E

    I'll happily reopen this issue and look into it if someone can give a clear proposal on what support for the new versioned transactions should look like.

    From the docs https://docs.solana.com/developing/lookup-tables#how-to-use-an-address-lookup-table-in-a-transaction , it looks kind of like the usage is that you create instructions as normal for the transaction but at the very end pass in the lookuptable address

    const messageV0 = new web3.TransactionMessage({
      payerKey: payer.publicKey,
      recentBlockhash: blockhash,
      instructions: arrayOfInstructions, // note this is an array of instructions
    }).compileToV0Message([lookupTableAccount]);
    

    So I suppose that anchor should start compiling messages for transactions this way (without exposing all of it to the user) with the option to pass in a lookupTableAccount somewhere in the existing transaction builder syntax?

    It seems like all you have to do is add any lookupTableAccounts you need to the transaction and it will automatically obtain any public keys in it? But it's confusing because at some stage the lookupTableAccount needs to be fetched in order to minimize the size of the transaction and none of these look like async functions? So it must be that you pass a really large message/transaction to the first RPC which then converts your transaction into something that's less than 1230 bytes. Which seems like an odd way to do it but I can't see where else the conversion from a 32 byte regular pubkey to a 2 byte index in lookup table happens.

  20. POPPIN-FUMI commented on Dec 16, 2022

    @POPPIN-FUMI

    Hi everyone,
    I am Kawasaki, core dev of EpicsDAO.
    I created an Epics Alpha quest with this issue to solve this issue faster.
    https://alpha.epics.dev/en/quest/UXVlc3Q6MTMy/

    A developer who made a PR and it's merged by the repo owner properly will be able to redeem 30,000 $EPCT.

    I hope this helps the Anchor community.
    Thank you very much 🙏

  21. 0xcrust commented on Feb 24, 2023

    @0xcrust

    I still haven't gotten any response from anyone about what integration with transactions v2 would look like? What support does anchor need to add in. It's all in the web3 library?

    I believe it's something like what @jordansexton says in this discussion. They just need to know that Anchor has type support for versioned transactions before they go ahead with integrating versioned transaction support for useAnchorWallet

  22. Henry-E commented on Feb 24, 2023

    @Henry-E
  23. 0xcrust commented on Feb 26, 2023

    @0xcrust

    Oh got it. I didn't see this reply on time and raised the same issue on the anchor discord which might be kind of a nuisance, sorry about that!

    I'll also do some experimenting on my end and see what I come up with

  24. ppoliani commented on Jan 7, 2024

    @ppoliani

    Hey guys 👋 any update on this issue? Is it currently possible to send a tx that utilizes LUT into an an anchor-based program?

  25. Henry-E commented on Jan 8, 2024

    @Henry-E

    Anchor supports versioned transactions. #2427 . So you'll be able to pass in look up tables but you'll to use the solana ts library to do it.

  26. removed their assignment
    on Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions