Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to @solana/web3.js v2.0.0 #65

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

elliotkennedy
Copy link
Contributor

@elliotkennedy elliotkennedy commented Nov 28, 2024

Summary

Hey @kklas - thanks for taking the time to write and maintain this library, it's really useful.

This pull request migrates anchor-client-gen to @solana/web3.js v2.0.

Solana web3.js 2.0 is now recommended for general use.

The official anchor repo will take some time to migrate.

Features

  1. Generated portable Address borsh deserializer to handle new type
  2. Upgrade to anchor 0.29
  3. [tests] add FooStruct.pubkey_field to test pubkey + types serialization

Issues

  1. Direct buffer-layout dependency

Unfortunately the new Address type requires a borsh helper to unpack with, this is not yet provided by @coral-xyz/borsh.

The result is that anchor-client-gen users now have a direct dependency on buffer-layout. Hopefully this can be removed in the future.

  1. Optional program accounts marked as mut

There is an outstanding bug with optional accounts where the placeholder program address is marked as writable.

Compiling these transactions fails with the new sdk. This should be fixed separately, draft PR here.

@kklas
Copy link
Owner

kklas commented Dec 3, 2024

Great work, thanks @elliotkennedy

@kklas kklas merged commit e41f6cf into kklas:master Dec 3, 2024
0 of 2 checks passed
@elliotkennedy
Copy link
Contributor Author

Great work, thanks @elliotkennedy

Thanks a lot for the review - I can fix the build in a separate PR too - sorry didn't get chance to see it failing

@kklas
Copy link
Owner

kklas commented Dec 3, 2024

@elliotkennedy would Kamino be intersted in taking over maintenance of this tool? I haven't done anything on Solana in over 2 years so I'm a bit out of touch and don't have time to maintain it anymore. I'm actually surprised anyone is even using it still.

@elliotkennedy
Copy link
Contributor Author

elliotkennedy commented Dec 3, 2024

@elliotkennedy would Kamino be intersted in taking over maintenance of this tool? I haven't done anything on Solana in over 2 years so I'm a bit out of touch and don't have time to maintain it anymore. I'm actually surprised anyone is even using it still.

@kklas - for sure - we would be happy to + thanks for the offer - I'll try to contact you via DM

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.

2 participants