From 96b45fc5e55bbd806d486f0346df0f38ec91b6d2 Mon Sep 17 00:00:00 2001 From: mikemaccana-edwardbot Date: Mon, 11 May 2026 21:40:51 +0000 Subject: [PATCH 1/6] ci: note that Anza's stable can resolve to a not-yet-published release Adds a one-line comment above the 'solana-cli-version: stable' lines in each setup-anchor / setup-solana workflow, so a future reader understands why CI sometimes fails on a green main with no code change. No behaviour change; the value remains 'stable'. --- .github/workflows/anchor.yml | 1 + .github/workflows/native.yml | 1 + .github/workflows/pinocchio.yml | 1 + .github/workflows/quasar.yml | 1 + .github/workflows/solana-asm.yml | 1 + 5 files changed, 5 insertions(+) diff --git a/.github/workflows/anchor.yml b/.github/workflows/anchor.yml index 3f8e36133..7229cc9a4 100644 --- a/.github/workflows/anchor.yml +++ b/.github/workflows/anchor.yml @@ -138,6 +138,7 @@ jobs: - uses: heyAyushh/setup-anchor@v4.999 with: anchor-version: 1.0.0 + # Sometimes Anza's stable resolves to a release whose binaries aren't published yet solana-cli-version: stable - name: Install Surfpool run: curl -sL https://run.surfpool.run/ | bash diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index 7799128ab..3027642f6 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -222,6 +222,7 @@ jobs: - name: Setup Solana Stable uses: heyAyushh/setup-solana@v5.9 with: + # Sometimes Anza's stable resolves to a release whose binaries aren't published yet solana-cli-version: stable - name: Build and Test with Stable run: | diff --git a/.github/workflows/pinocchio.yml b/.github/workflows/pinocchio.yml index f63582b14..eed761094 100644 --- a/.github/workflows/pinocchio.yml +++ b/.github/workflows/pinocchio.yml @@ -222,6 +222,7 @@ jobs: - name: Setup Solana Stable uses: heyAyushh/setup-solana@v5.9 with: + # Sometimes Anza's stable resolves to a release whose binaries aren't published yet solana-cli-version: stable - name: Build and Test with Stable run: | diff --git a/.github/workflows/quasar.yml b/.github/workflows/quasar.yml index 25e604b64..bea699d9b 100644 --- a/.github/workflows/quasar.yml +++ b/.github/workflows/quasar.yml @@ -197,6 +197,7 @@ jobs: - name: Setup Solana Stable uses: heyAyushh/setup-solana@v5.9 with: + # Sometimes Anza's stable resolves to a release whose binaries aren't published yet solana-cli-version: stable - name: Install Quasar CLI # Pinned to quasar rev 3d6fb0d8 (the HEAD this migration was written diff --git a/.github/workflows/solana-asm.yml b/.github/workflows/solana-asm.yml index ae6615cff..8df01ca89 100644 --- a/.github/workflows/solana-asm.yml +++ b/.github/workflows/solana-asm.yml @@ -188,6 +188,7 @@ jobs: - name: Setup Solana Stable uses: heyAyushh/setup-solana@v5.9 with: + # Sometimes Anza's stable resolves to a release whose binaries aren't published yet solana-cli-version: stable - name: Build and Test with Stable run: | From f5616db0c5031abb2c7baace0fd8749c14e47d75 Mon Sep 17 00:00:00 2001 From: mikemaccana-edwardbot Date: Mon, 11 May 2026 21:48:53 +0000 Subject: [PATCH 2/6] ci: pin solana-cli-version to 3.1.14, document rate-limit cause The 'stable' resolver in setup-anchor / setup-solana queries the unauthenticated GitHub Releases API for anza-xyz/agave, which 429s once CI runs at any meaningful volume. After 5 retries it returns empty and the subsequent install curl 404s, leaving CI without solana installed at all - this is what was breaking main and what was making this PR red. Pinning to 3.1.14 (current value of 'stable') makes CI deterministic. The 'beta' canary jobs in native/pinocchio/solana-asm are intentionally left floating. --- .github/workflows/anchor.yml | 6 ++++-- .github/workflows/native.yml | 6 ++++-- .github/workflows/pinocchio.yml | 6 ++++-- .github/workflows/quasar.yml | 6 ++++-- .github/workflows/solana-asm.yml | 6 ++++-- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/anchor.yml b/.github/workflows/anchor.yml index 7229cc9a4..e80988907 100644 --- a/.github/workflows/anchor.yml +++ b/.github/workflows/anchor.yml @@ -138,8 +138,10 @@ jobs: - uses: heyAyushh/setup-anchor@v4.999 with: anchor-version: 1.0.0 - # Sometimes Anza's stable resolves to a release whose binaries aren't published yet - solana-cli-version: stable + # Pinned because setup-anchor's resolver for 'stable' hits the + # unauthenticated GitHub API and frequently 429s, leaving CI without + # solana installed. Bump alongside anchor-version. + solana-cli-version: 3.1.14 - name: Install Surfpool run: curl -sL https://run.surfpool.run/ | bash - name: Display Versions diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index 3027642f6..e21ff1dd8 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -222,8 +222,10 @@ jobs: - name: Setup Solana Stable uses: heyAyushh/setup-solana@v5.9 with: - # Sometimes Anza's stable resolves to a release whose binaries aren't published yet - solana-cli-version: stable + # Pinned because setup-anchor's resolver for 'stable' hits the + # unauthenticated GitHub API and frequently 429s, leaving CI without + # solana installed. Bump alongside anchor-version. + solana-cli-version: 3.1.14 - name: Build and Test with Stable run: | source build_and_test.sh diff --git a/.github/workflows/pinocchio.yml b/.github/workflows/pinocchio.yml index eed761094..8e8fc07d3 100644 --- a/.github/workflows/pinocchio.yml +++ b/.github/workflows/pinocchio.yml @@ -222,8 +222,10 @@ jobs: - name: Setup Solana Stable uses: heyAyushh/setup-solana@v5.9 with: - # Sometimes Anza's stable resolves to a release whose binaries aren't published yet - solana-cli-version: stable + # Pinned because setup-anchor's resolver for 'stable' hits the + # unauthenticated GitHub API and frequently 429s, leaving CI without + # solana installed. Bump alongside anchor-version. + solana-cli-version: 3.1.14 - name: Build and Test with Stable run: | source build_and_test.sh diff --git a/.github/workflows/quasar.yml b/.github/workflows/quasar.yml index bea699d9b..04090c86a 100644 --- a/.github/workflows/quasar.yml +++ b/.github/workflows/quasar.yml @@ -197,8 +197,10 @@ jobs: - name: Setup Solana Stable uses: heyAyushh/setup-solana@v5.9 with: - # Sometimes Anza's stable resolves to a release whose binaries aren't published yet - solana-cli-version: stable + # Pinned because setup-anchor's resolver for 'stable' hits the + # unauthenticated GitHub API and frequently 429s, leaving CI without + # solana installed. Bump alongside anchor-version. + solana-cli-version: 3.1.14 - name: Install Quasar CLI # Pinned to quasar rev 3d6fb0d8 (the HEAD this migration was written # against, immediately after PRs #195 + #196). The next merged PR diff --git a/.github/workflows/solana-asm.yml b/.github/workflows/solana-asm.yml index 8df01ca89..82af9a5fb 100644 --- a/.github/workflows/solana-asm.yml +++ b/.github/workflows/solana-asm.yml @@ -188,8 +188,10 @@ jobs: - name: Setup Solana Stable uses: heyAyushh/setup-solana@v5.9 with: - # Sometimes Anza's stable resolves to a release whose binaries aren't published yet - solana-cli-version: stable + # Pinned because setup-anchor's resolver for 'stable' hits the + # unauthenticated GitHub API and frequently 429s, leaving CI without + # solana installed. Bump alongside anchor-version. + solana-cli-version: 3.1.14 - name: Build and Test with Stable run: | source build_and_test.sh From fcfd6d18eda3026710cd5e149e41f6c05e426dfe Mon Sep 17 00:00:00 2001 From: mikemaccana-edwardbot Date: Mon, 11 May 2026 21:50:25 +0000 Subject: [PATCH 3/6] ci: tighten the comment above the pinned solana-cli-version --- .github/workflows/anchor.yml | 4 +--- .github/workflows/native.yml | 4 +--- .github/workflows/pinocchio.yml | 4 +--- .github/workflows/quasar.yml | 4 +--- .github/workflows/solana-asm.yml | 4 +--- 5 files changed, 5 insertions(+), 15 deletions(-) diff --git a/.github/workflows/anchor.yml b/.github/workflows/anchor.yml index e80988907..826e3a7ef 100644 --- a/.github/workflows/anchor.yml +++ b/.github/workflows/anchor.yml @@ -138,9 +138,7 @@ jobs: - uses: heyAyushh/setup-anchor@v4.999 with: anchor-version: 1.0.0 - # Pinned because setup-anchor's resolver for 'stable' hits the - # unauthenticated GitHub API and frequently 429s, leaving CI without - # solana installed. Bump alongside anchor-version. + # setup-anchor resolves tags like stable by querying GitHub API for latest release which can fail with 429 errors solana-cli-version: 3.1.14 - name: Install Surfpool run: curl -sL https://run.surfpool.run/ | bash diff --git a/.github/workflows/native.yml b/.github/workflows/native.yml index e21ff1dd8..b144d382c 100644 --- a/.github/workflows/native.yml +++ b/.github/workflows/native.yml @@ -222,9 +222,7 @@ jobs: - name: Setup Solana Stable uses: heyAyushh/setup-solana@v5.9 with: - # Pinned because setup-anchor's resolver for 'stable' hits the - # unauthenticated GitHub API and frequently 429s, leaving CI without - # solana installed. Bump alongside anchor-version. + # setup-anchor resolves tags like stable by querying GitHub API for latest release which can fail with 429 errors solana-cli-version: 3.1.14 - name: Build and Test with Stable run: | diff --git a/.github/workflows/pinocchio.yml b/.github/workflows/pinocchio.yml index 8e8fc07d3..bb85d0876 100644 --- a/.github/workflows/pinocchio.yml +++ b/.github/workflows/pinocchio.yml @@ -222,9 +222,7 @@ jobs: - name: Setup Solana Stable uses: heyAyushh/setup-solana@v5.9 with: - # Pinned because setup-anchor's resolver for 'stable' hits the - # unauthenticated GitHub API and frequently 429s, leaving CI without - # solana installed. Bump alongside anchor-version. + # setup-anchor resolves tags like stable by querying GitHub API for latest release which can fail with 429 errors solana-cli-version: 3.1.14 - name: Build and Test with Stable run: | diff --git a/.github/workflows/quasar.yml b/.github/workflows/quasar.yml index 04090c86a..916d7d439 100644 --- a/.github/workflows/quasar.yml +++ b/.github/workflows/quasar.yml @@ -197,9 +197,7 @@ jobs: - name: Setup Solana Stable uses: heyAyushh/setup-solana@v5.9 with: - # Pinned because setup-anchor's resolver for 'stable' hits the - # unauthenticated GitHub API and frequently 429s, leaving CI without - # solana installed. Bump alongside anchor-version. + # setup-anchor resolves tags like stable by querying GitHub API for latest release which can fail with 429 errors solana-cli-version: 3.1.14 - name: Install Quasar CLI # Pinned to quasar rev 3d6fb0d8 (the HEAD this migration was written diff --git a/.github/workflows/solana-asm.yml b/.github/workflows/solana-asm.yml index 82af9a5fb..e053aab86 100644 --- a/.github/workflows/solana-asm.yml +++ b/.github/workflows/solana-asm.yml @@ -188,9 +188,7 @@ jobs: - name: Setup Solana Stable uses: heyAyushh/setup-solana@v5.9 with: - # Pinned because setup-anchor's resolver for 'stable' hits the - # unauthenticated GitHub API and frequently 429s, leaving CI without - # solana installed. Bump alongside anchor-version. + # setup-anchor resolves tags like stable by querying GitHub API for latest release which can fail with 429 errors solana-cli-version: 3.1.14 - name: Build and Test with Stable run: | From 0919a9d53e1c99ee87b89acbdd15e0546a687729 Mon Sep 17 00:00:00 2001 From: mikemaccana-edwardbot Date: Mon, 11 May 2026 22:26:53 +0000 Subject: [PATCH 4/6] ci(asm): pin pnpm via action-setup to avoid ERR_PNPM_IGNORED_BUILDS The ASM workflow installed pnpm with 'npm install --global pnpm', which resolves to the latest pnpm release. Recent pnpm releases escalate 'Ignored build scripts' from a warning to a hard error (ERR_PNPM_IGNORED_BUILDS), which makes 'pnpm install --frozen-lockfile' fail for any project with transitive build scripts that aren't on an explicit allow-list. The asm projects pull in bufferutil + utf-8-validate via @solana/web3.js -> ws. Switch to pnpm/action-setup@v4 (which the anchor, native, pinocchio, and typescript workflows already use). That action currently installs pnpm 10.33.0, which still treats this as a warning and lets the install succeed. --- .github/workflows/solana-asm.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/solana-asm.yml b/.github/workflows/solana-asm.yml index e053aab86..408344466 100644 --- a/.github/workflows/solana-asm.yml +++ b/.github/workflows/solana-asm.yml @@ -103,6 +103,12 @@ jobs: failed_projects: ${{ steps.set-failed.outputs.failed_projects }} steps: - uses: actions/checkout@v4 + # The previous `npm install --global pnpm` step picked up a pnpm release that + # treats ignored build scripts (bufferutil, utf-8-validate) as a hard error and + # fails `pnpm install --frozen-lockfile`. The other workflows (anchor, native, + # pinocchio, typescript) use pnpm/action-setup@v4, which pins a known-good pnpm + # release (10.33.0 at time of writing) that only warns. Match that here. + - uses: pnpm/action-setup@v4 - name: Use Node.js uses: actions/setup-node@v4 with: @@ -180,8 +186,8 @@ jobs: # Make the script executable chmod +x build_and_test.sh - # Install pnpm - npm install --global pnpm + # pnpm is installed by pnpm/action-setup@v4 above. Avoid `npm install --global pnpm` + # here because that resolves to pnpm 10+, which errors on ignored build scripts. # Install sbpf assembler cargo install --git https://github.com/blueshift-gg/sbpf.git From 3f7447c53d0b7b5add06c467fde48f87fd008974 Mon Sep 17 00:00:00 2001 From: mikemaccana-edwardbot Date: Mon, 11 May 2026 22:27:02 +0000 Subject: [PATCH 5/6] fix(quasar/compression): unwrap RemainingAccount to AccountView Newer quasar-lang (post-PR-#195 era) changed RemainingAccounts::iter() to yield Result instead of Result, so the existing 'proof_views[i] = result?' assignments stopped compiling. RemainingAccount is a safe wrapper around AccountView. We only need the inner view to forward to the bubblegum / spl-account-compression CPI as read-only proof nodes (no data borrows, no aliasing risk), so reach for 'as_account_view_unchecked' inside an unsafe block. Affects: - compression/cnft-burn/quasar (burn CPI proof nodes) - compression/cnft-vault/quasar (withdraw / withdraw_two transfer CPI) - compression/cutils/quasar (verify_leaf CPI) --- .../cnft-burn/quasar/src/instructions/burn_cnft.rs | 12 ++++++++++-- .../cnft-vault/quasar/src/instructions/withdraw.rs | 11 +++++++++-- .../quasar/src/instructions/withdraw_two.rs | 11 +++++++++-- compression/cutils/quasar/src/instructions/verify.rs | 11 +++++++++-- 4 files changed, 37 insertions(+), 8 deletions(-) diff --git a/compression/cnft-burn/quasar/src/instructions/burn_cnft.rs b/compression/cnft-burn/quasar/src/instructions/burn_cnft.rs index 3a0e69e1f..43c878d12 100644 --- a/compression/cnft-burn/quasar/src/instructions/burn_cnft.rs +++ b/compression/cnft-burn/quasar/src/instructions/burn_cnft.rs @@ -43,7 +43,12 @@ pub fn handle_burn_cnft(accounts: &mut BurnCnft, data: &[u8], remaining: Remaini ix_data[0..8].copy_from_slice(&BURN_DISCRIMINATOR); ix_data[8..116].copy_from_slice(&data[0..108]); - // Collect remaining accounts (proof nodes) into a stack buffer + // Collect remaining accounts (proof nodes) into a stack buffer. + // + // `remaining.iter()` yields `Result` in newer + // quasar-lang. Reach the inner `AccountView` via the unchecked accessor + // — this CPI only reads proof addresses and views, never touching the + // accounts' data, so the aliasing/borrow invariants are upheld. let placeholder = accounts.system_program.to_account_view().clone(); let mut proof_views: [AccountView; MAX_PROOF_NODES] = core::array::from_fn(|_| placeholder.clone()); @@ -52,7 +57,10 @@ pub fn handle_burn_cnft(accounts: &mut BurnCnft, data: &[u8], remaining: Remaini if proof_count >= MAX_PROOF_NODES { break; } - proof_views[proof_count] = result?; + let account = result?; + // SAFETY: We only read the AccountView's address and pass an immutable + // view to the bubblegum CPI as a proof node; no aliased data access. + proof_views[proof_count] = unsafe { account.as_account_view_unchecked() }.clone(); proof_count += 1; } diff --git a/compression/cnft-vault/quasar/src/instructions/withdraw.rs b/compression/cnft-vault/quasar/src/instructions/withdraw.rs index f3c4ccb8f..82d61bd76 100644 --- a/compression/cnft-vault/quasar/src/instructions/withdraw.rs +++ b/compression/cnft-vault/quasar/src/instructions/withdraw.rs @@ -50,7 +50,12 @@ pub fn handle_withdraw_cnft(accounts: &mut Withdraw, data: &[u8], remaining: Rem let ix_data = build_transfer_data(&data[0..TRANSFER_ARGS_LEN]); - // Collect proof nodes + // Collect proof nodes. + // + // `remaining.iter()` yields `Result` in newer + // quasar-lang. Reach the inner `AccountView` via the unchecked accessor + // — we only read addresses/views to forward to the bubblegum CPI as + // proof nodes; no aliased data access. let placeholder = accounts.system_program.to_account_view().clone(); let mut proof_views: [AccountView; MAX_PROOF_NODES] = core::array::from_fn(|_| placeholder.clone()); @@ -59,7 +64,9 @@ pub fn handle_withdraw_cnft(accounts: &mut Withdraw, data: &[u8], remaining: Rem if proof_count >= MAX_PROOF_NODES { break; } - proof_views[proof_count] = result?; + let account = result?; + // SAFETY: Only reads address and forwards an immutable view to CPI. + proof_views[proof_count] = unsafe { account.as_account_view_unchecked() }.clone(); proof_count += 1; } diff --git a/compression/cnft-vault/quasar/src/instructions/withdraw_two.rs b/compression/cnft-vault/quasar/src/instructions/withdraw_two.rs index fca3df2d8..9d4be6459 100644 --- a/compression/cnft-vault/quasar/src/instructions/withdraw_two.rs +++ b/compression/cnft-vault/quasar/src/instructions/withdraw_two.rs @@ -65,7 +65,12 @@ pub fn handle_withdraw_two_cnfts(accounts: &mut WithdrawTwo, data: &[u8], remain ]; let signer = Signer::from(&seeds as &[Seed]); - // Collect all remaining accounts (proof1 ++ proof2) + // Collect all remaining accounts (proof1 ++ proof2). + // + // `remaining.iter()` yields `Result` in newer + // quasar-lang. Reach the inner `AccountView` via the unchecked accessor + // — we only read addresses/views to forward to the bubblegum CPIs as + // proof nodes; no aliased data access. let placeholder = accounts.system_program.to_account_view().clone(); let mut all_proofs: [AccountView; MAX_PROOF_NODES * 2] = core::array::from_fn(|_| placeholder.clone()); @@ -74,7 +79,9 @@ pub fn handle_withdraw_two_cnfts(accounts: &mut WithdrawTwo, data: &[u8], remain if total_proofs >= MAX_PROOF_NODES * 2 { break; } - all_proofs[total_proofs] = result?; + let account = result?; + // SAFETY: Only reads address and forwards an immutable view to CPI. + all_proofs[total_proofs] = unsafe { account.as_account_view_unchecked() }.clone(); total_proofs += 1; } diff --git a/compression/cutils/quasar/src/instructions/verify.rs b/compression/cutils/quasar/src/instructions/verify.rs index 76184326d..2034d4ec2 100644 --- a/compression/cutils/quasar/src/instructions/verify.rs +++ b/compression/cutils/quasar/src/instructions/verify.rs @@ -55,7 +55,12 @@ pub fn handle_verify(accounts: &mut Verify, data: &[u8], remaining: RemainingAcc ix_data[40..72].copy_from_slice(&leaf_hash); ix_data[72..76].copy_from_slice(&index.to_le_bytes()); - // Collect proof nodes + // Collect proof nodes. + // + // `remaining.iter()` yields `Result` in newer + // quasar-lang. Reach the inner `AccountView` via the unchecked accessor + // — we only read addresses/views to forward to the compression CPI as + // proof nodes; no aliased data access. let placeholder = accounts.compression_program.to_account_view().clone(); let mut proof_views: [AccountView; MAX_PROOF_NODES] = core::array::from_fn(|_| placeholder.clone()); @@ -64,7 +69,9 @@ pub fn handle_verify(accounts: &mut Verify, data: &[u8], remaining: RemainingAcc if proof_count >= MAX_PROOF_NODES { break; } - proof_views[proof_count] = result?; + let account = result?; + // SAFETY: Only reads address and forwards an immutable view to CPI. + proof_views[proof_count] = unsafe { account.as_account_view_unchecked() }.clone(); proof_count += 1; } From 8696e80a9b5a4abf1d96b0b004338d2a208d1967 Mon Sep 17 00:00:00 2001 From: mikemaccana-edwardbot Date: Mon, 11 May 2026 22:27:10 +0000 Subject: [PATCH 6/6] fix(quasar/tokens): use InterfaceAccount for address-bound mints Newer quasar-lang's Account derive emits ::BUMP_OFFSET whenever the field carries an 'address = ...' constraint (it stores the discriminator-owned bump offset). SPL 'Mint' does not implement Discriminator, so build fails with: the trait bound `quasar_spl::Mint: quasar_lang::prelude::Discriminator` is not satisfied InterfaceAccount intentionally takes the generic existing-account verifier path that doesn't require Discriminator (so it can accept both SPL Token and Token-2022 mints), which makes it the right wrapper for an address-bound SPL Mint. Affects: - tokens/pda-mint-authority/quasar (MintTokens.mint at MintPda) - tokens/token-swap/quasar (deposit_liquidity / withdraw_liquidity mint_liquidity at LiquidityMintPda) --- tokens/pda-mint-authority/quasar/src/lib.rs | 8 +++++++- .../quasar/src/instructions/deposit_liquidity.rs | 9 ++++++++- .../quasar/src/instructions/withdraw_liquidity.rs | 9 ++++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/tokens/pda-mint-authority/quasar/src/lib.rs b/tokens/pda-mint-authority/quasar/src/lib.rs index c819d5f57..650a9ccb8 100644 --- a/tokens/pda-mint-authority/quasar/src/lib.rs +++ b/tokens/pda-mint-authority/quasar/src/lib.rs @@ -90,8 +90,14 @@ pub struct MintTokens { #[account(mut)] pub payer: Signer, /// The PDA mint whose authority is itself. + /// + /// Typed as `InterfaceAccount` rather than `Account` because + /// newer quasar-lang requires `T: Discriminator` when combining `address =` + /// with `Account` (it reads `T::BUMP_OFFSET`). SPL `Mint` doesn't + /// implement `Discriminator`; `InterfaceAccount` takes the generic + /// existing-account verifier path that doesn't need it. #[account(mut, address = MintPda::seeds())] - pub mint: Account, + pub mint: InterfaceAccount, /// Recipient token account (must already exist). #[account(mut)] pub token_account: Account, diff --git a/tokens/token-swap/quasar/src/instructions/deposit_liquidity.rs b/tokens/token-swap/quasar/src/instructions/deposit_liquidity.rs index 5abbc4c92..3fd10c264 100644 --- a/tokens/token-swap/quasar/src/instructions/deposit_liquidity.rs +++ b/tokens/token-swap/quasar/src/instructions/deposit_liquidity.rs @@ -22,8 +22,15 @@ pub struct DepositLiquidity { pub pool_authority: UncheckedAccount, /// Depositor (must be signer to authorise transfers). pub depositor: Signer, + /// LP mint at the LiquidityMintPda. + /// + /// Typed as `InterfaceAccount` rather than `Account` because + /// newer quasar-lang requires `T: Discriminator` when combining `address =` + /// with `Account` (it reads `T::BUMP_OFFSET`). SPL `Mint` doesn't + /// implement `Discriminator`; `InterfaceAccount` takes the generic + /// existing-account verifier path that doesn't need it. #[account(mut, address = LiquidityMintPda::seeds(amm.address(), mint_a.address(), mint_b.address()))] - pub mint_liquidity: Account, + pub mint_liquidity: InterfaceAccount, pub mint_a: Account, pub mint_b: Account, /// Pool's token A vault. diff --git a/tokens/token-swap/quasar/src/instructions/withdraw_liquidity.rs b/tokens/token-swap/quasar/src/instructions/withdraw_liquidity.rs index d9cdff0a3..1b23369e9 100644 --- a/tokens/token-swap/quasar/src/instructions/withdraw_liquidity.rs +++ b/tokens/token-swap/quasar/src/instructions/withdraw_liquidity.rs @@ -18,8 +18,15 @@ pub struct WithdrawLiquidity { #[account(address = PoolAuthorityPda::seeds(amm.address(), mint_a.address(), mint_b.address()))] pub pool_authority: UncheckedAccount, pub depositor: Signer, + /// LP mint at the LiquidityMintPda. + /// + /// Typed as `InterfaceAccount` rather than `Account` because + /// newer quasar-lang requires `T: Discriminator` when combining `address =` + /// with `Account` (it reads `T::BUMP_OFFSET`). SPL `Mint` doesn't + /// implement `Discriminator`; `InterfaceAccount` takes the generic + /// existing-account verifier path that doesn't need it. #[account(mut, address = LiquidityMintPda::seeds(amm.address(), mint_a.address(), mint_b.address()))] - pub mint_liquidity: Account, + pub mint_liquidity: InterfaceAccount, #[account(mut)] pub mint_a: Account, #[account(mut)]