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

Address Lookup Table Program Instruction Web3 Bindings #26469

Merged

Conversation

antematter-dev
Copy link
Contributor

@antematter-dev antematter-dev commented Jul 7, 2022

Problem

Web3 TypeScript bindings were missing for Address Lookup Table Program. This PR adds the appropriate client bindings to generate instructions needed to interact with the said program.

Summary of Changes

  • Adds bindings to all of the instructions provided by the Address Lookup Table program
  • Adds the correct layouts for instruction data serialization and deserialization

Fixes #3294 on Solana Program Library

Disclaimer

Proudly contributed by the worthless pixels, an NFT project full of die hard solana maxis. Wen arb bot? @worthlesspixels on Twitter.

@mergify mergify bot added the community Community contribution label Jul 7, 2022
@mergify mergify bot requested a review from a team July 7, 2022 08:57
@antematter-dev antematter-dev marked this pull request as ready for review July 7, 2022 08:58
Copy link
Member

@jstarry jstarry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good, thanks for adding this! Beyond my review comments, can you also add tests to confirm this works end to end? Tests use a local validator and can be run with npm run test:live-with-test-validator. You can use system-program.test.ts as a template for how these tests should be written.

web3.js/src/address-lookup-table-program.ts Outdated Show resolved Hide resolved
web3.js/src/address-lookup-table-program.ts Outdated Show resolved Hide resolved
web3.js/src/address-lookup-table-program.ts Outdated Show resolved Hide resolved
web3.js/src/address-lookup-table-program.ts Outdated Show resolved Hide resolved
web3.js/src/address-lookup-table-program.ts Show resolved Hide resolved
web3.js/src/address-lookup-table-program.ts Outdated Show resolved Hide resolved
web3.js/src/address-lookup-table-program.ts Outdated Show resolved Hide resolved
web3.js/src/address-lookup-table-program.ts Outdated Show resolved Hide resolved
web3.js/src/address-lookup-table-program.ts Outdated Show resolved Hide resolved
web3.js/src/address-lookup-table-program.ts Outdated Show resolved Hide resolved
@parkerqueen parkerqueen force-pushed the address-lookup-table-web3-bindings branch from 74843e6 to 8c29960 Compare July 7, 2022 16:18
@antematter-dev
Copy link
Contributor Author

We're working on the tests.

web3.js/src/address-lookup-table-program.ts Outdated Show resolved Hide resolved
web3.js/src/address-lookup-table-program.ts Outdated Show resolved Hide resolved
web3.js/src/address-lookup-table-program.ts Outdated Show resolved Hide resolved
web3.js/src/address-lookup-table-program.ts Outdated Show resolved Hide resolved
web3.js/src/address-lookup-table-program.ts Outdated Show resolved Hide resolved
web3.js/src/address-lookup-table-program.ts Outdated Show resolved Hide resolved
@jstarry
Copy link
Member

jstarry commented Jul 13, 2022

Fixes and tests look great! Please take a look at antematter#1 and merge if it looks good to you. Once that's resolved we can get this shipped

fix: alloc encoding buffer properly for seq layouts
@jstarry
Copy link
Member

jstarry commented Jul 13, 2022

Feel free to ignore the commit-lint failure but can you fix the doc failure here: https://github.com/solana-labs/solana/runs/7326663456?check_suite_focus=true

@antematter-dev antematter-dev requested a review from jstarry July 13, 2022 19:10
@jstarry jstarry merged commit e3c9c58 into solana-labs:master Jul 13, 2022
@parkerqueen parkerqueen deleted the address-lookup-table-web3-bindings branch July 13, 2022 19:20
@jstarry
Copy link
Member

jstarry commented Jul 13, 2022

Thanks again!

@jstarry jstarry changed the title Address Lookup Table Program Web3 Bindings Address Lookup Table Program Instruction Web3 Bindings Jul 13, 2022
@antematter-dev
Copy link
Contributor Author

antematter-dev commented Jul 13, 2022

Happy to help!

Let us know how we can contribute more, we're eager to use the lookup tables.

Lcchy pushed a commit to Bonfida/solana that referenced this pull request Jul 22, 2022
…ns (solana-labs#26469)

* feat: added web3 bindings for Address Lookup Table Program

* fix: refactoring + addresses PR comments

* fix: typos fixed and minor refactoring

* add lookup table instruction decoding support + fixes recent slot serialization bug

* export lookup table program

* linting

* fix: type annotations

* add tests cases for address lookup table program

* fix: alloc encoding buffer properly for seq layouts

* fix: typedoc issue

Co-authored-by: Antematter <[email protected]>
Co-authored-by: Muhammad Saad <[email protected]>
Co-authored-by: Justin Starry <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community Community contribution
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Address Lookup Table Usage
5 participants