fix(ci): unblock builds with solana-signature 3.4.1 and anchor 1.0.2#606
fix(ci): unblock builds with solana-signature 3.4.1 and anchor 1.0.2#606dev-jodee wants to merge 8 commits into
Conversation
Native/ASM/Pinocchio: solana-signature 3.3.0 (pulled via the litesvm dev-dependency) depends on five8 1.0.0, which is no_std and dropped the std::error::Error impl on DecodeError that 3.3.0's from_source requires, so the host test build fails to compile. Pin the lockfile to solana-signature 3.4.1, which fixes that usage. Anchor: programs were split across anchor-lang 1.0.0-rc.5 and 1.0.0 while the workflow still installed anchor-cli 0.32.1, so anchor build's CLI/lib version check failed for every project. Standardize all programs and the workflow on anchor 1.0.2.
Greptile SummaryThis PR unblocks CI by addressing two independent upstream breakages: pinning
Confidence Score: 5/5Safe to merge — changes are mechanical version bumps across 50 Cargo.toml files plus targeted CI workflow fixes with well-scoped blast radius. All anchor-lang/anchor-spl declarations converge on 1.0.2, Cargo.lock checksums are consistent, and the two sub-workspace lock files are regenerated. The workflow additions (--ignore-keys, retry loop, keys sync, --validator legacy) directly address the stated Anchor 1.0 CLI/lib mismatch. No logic regressions were found; the only outstanding item is a cosmetic log message on the final retry attempt. .github/workflows/anchor.yml is the most logic-dense file; the anchor keys sync call (line 164) still lacks error handling, but this was raised in a prior review thread. Important Files Changed
Sequence Diagram%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
participant GH as GitHub Actions
participant AC as anchor CLI 1.0.2
participant Cargo as Cargo (RETRY=10)
participant Val as legacy validator
GH->>AC: anchor build --ignore-keys (attempt 1..3)
AC->>Cargo: fetch crates (sparse protocol)
Cargo-->>AC: compiled .so + ephemeral keypairs
AC-->>GH: "build_ok=true"
GH->>AC: anchor keys sync
AC-->>GH: declare_id! + Anchor.toml updated to ephemeral IDs
GH->>Val: anchor test --validator legacy
Val->>AC: (re)build with synced IDs
AC-->>Val: deploy programs
Val-->>GH: test results
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
participant GH as GitHub Actions
participant AC as anchor CLI 1.0.2
participant Cargo as Cargo (RETRY=10)
participant Val as legacy validator
GH->>AC: anchor build --ignore-keys (attempt 1..3)
AC->>Cargo: fetch crates (sparse protocol)
Cargo-->>AC: compiled .so + ephemeral keypairs
AC-->>GH: "build_ok=true"
GH->>AC: anchor keys sync
AC-->>GH: declare_id! + Anchor.toml updated to ephemeral IDs
GH->>Val: anchor test --validator legacy
Val->>AC: (re)build with synced IDs
AC-->>Val: deploy programs
Val-->>GH: test results
Reviews (8): Last reviewed commit: "style(ci): format committed keypair JSON..." | Re-trigger Greptile |
Anchor 1.0 added a build-time check that declare_id! matches the program keypair, and defaults anchor test to surfpool. No keypairs are committed (CI generates ephemeral ones) and surfpool isn't installed, so both fail. Build with --ignore-keys, run anchor keys sync to align declare_id!, Anchor.toml and the IDL with the ephemeral keypair, and test against the legacy solana-test-validator.
token-fundraiser and nft-operations each have their own [workspace] and a committed Cargo.lock that still pinned anchor-lang 1.0.0-rc.5. Regenerate the anchor crate entries so the locks match the bumped manifests.
The cross-program-invocation example failed with AccountOwnedByWrongProgram: hand uses declare_program!(lever), which bakes lever's IDL address into hand at build time. anchor keys sync updates declare_id!/Anchor.toml but not the IDLs, and a plain rebuild doesn't recompile hand (cargo can't see the IDL proc-macro read as a file dependency). Run anchor clean (keeps keypairs) before the rebuild, and anchor test --skip-build to deploy the synced artifacts without rebuilding.
The two-program CPI example failed under ephemeral CI keys: hand uses declare_program!(lever), baking lever's IDL address into hand at build time. With keys regenerated/synced each run, hand's baked lever id drifted from the deployed lever, so the power account failed hand's owner check (AccountOwnedByWrongProgram). Commit fixed hand/lever keypairs (force-added past the gitignored target/) and set declare_id!/Anchor.toml to match, so the program ids are stable and consistent across build, IDL and deploy. Reverts the clean/double-build/--skip-build workaround added earlier; the committed keypairs fix the CPI case directly, so the simpler build --ignore-keys -> keys sync -> test --validator legacy flow is enough.
declare_program!(lever) in hand reads basics/cross-program-invocation/anchor/idls/lever.json at compile time, which still pinned the old lever id (E64F...). That baked id never matched the deployed lever, so the power account failed hand's owner check (AccountOwnedByWrongProgram). Point the committed IDL at the new committed lever keypair so declare_id!, keypair, Anchor.toml and idls/lever.json all agree.
cargo build-sbf intermittently fails its cargo metadata step with 'failed to get <crate> as a dependency' while updating the crates.io index, flaking a random project each run. Force the sparse registry protocol, raise CARGO_NET_RETRY, and retry anchor build up to 3 times.
The repo's biome check lints all tracked files; the new committed program keypairs need biome's JSON formatting. Whitespace-only — byte arrays and derived pubkeys unchanged.
Why CI on main is red
Two independent upstream-driven breakages, both from major releases pulled by loose version pins.
1. Native / ASM / Pinocchio —
five8 1.0.0breakssolana-signature 3.3.0cargo test(host build) fails to compile:solana-signature 3.3.0enters via thelitesvmdev-dependency and declaresfive8 = "1.0.0".five8 1.0.0is#![no_std]and dropped theErrorimpl onDecodeErrorthat3.3.0'sfrom_sourcerequires → broken release.Cargo.lockpinnedsolana-signature 3.3.0, so CI stayed on the broken combo.Fix: pin the lockfile to
solana-signature 3.4.1(fixes the usage; still usesfive8 1.0.0). Compile-verified locally — the fulllitesvm/solana-svm stack builds and theDecodeErrorerror is gone.2. Anchor — CLI / lib version mismatch
anchor-lang 1.0.0-rc.5(35 files) and1.0.0(15 files) after the rc migration + a dependabot bump.anchor-cli 0.32.1, soanchor build's exact CLI/lib match failed for every project.Fix: standardize all 50 programs (
anchor-lang+anchor-spl) andanchor.ymlonanchor 1.0.2(latest stable); drop the now-stale "pin to RC" comments. Lock resolves cleanly to anchor 1.0.2 with no conflicts; manifests TOML-validated.anchor builditself will be confirmed by CI here.Changes
Cargo.lock:solana-signature 3.3.0 → 3.4.1,anchor-lang/anchor-* 1.0.0 → 1.0.2Cargo.toml:anchor-lang/anchor-spl→1.0.2.github/workflows/anchor.yml:anchor-version 0.32.1 → 1.0.2