Skip to content

fix: use correct Token Program for SPL in basic_solana#128

Merged
lpahlavi merged 8 commits intomainfrom
lpahlavi/basic-solana-spl-functionality
May 27, 2025
Merged

fix: use correct Token Program for SPL in basic_solana#128
lpahlavi merged 8 commits intomainfrom
lpahlavi/basic-solana-spl-functionality

Conversation

@lpahlavi
Copy link
Contributor

@lpahlavi lpahlavi commented May 26, 2025

This PR fixes two problems that occur when running basic_solana against Solana Devnet.

  1. This commit changed the address of the Token Program used in basic_solana::spl from TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA (i.e. the legacy Token Program) to TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb (i.e. the Token 2022 Program). This broke compatibility with SPL tokens whose token program was the legacy Token Program, e.g. USDC. Instead, this PR fetches the account info for the given mint address and reads the token program ID from the owner field in the response for all SPL endpoints.
  2. The Solana RPC interface uses by default the deprecated base58 encoding for the getAccountInfo response, which leads to errors due to this response encoding only supporting responses up to 128 bytes. Therefore, use base64 encoding in basic_solana.

@lpahlavi lpahlavi changed the title fix: basic_solana SPL functionality fix: use basic_solana correct Token Program for SPL May 26, 2025
@lpahlavi lpahlavi changed the title fix: use basic_solana correct Token Program for SPL fix: use correct Token Program for SPL in basic_solana May 26, 2025
@lpahlavi lpahlavi marked this pull request as ready for review May 26, 2025 15:09
@lpahlavi lpahlavi requested a review from a team as a code owner May 26, 2025 15:09
Copy link
Contributor

@gregorydemay gregorydemay left a comment

Choose a reason for hiding this comment

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

Thanks @lpahlavi for this PR! Some minor comments

@lpahlavi lpahlavi requested a review from gregorydemay May 27, 2025 07:28
@lpahlavi lpahlavi merged commit a3d3cd5 into main May 27, 2025
12 checks passed
@lpahlavi lpahlavi deleted the lpahlavi/basic-solana-spl-functionality branch May 27, 2025 07:49
@github-actions github-actions bot mentioned this pull request Jul 31, 2025
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