Skip to content

Migrate all Anchor projects from 0.32.1 to 1.0.0-rc.5#548

Open
mikemaccana-edwardbot wants to merge 5 commits intosolana-developers:mainfrom
mikemaccana:anchor-1.0
Open

Migrate all Anchor projects from 0.32.1 to 1.0.0-rc.5#548
mikemaccana-edwardbot wants to merge 5 commits intosolana-developers:mainfrom
mikemaccana:anchor-1.0

Conversation

@mikemaccana-edwardbot
Copy link
Contributor

@mikemaccana-edwardbot mikemaccana-edwardbot commented Mar 24, 2026

Summary

Migrates all 48 Anchor programs from anchor-lang 0.32.1 to 1.0.0-rc.5 (latest release candidate, published 2026-03-20).

CI fully green on fork — all Anchor tests pass, Rust lint passes.

Rust changes (48 programs)

  • anchor-lang 0.32.1 → 1.0.0-rc.5
  • anchor-spl 0.32.1 → 1.0.0-rc.5
  • CpiContext::new() program arg: .to_account_info().key() (Anchor 1.0 takes Pubkey)
  • Context lifetime params: 4 → 2 (transfer-fee)
  • Removed interface-instructions feature (transfer-hook projects)
  • Removed [registry] section from all Anchor.toml files

TypeScript changes

  • @coral-xyz/anchor@anchor-lang/core 1.0.0-rc.5
  • TypeScript bumped to ^5.3.3 where needed

Transfer-hook projects (7)

  • .map_err() wrappers on spl-tlv-account-resolution calls for solana-program-error 2.x → 3.x bridge
  • Upgraded SPL crates to Solana 3.x-compatible versions in transfer-cost
  • Box<InterfaceAccount> for large account structs (BPF stack overflow fix)
  • AccountInfoUncheckedAccount in Accounts structs

Compression projects (3)

  • Replaced mpl-bubblegum 2.1.1 and spl-account-compression 1.0.0 CPI wrappers with raw invoke()/invoke_signed() (no Solana 3.x compatible releases available)
  • New bubblegum_types.rs in cutils with reimplemented types using borsh 1.x
  • Added sha3 crate for keccak256

Why

Anchor 1.0 is the current release candidate (v1.0.0-rc.5). This migration ensures all program-examples build against the latest framework.

Rust changes (48 Anchor programs):
- anchor-lang 0.32.1 → 1.0.0-rc.5
- anchor-spl 0.32.1 → 1.0.0-rc.5
- CpiContext::new() program arg: .to_account_info() → .key() (Anchor 1.0 takes Pubkey)
- Context lifetime params: 4 → 2 (transfer-fee project)
- Removed interface-instructions feature (transfer-hook projects)
- Removed [registry] section from all Anchor.toml files

TypeScript changes:
- @coral-xyz/anchor → @anchor-lang/core 1.0.0-rc.5
- TypeScript bumped to ^5.3.3 where needed

Transfer-hook projects (7):
- Added .map_err() wrappers on spl-tlv-account-resolution calls to bridge
  solana-program-error 2.x → 3.x ProgramError type gap
- transmute_pubkey() helper for solana-pubkey 2.x → 3.x in transfer-cost
- Fixed #[instruction] attribute mismatches in transfer-switch (stricter in 1.0)
- AccountInfo → UncheckedAccount in Accounts structs

Compression projects (3):
- Replaced mpl-bubblegum 2.1.1 and spl-account-compression 1.0.0 CPI wrappers
  with raw invoke()/invoke_signed() — these crates depend on Solana 2.x types
  and have no Solana 3.x compatible release yet
- New bubblegum_types.rs in cutils with reimplemented types using borsh 1.x
- Added sha3 crate for keccak256 (solana_program::keccak removed in Solana 3.x)

Why: Anchor 1.0 is the current release candidate. This migration ensures all
program-examples build against the latest framework. Pin to RC until stable.
…erging_sub_expression

- Regenerated root Cargo.lock to resolve solana-address version conflicts
- basics/rent: replaced try_to_vec() with borsh::to_vec() (borsh 1.x compat)
- clippy: allow diverging_sub_expression (false positive from Anchor 1.0 #[program] macro)
- Box large InterfaceAccount fields to avoid BPF stack frame overflow
  (12 accounts exceeded 4096-byte limit in Anchor 1.0's try_accounts)
- Upgrade spl-discriminator 0.4.1→0.5.2, spl-tlv-account-resolution 0.9.0→0.11.1,
  spl-transfer-hook-interface 0.9.0→2.1.0 (now compatible with Solana 3.x)
- Remove transmute_pubkey() hack (no longer needed with matching Pubkey types)
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