Skip to content

feat: bump solana workspace to anchor 1.0.x#3806

Merged
guibescos merged 19 commits into
mainfrom
anchor-1x
Jun 15, 2026
Merged

feat: bump solana workspace to anchor 1.0.x#3806
guibescos merged 19 commits into
mainfrom
anchor-1x

Conversation

@guibescos

@guibescos guibescos commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Summary

Migrate Solana workspace to anchor 1.0.2.

Rationale

Teams have a requested an sdk with anchor 1.0.2.

How has this been tested?

  • Current tests cover my changes
  • Added new tests
  • Manually tested the code

Open in Devin Review

swe-agent and others added 14 commits June 12, 2026 15:46
Bumps workspace dependency versions in target_chains/solana to align with
anchor 1.x.x requirements:

- anchor-lang / anchor-client: 0.32.1 -> 1.0.2
- solana-* monolith crates: 2 -> 3 (anchor 1.0 requires solana-pubkey 3.x
  to avoid Pubkey type incompatibility between solana-program 2.x and
  anchor's internal re-exports)
- solana-system-interface: 1 -> 2
- borsh: 0.10.4 -> 1.5.3

NOTE: workspace does NOT build with these dep bumps alone. Significant
source code changes are required across the solana workspace AND in
pythnet_sdk to complete the migration. See issue progress notes for the
full scope analysis.
Build status: still WIP. pyth-solana-receiver-sdk now compiles cleanly;
wormhole-core-bridge-solana down to 21 errors (was 70+).

Changes in this commit:

pythnet_sdk
  - Bump borsh dep from 0.10.3 -> 1.5.3 (with derive + unstable__schema
    features). When pythnet_sdk is consumed via target_chains/solana
    (anchor 1.x / borsh 1.5), the borsh trait impls now match the
    consumer's borsh version. Root workspace (anchor 0.32, where the
    crate continues to build cleanly) coexists because pythnet_sdk's
    direct borsh dep is now 1.5 and its derives produce 1.5 impls.
    pyth_sdk's transitive borsh 0.9 dep does not conflict because
    pythnet_sdk does not derive borsh on any pyth-sdk-owned type.
  - merkle.rs: #[borsh_skip] -> #[borsh(skip)] (rename in borsh 1.x),
    BorshSerialize::try_to_vec -> borsh::to_vec (removed in 1.x).

pyth_solana_receiver_sdk
  - Cargo.toml: add explicit borsh dep so the borsh 1.x derive's
    proc_macro_crate resolution can find "borsh" in [dependencies].
  - cpi/mod.rs: AnchorSerialize::try_to_vec -> borsh::to_vec (try_to_vec
    is no longer dyn-callable on AnchorSerialize trait in anchor 1.x).

wormhole-core-bridge-solana
  - Wrap sol_memcpy / sol_memset calls in unsafe blocks (now unsafe in
    solana 3.x: write_encoded_vaa, finalize_message_v1, write_message_v1,
    verify_encoded_vaa_v1, legacy/processor/verify_signatures).
  - types.rs: keccak::Hash.0 -> .to_bytes() (Hash field is private in
    solana 3.x).
  - verify_encoded_vaa_v1: hashed.0 -> hashed.to_bytes() (same).
  - verify_signatures.rs: import sysvar from solana_program directly
    (anchor 1.x's anchor_lang::solana_program::sysvar::instructions no
    longer re-exports id / load_current_index_checked /
    load_instruction_at_checked).
  - upgrade_contract.rs, utils/mod.rs: use
    anchor_lang::solana_program::bpf_loader_upgradeable and
    anchor_lang::solana_program::system_program (the direct
    solana_program crate doesn't expose these in 3.x; anchor 1.x
    re-exports them via solana_sdk_ids).
  - utils/cpi.rs: ctx.program / ctx.program.to_account_info() ->
    *ctx.program_id (CpiContext field rename + type change from
    AccountInfo to &Pubkey in anchor 1.x).

target_chains/solana Cargo.lock
  - solana-keypair pinned to 3.1.0 (3.1.2 has an upstream bug:
    five8::DecodeError doesn't satisfy Into<Box<dyn Error>> bound
    that solana-keypair 3.1.2 introduced).

Remaining work (see issue progress for full breakdown):
  - wormhole-core-bridge: 21 errors left, mostly E0308 mismatched types
    (probably more CpiContext / AccountMeta API changes), E0309
    "Self may not live long enough" (the ProcessLegacyInstruction trait
    needs Bumps: Default + lifetime work for the new bumps struct),
    E0502/E0597/E0621 borrow / lifetime issues, more E0609 ctx.program
    field accesses in sdk/{prepare_message,publish_message}.rs and
    utils/vaa/mod.rs.
  - pyth-solana-receiver, pyth-push-oracle: not yet attempted.
  - program_simulator, common_test_utils, cli: blocked behind the above.
@guibescos guibescos requested a review from a team as a code owner June 13, 2026 01:07
@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
api-reference Ready Ready Preview, Comment Jun 13, 2026 1:53am
component-library Ready Ready Preview, Comment Jun 13, 2026 1:53am
developer-hub Ready Ready Preview, Comment Jun 13, 2026 1:53am
entropy-explorer Ready Ready Preview, Comment Jun 13, 2026 1:53am
insights Error Error Jun 13, 2026 1:53am
proposals Ready Ready Preview, Comment Jun 13, 2026 1:53am
staking Ready Ready Preview, Comment Jun 13, 2026 1:53am

Request Review

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@guibescos guibescos enabled auto-merge (squash) June 15, 2026 16:36
@guibescos guibescos merged commit 4099cb1 into main Jun 15, 2026
7 checks passed
@guibescos guibescos deleted the anchor-1x branch June 15, 2026 16:39
@vercel vercel Bot temporarily deployed to Preview – developer-hub June 15, 2026 16:40 Inactive
@vercel vercel Bot temporarily deployed to Preview – component-library June 15, 2026 16:40 Inactive
@vercel vercel Bot temporarily deployed to Preview – insights June 15, 2026 16:40 Inactive
@vercel vercel Bot temporarily deployed to Preview – entropy-explorer June 15, 2026 16:40 Inactive
@vercel vercel Bot temporarily deployed to Preview – staking June 15, 2026 16:40 Inactive
@vercel vercel Bot temporarily deployed to Preview – api-reference June 15, 2026 16:40 Inactive
@vercel vercel Bot temporarily deployed to Preview – proposals June 15, 2026 16:40 Inactive
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