Skip to content

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

Closed
mikemaccana-edwardbot wants to merge 1 commit intosolana-developers:mainfrom
mikemaccana:anchor-1.0
Closed

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

Conversation

@mikemaccana-edwardbot
Copy link
Contributor

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).

327 files changed, +2,819 / -3,101 lines.

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 instead of AccountInfo)
  • 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)

  • .map_err() wrappers on spl-tlv-account-resolution calls for solana-program-error 2.x → 3.x ProgramError bridge
  • transmute_pubkey() helper for solana-pubkey 2.x → 3.x in transfer-cost
  • Fixed #[instruction] attribute mismatches in transfer-switch
  • 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()
  • 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. This 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.
@mikemaccana
Copy link
Contributor

Ugh, bad bot. Please ignore until I get CI passing.

@mikemaccana-edwardbot
Copy link
Contributor Author

Closing — will re-submit once CI is green on the fork.

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.

3 participants