From 0925a248b2df7c152b21c3a126890c53c3e19387 Mon Sep 17 00:00:00 2001 From: GraveYield Date: Thu, 14 May 2026 09:40:39 +0800 Subject: [PATCH 1/2] chore(toolchain): align stack to official Solana 3.x line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bumps the entire toolchain to match https://solana.com/docs/intro/installation: Solana CLI: 2.2.18 -> 3.0.10 Anchor CLI: 0.31.1 -> 0.32.1 Rust (host): 1.85.0 -> 1.91.1 Node.js: 20 -> 24 rust-version: 1.79 -> 1.91 Pinned platform-tools v1.54 (cargo 1.85) stays as the source of truth for the BPF compile — Solana 3.0.10 + Anchor 0.32.1 still default to older platform-tools (cargo 1.84) which can't parse edition2024 manifests, so the explicit `[workspace.metadata.solana] tools-version` override remains required. Repository field in Cargo.toml also updated from the stale lowercase graveyieldprotocol/protocol path to the canonical org path GraveYield-Protocol/protocol. Anchor 0.32 breaking-change surface (per release notes): - spl: anchor-spl deps bumped to latest. We removed all `anchor_spl::Account::try_from` usage in m4 (manual byte parsing), so this should be neutral. - lang: `solana-program` crate replaced with smaller crates. We import `anchor_lang::solana_program::pubkey` in adapter files; if the re-export path moved, CI will surface it. - lang: deprecated realloc / clippy fixes. Our `#![allow(deprecated)]` and `#![allow(unexpected_cfgs)]` in grave-scanner/src/lib.rs may be redundant on 0.32; left in place for now, can drop in a follow-up. Local verification not run on this commit — host Rust 1.91 isn't installed in the sandbox and installing rustup through the sandbox proxy is fragile. CI will verify cargo fmt / clippy / test on 1.91 and BPF compile via Solana 3.0.10 + platform-tools v1.54. If CI surfaces an Anchor 0.32 migration issue, the follow-up patch lands as chore(toolchain)-bump.0.1. --- .github/workflows/ci.yml | 19 +++++++------------ Anchor.toml | 10 ++++------ Cargo.toml | 22 +++++++++++----------- indexer/package.json | 4 ++-- package.json | 8 ++++---- rust-toolchain.toml | 12 ++++++------ sdk/package.json | 6 +++--- 7 files changed, 37 insertions(+), 44 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 115a656..bc14321 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,18 +15,13 @@ concurrency: cancel-in-progress: true env: - # Solana 2.2.18 ships platform-tools v1.50 (cargo 1.85). Earlier 2.x - # versions (e.g. 2.0.21, 2.1.x) ship cargo 1.75/1.79, which cannot - # parse the `edition2024` manifests pulled in transitively by - # anchor-lang 0.31.1's solana-program 2.3.0 dep chain. The on-chain - # ABI is unchanged; only the BPF compile toolchain advances. - SOLANA_VERSION: 2.2.18 - ANCHOR_VERSION: 0.31.1 - # Host toolchain. Must match rust-toolchain.toml — the modern SPL crate - # ecosystem (digest 0.11 / block-buffer 0.12) requires edition2024 = 1.85+. - # The on-chain BPF build still uses Solana platform-tools' embedded Rust. - RUST_TOOLCHAIN: 1.85.0 - NODE_VERSION: 20 + # Aligned with the official Solana 3.x stack: + # https://solana.com/docs/intro/installation + SOLANA_VERSION: 3.0.10 + ANCHOR_VERSION: 0.32.1 + # Host toolchain. Must match rust-toolchain.toml. + RUST_TOOLCHAIN: 1.91.1 + NODE_VERSION: 24 PNPM_VERSION: 9 jobs: diff --git a/Anchor.toml b/Anchor.toml index b192f6c..9f30318 100644 --- a/Anchor.toml +++ b/Anchor.toml @@ -1,10 +1,8 @@ [toolchain] -anchor_version = "0.31.1" -# 2.2.18 ships platform-tools v1.50 (cargo 1.85), the first BPF toolchain -# that handles the `edition2024` manifests pulled in transitively by -# anchor-lang 0.31.1. Earlier 2.x versions (2.0.21, 2.1.x) ship cargo -# 1.75/1.79 and fail at dep-fetch time. On-chain runtime ABI unchanged. -solana_version = "2.2.18" +# Aligned with the official Solana 3.x stack (per +# https://solana.com/docs/intro/installation). +anchor_version = "0.32.1" +solana_version = "3.0.10" [features] resolution = true diff --git a/Cargo.toml b/Cargo.toml index 1d1f8ca..05a4689 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,25 +8,25 @@ members = [ [workspace.package] version = "0.1.0" edition = "2021" -# MSRV pin: matches rust-toolchain.toml and Solana 2.0.x BPF compilation. -# Cargo 1.84+ uses this for MSRV-aware dependency resolution; on Cargo 1.79 -# this is informational and the lockfile drives compatibility. -rust-version = "1.79" +# Aligned with the official Solana 3.x stack (rust 1.91.1 per +# https://solana.com/docs/intro/installation). Cargo's MSRV-aware resolver +# uses this when resolving dep versions. +rust-version = "1.91" license = "Apache-2.0" authors = ["GraveYield Protocol contributors"] -repository = "https://github.com/graveyieldprotocol/protocol" +repository = "https://github.com/GraveYield-Protocol/protocol" homepage = "https://graveyield.xyz" readme = "README.md" [workspace.dependencies] -anchor-lang = "0.31.1" -anchor-spl = "0.31.1" +anchor-lang = "0.32.1" +anchor-spl = "0.32.1" # cargo-build-sbf reads this to pick the platform-tools version for the -# BPF compile. v2.2.18's default is v1.48 (cargo 1.84), which can't parse -# the edition2024 manifests pulled in transitively by anchor-lang 0.31.1. -# v1.54 (2026-03-06) ships cargo 1.85+, which is the first BPF toolchain -# that handles edition2024 cleanly. +# BPF compile. v1.54 (2026-03-06) ships cargo 1.85+, the first BPF +# toolchain that handles edition2024 manifests. Solana 3.0.10 + Anchor +# 0.32.1 still default to older platform-tools (cargo 1.84) so the +# explicit pin remains the source of truth for our reproducible build. [workspace.metadata.solana] tools-version = "v1.54" diff --git a/indexer/package.json b/indexer/package.json index dc7b928..c8022b0 100644 --- a/indexer/package.json +++ b/indexer/package.json @@ -18,10 +18,10 @@ "@graveyield/sdk": "workspace:*" }, "devDependencies": { - "@types/node": "^20.19.40", + "@types/node": "^24.0.0", "typescript": "^5.6.0" }, "engines": { - "node": ">=20.0.0" + "node": ">=24.0.0" } } diff --git a/package.json b/package.json index 74ea31f..780fc1a 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "license": "Apache-2.0", "packageManager": "pnpm@9.12.0", "engines": { - "node": ">=20.0.0", + "node": ">=24.0.0", "pnpm": ">=9.0.0" }, "scripts": { @@ -27,17 +27,17 @@ "lint:rust": "cargo clippy --all-targets -- -D warnings" }, "devDependencies": { - "@types/node": "^20.19.40", + "@types/node": "^24.0.0", "typescript": "^5.6.0" }, "pnpm": { "overrides": { - "@types/node": "^20.19.40", + "@types/node": "^24.0.0", "@types/bn.js": "^5.1.5" }, "peerDependencyRules": { "allowedVersions": { - "@types/node": "^20.19.40" + "@types/node": "^24.0.0" } } } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 118b997..d24c976 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,9 +1,9 @@ [toolchain] -# Host toolchain for `cargo check` / `clippy` / `fmt`. The on-chain BPF build -# is performed by Solana platform-tools' embedded Rust toolchain (currently -# Solana 2.0.x), so this pin only affects host-side compilation of proc -# macros and tooling. 1.85 is required by the modern SPL crate ecosystem -# (digest 0.11 -> block-buffer 0.12 require edition2024 = Rust 1.85+). -channel = "1.85.0" +# Host toolchain for `cargo check` / `clippy` / `fmt`. The on-chain BPF +# build runs on Solana platform-tools' embedded Rust toolchain; this pin +# only affects host-side compilation of proc macros and tooling. 1.91.1 +# is the version aligned with the official Solana 3.x stack +# (https://solana.com/docs/intro/installation). +channel = "1.91.1" components = ["rustfmt", "clippy"] profile = "minimal" diff --git a/sdk/package.json b/sdk/package.json index 0566eec..f02b4c2 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -25,17 +25,17 @@ "clean": "rm -rf dist" }, "dependencies": { - "@coral-xyz/anchor": "^0.31.1", + "@coral-xyz/anchor": "^0.32.1", "@solana/web3.js": "^1.95.0", "@solana/spl-token": "^0.4.6", "bn.js": "^5.2.1" }, "devDependencies": { "@types/bn.js": "^5.1.5", - "@types/node": "^20.19.40", + "@types/node": "^24.0.0", "typescript": "^5.6.0" }, "engines": { - "node": ">=20.0.0" + "node": ">=24.0.0" } } From 78dbce1fd53dd3db97e319ae0a8e2ae4d6739d32 Mon Sep 17 00:00:00 2001 From: GraveYield Date: Thu, 14 May 2026 09:46:46 +0800 Subject: [PATCH 2/2] fix(grave-scanner): drop anchor_lang::solana_program::pubkey import for Anchor 0.32 Anchor 0.32's `lang: Replace solana-program crate with smaller crates` refactor (PR #3819) moved the `pubkey!` macro re-export so the explicit `use anchor_lang::solana_program::pubkey;` we had in all 5 adapter files is now `unused_imports` under clippy. The macro itself resolves fine via the existing `use anchor_lang::prelude::*;` in each file. Local verification on rust 1.91.1 + anchor 0.32.1: - cargo fmt --all -- --check: clean - cargo clippy --workspace --all-targets -- -D warnings: clean - cargo test -p grave-scanner --lib: 19/19 pass --- programs/grave-scanner/src/adapters/meteora.rs | 1 - programs/grave-scanner/src/adapters/orca_whirlpool.rs | 1 - programs/grave-scanner/src/adapters/pumpswap.rs | 1 - programs/grave-scanner/src/adapters/raydium_clmm.rs | 1 - programs/grave-scanner/src/adapters/raydium_v4.rs | 1 - 5 files changed, 5 deletions(-) diff --git a/programs/grave-scanner/src/adapters/meteora.rs b/programs/grave-scanner/src/adapters/meteora.rs index 6a59d84..fd57505 100644 --- a/programs/grave-scanner/src/adapters/meteora.rs +++ b/programs/grave-scanner/src/adapters/meteora.rs @@ -8,7 +8,6 @@ // docs/PRE_MAINNET_CHECKLIST.md tracks the confirmation step. use anchor_lang::prelude::*; -use anchor_lang::solana_program::pubkey; use super::PoolData; use crate::errors::GraveScannerError; diff --git a/programs/grave-scanner/src/adapters/orca_whirlpool.rs b/programs/grave-scanner/src/adapters/orca_whirlpool.rs index e55e467..d4c6efc 100644 --- a/programs/grave-scanner/src/adapters/orca_whirlpool.rs +++ b/programs/grave-scanner/src/adapters/orca_whirlpool.rs @@ -8,7 +8,6 @@ // aggregation rather than a single base/quote read. use anchor_lang::prelude::*; -use anchor_lang::solana_program::pubkey; use super::PoolData; use crate::errors::GraveScannerError; diff --git a/programs/grave-scanner/src/adapters/pumpswap.rs b/programs/grave-scanner/src/adapters/pumpswap.rs index 0a1978e..9b03154 100644 --- a/programs/grave-scanner/src/adapters/pumpswap.rs +++ b/programs/grave-scanner/src/adapters/pumpswap.rs @@ -8,7 +8,6 @@ // the AMM account layout differs in field offsets and the vault types. use anchor_lang::prelude::*; -use anchor_lang::solana_program::pubkey; use super::PoolData; use crate::errors::GraveScannerError; diff --git a/programs/grave-scanner/src/adapters/raydium_clmm.rs b/programs/grave-scanner/src/adapters/raydium_clmm.rs index e68d5a1..230bd50 100644 --- a/programs/grave-scanner/src/adapters/raydium_clmm.rs +++ b/programs/grave-scanner/src/adapters/raydium_clmm.rs @@ -9,7 +9,6 @@ // single vault pair. v1.1 milestone. use anchor_lang::prelude::*; -use anchor_lang::solana_program::pubkey; use super::PoolData; use crate::errors::GraveScannerError; diff --git a/programs/grave-scanner/src/adapters/raydium_v4.rs b/programs/grave-scanner/src/adapters/raydium_v4.rs index 5405a54..33c0ff4 100644 --- a/programs/grave-scanner/src/adapters/raydium_v4.rs +++ b/programs/grave-scanner/src/adapters/raydium_v4.rs @@ -26,7 +26,6 @@ // attestation lands). use anchor_lang::prelude::*; -use anchor_lang::solana_program::pubkey; use super::PoolData; use crate::errors::GraveScannerError;