Skip to content

Commit b58d1f2

Browse files
authored
Merge pull request #14 from mikemaccana-edwardbot/ci-note-anza-stable-flake
ci: pin solana-cli-version to 3.1.14 (setup-anchor's stable resolver 429s)
2 parents 68fa7ea + 8696e80 commit b58d1f2

12 files changed

Lines changed: 78 additions & 18 deletions

File tree

.github/workflows/anchor.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ jobs:
138138
- uses: heyAyushh/setup-anchor@v4.999
139139
with:
140140
anchor-version: 1.0.0
141-
solana-cli-version: stable
141+
# setup-anchor resolves tags like stable by querying GitHub API for latest release which can fail with 429 errors
142+
solana-cli-version: 3.1.14
142143
- name: Install Surfpool
143144
run: curl -sL https://run.surfpool.run/ | bash
144145
- name: Display Versions

.github/workflows/native.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ jobs:
222222
- name: Setup Solana Stable
223223
uses: heyAyushh/setup-solana@v5.9
224224
with:
225-
solana-cli-version: stable
225+
# setup-anchor resolves tags like stable by querying GitHub API for latest release which can fail with 429 errors
226+
solana-cli-version: 3.1.14
226227
- name: Build and Test with Stable
227228
run: |
228229
source build_and_test.sh

.github/workflows/pinocchio.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ jobs:
222222
- name: Setup Solana Stable
223223
uses: heyAyushh/setup-solana@v5.9
224224
with:
225-
solana-cli-version: stable
225+
# setup-anchor resolves tags like stable by querying GitHub API for latest release which can fail with 429 errors
226+
solana-cli-version: 3.1.14
226227
- name: Build and Test with Stable
227228
run: |
228229
source build_and_test.sh

.github/workflows/quasar.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,8 @@ jobs:
197197
- name: Setup Solana Stable
198198
uses: heyAyushh/setup-solana@v5.9
199199
with:
200-
solana-cli-version: stable
200+
# setup-anchor resolves tags like stable by querying GitHub API for latest release which can fail with 429 errors
201+
solana-cli-version: 3.1.14
201202
- name: Install Quasar CLI
202203
# Pinned to quasar rev 3d6fb0d8 (the HEAD this migration was written
203204
# against, immediately after PRs #195 + #196). The next merged PR

.github/workflows/solana-asm.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ jobs:
103103
failed_projects: ${{ steps.set-failed.outputs.failed_projects }}
104104
steps:
105105
- uses: actions/checkout@v4
106+
# The previous `npm install --global pnpm` step picked up a pnpm release that
107+
# treats ignored build scripts (bufferutil, utf-8-validate) as a hard error and
108+
# fails `pnpm install --frozen-lockfile`. The other workflows (anchor, native,
109+
# pinocchio, typescript) use pnpm/action-setup@v4, which pins a known-good pnpm
110+
# release (10.33.0 at time of writing) that only warns. Match that here.
111+
- uses: pnpm/action-setup@v4
106112
- name: Use Node.js
107113
uses: actions/setup-node@v4
108114
with:
@@ -180,15 +186,16 @@ jobs:
180186
# Make the script executable
181187
chmod +x build_and_test.sh
182188
183-
# Install pnpm
184-
npm install --global pnpm
189+
# pnpm is installed by pnpm/action-setup@v4 above. Avoid `npm install --global pnpm`
190+
# here because that resolves to pnpm 10+, which errors on ignored build scripts.
185191
186192
# Install sbpf assembler
187193
cargo install --git https://github.com/blueshift-gg/sbpf.git
188194
- name: Setup Solana Stable
189195
uses: heyAyushh/setup-solana@v5.9
190196
with:
191-
solana-cli-version: stable
197+
# setup-anchor resolves tags like stable by querying GitHub API for latest release which can fail with 429 errors
198+
solana-cli-version: 3.1.14
192199
- name: Build and Test with Stable
193200
run: |
194201
source build_and_test.sh

compression/cnft-burn/quasar/src/instructions/burn_cnft.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ pub fn handle_burn_cnft(accounts: &mut BurnCnft, data: &[u8], remaining: Remaini
4343
ix_data[0..8].copy_from_slice(&BURN_DISCRIMINATOR);
4444
ix_data[8..116].copy_from_slice(&data[0..108]);
4545

46-
// Collect remaining accounts (proof nodes) into a stack buffer
46+
// Collect remaining accounts (proof nodes) into a stack buffer.
47+
//
48+
// `remaining.iter()` yields `Result<RemainingAccount, _>` in newer
49+
// quasar-lang. Reach the inner `AccountView` via the unchecked accessor
50+
// — this CPI only reads proof addresses and views, never touching the
51+
// accounts' data, so the aliasing/borrow invariants are upheld.
4752
let placeholder = accounts.system_program.to_account_view().clone();
4853
let mut proof_views: [AccountView; MAX_PROOF_NODES] =
4954
core::array::from_fn(|_| placeholder.clone());
@@ -52,7 +57,10 @@ pub fn handle_burn_cnft(accounts: &mut BurnCnft, data: &[u8], remaining: Remaini
5257
if proof_count >= MAX_PROOF_NODES {
5358
break;
5459
}
55-
proof_views[proof_count] = result?;
60+
let account = result?;
61+
// SAFETY: We only read the AccountView's address and pass an immutable
62+
// view to the bubblegum CPI as a proof node; no aliased data access.
63+
proof_views[proof_count] = unsafe { account.as_account_view_unchecked() }.clone();
5664
proof_count += 1;
5765
}
5866

compression/cnft-vault/quasar/src/instructions/withdraw.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ pub fn handle_withdraw_cnft(accounts: &mut Withdraw, data: &[u8], remaining: Rem
5050

5151
let ix_data = build_transfer_data(&data[0..TRANSFER_ARGS_LEN]);
5252

53-
// Collect proof nodes
53+
// Collect proof nodes.
54+
//
55+
// `remaining.iter()` yields `Result<RemainingAccount, _>` in newer
56+
// quasar-lang. Reach the inner `AccountView` via the unchecked accessor
57+
// — we only read addresses/views to forward to the bubblegum CPI as
58+
// proof nodes; no aliased data access.
5459
let placeholder = accounts.system_program.to_account_view().clone();
5560
let mut proof_views: [AccountView; MAX_PROOF_NODES] =
5661
core::array::from_fn(|_| placeholder.clone());
@@ -59,7 +64,9 @@ pub fn handle_withdraw_cnft(accounts: &mut Withdraw, data: &[u8], remaining: Rem
5964
if proof_count >= MAX_PROOF_NODES {
6065
break;
6166
}
62-
proof_views[proof_count] = result?;
67+
let account = result?;
68+
// SAFETY: Only reads address and forwards an immutable view to CPI.
69+
proof_views[proof_count] = unsafe { account.as_account_view_unchecked() }.clone();
6370
proof_count += 1;
6471
}
6572

compression/cnft-vault/quasar/src/instructions/withdraw_two.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ pub fn handle_withdraw_two_cnfts(accounts: &mut WithdrawTwo, data: &[u8], remain
6565
];
6666
let signer = Signer::from(&seeds as &[Seed]);
6767

68-
// Collect all remaining accounts (proof1 ++ proof2)
68+
// Collect all remaining accounts (proof1 ++ proof2).
69+
//
70+
// `remaining.iter()` yields `Result<RemainingAccount, _>` in newer
71+
// quasar-lang. Reach the inner `AccountView` via the unchecked accessor
72+
// — we only read addresses/views to forward to the bubblegum CPIs as
73+
// proof nodes; no aliased data access.
6974
let placeholder = accounts.system_program.to_account_view().clone();
7075
let mut all_proofs: [AccountView; MAX_PROOF_NODES * 2] =
7176
core::array::from_fn(|_| placeholder.clone());
@@ -74,7 +79,9 @@ pub fn handle_withdraw_two_cnfts(accounts: &mut WithdrawTwo, data: &[u8], remain
7479
if total_proofs >= MAX_PROOF_NODES * 2 {
7580
break;
7681
}
77-
all_proofs[total_proofs] = result?;
82+
let account = result?;
83+
// SAFETY: Only reads address and forwards an immutable view to CPI.
84+
all_proofs[total_proofs] = unsafe { account.as_account_view_unchecked() }.clone();
7885
total_proofs += 1;
7986
}
8087

compression/cutils/quasar/src/instructions/verify.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,12 @@ pub fn handle_verify(accounts: &mut Verify, data: &[u8], remaining: RemainingAcc
5555
ix_data[40..72].copy_from_slice(&leaf_hash);
5656
ix_data[72..76].copy_from_slice(&index.to_le_bytes());
5757

58-
// Collect proof nodes
58+
// Collect proof nodes.
59+
//
60+
// `remaining.iter()` yields `Result<RemainingAccount, _>` in newer
61+
// quasar-lang. Reach the inner `AccountView` via the unchecked accessor
62+
// — we only read addresses/views to forward to the compression CPI as
63+
// proof nodes; no aliased data access.
5964
let placeholder = accounts.compression_program.to_account_view().clone();
6065
let mut proof_views: [AccountView; MAX_PROOF_NODES] =
6166
core::array::from_fn(|_| placeholder.clone());
@@ -64,7 +69,9 @@ pub fn handle_verify(accounts: &mut Verify, data: &[u8], remaining: RemainingAcc
6469
if proof_count >= MAX_PROOF_NODES {
6570
break;
6671
}
67-
proof_views[proof_count] = result?;
72+
let account = result?;
73+
// SAFETY: Only reads address and forwards an immutable view to CPI.
74+
proof_views[proof_count] = unsafe { account.as_account_view_unchecked() }.clone();
6875
proof_count += 1;
6976
}
7077

tokens/pda-mint-authority/quasar/src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,14 @@ pub struct MintTokens {
9090
#[account(mut)]
9191
pub payer: Signer,
9292
/// The PDA mint whose authority is itself.
93+
///
94+
/// Typed as `InterfaceAccount<Mint>` rather than `Account<Mint>` because
95+
/// newer quasar-lang requires `T: Discriminator` when combining `address =`
96+
/// with `Account<T>` (it reads `T::BUMP_OFFSET`). SPL `Mint` doesn't
97+
/// implement `Discriminator`; `InterfaceAccount` takes the generic
98+
/// existing-account verifier path that doesn't need it.
9399
#[account(mut, address = MintPda::seeds())]
94-
pub mint: Account<Mint>,
100+
pub mint: InterfaceAccount<Mint>,
95101
/// Recipient token account (must already exist).
96102
#[account(mut)]
97103
pub token_account: Account<Token>,

0 commit comments

Comments
 (0)