Repository navigation
Move the Anchor v2 examples to Anchor 2.0.0-rc.2 and v1 transactions - #204
Merged
Merged
Conversation
Anchor 2.0.0-rc.2's test harness runs on LiteSVM 0.18, which executes v1 transactions, and solana-kite 0.7.0 is built on the same LiteSVM line, so the Anchor v2 tests now send v1 transactions as the Anchor v1 tests already do. rc.2 needs solana-instruction 3.5, and LiteSVM 0.13.1 pins it to =3.2.0, so the root workspace cannot hold both. Every root workspace crate, and the standalone cross-program-invocation/native and escrow/native workspaces, move to LiteSVM 0.18.1 and the 4.x solana-transaction, solana-message, solana-account and solana-pubkey lines it uses. - anchor-lang and anchor-spl 2.0.0-rc.1 -> 2.0.0-rc.2, wincode 0.5 -> 0.6, anchor-v2-testing rev 3e38a121 -> a2066021 (the v2.0.0-rc.2 tag). - solana-kite 0.4.0 -> 0.7.0. Every kite sender and helper call passes the new compute_unit_limit argument as None. - anchor-v2-testing no longer re-exports LiteSVM at its root; tests import anchor_v2_testing::litesvm::LiteSVM. - hello-solana, options and order-book build their own transactions with kite's build_transaction_from_instructions, as their Anchor v1 copies do. - The solana-address ">=2.6, <2.7" pin goes: rc.2 and solana-address 2.7 are both on wincode 0.6. - The Anchor v2 workflow installs anchor-cli 2.0.0-rc.2 and drops the anchor#4947 IDL workaround, which rc.2 fixes. - New basics/transaction-v1/anchor: the Anchor v2 copy of the transaction v1 example. block-list/pinocchio and shank-and-codama/native stay on LiteSVM 0.13.1: each is its own workspace and pins its test stack to its generated client. Claude-Session: https://claude.ai/code/session_01GZHin47JCVXoDrWgh9MnhM
Agave 4.4.0 (2026-10-28) is inside LiteSVM 0.18.1's `^4.3` ranges but LiteSVM 0.18.1 does not compile against it, and the Anchor v2 projects commit no lockfile, so every fresh resolve broke. Every crate that pulls in LiteSVM 0.18.1 without a lockfile now asks for solana-program-runtime and solana-fee `~4.3`; Agave's exact inter-crate pins hold the rest. managed_fund.json is regenerated with anchor-cli 2.0.0-rc.2. rc.2 omits `pda` for explicit-bump and associated-token accounts and the address of swap_router_program; the app passes every account with accountsStrict, and `pnpm verify` and `pnpm typecheck` pass. lever.json regenerates unchanged. mpl-token-metadata `=5.1.2-alpha.2` becomes `5.1.2-alpha.2`, which still matches anchor-spl's exact pin, and quasar-svm `=0.1.0` becomes `0.1.0`, which quasar-test already pins exactly. Cargo.lock resolves the same versions. Claude-Session: https://claude.ai/code/session_01GZHin47JCVXoDrWgh9MnhM
CI on the previous push found six failures, all from the upgrade: - transfer-sol/asm read its instruction data at a fixed offset past the system program account. Agave 4.3 renamed that builtin from system_program to solana_system_program, and LiteSVM stores the name as the account's data, so the instruction data moved 8 bytes. The program now finds it from the account's data length, as checking-accounts/asm already does, and the test prints the transaction error on failure. - LiteSVM 0.18 starts at a recent mainnet slot, not slot 0, so warping to slot 200 or 10,000 moved the clock backwards. The prop-amm and perpetual-futures stale-price tests warp relative to the current slot. - create-account/anchor compared against Rent::default(); it now asks LiteSVM, whose Rent sysvar is what the program reads. - pyth and order-book build an IDL again now that the anchor#4947 workaround is gone: pyth's vendored types derive IdlType, and order-book's slab types implement IdlAccountType, rc.2's replacement for the removed IdlBuild trait. Claude-Session: https://claude.ai/code/session_01GZHin47JCVXoDrWgh9MnhM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Moves the Anchor v2 examples to Anchor 2.0.0-rc.2 and solana-kite 0.7.0, so their tests send v1 transactions as the Anchor v1 tests already do. Adds an Anchor v2 copy of the transaction v1 example.
Why it is bigger than a version bump
solana-instruction3.5, and LiteSVM 0.13.1 pins=3.2.0, so the root workspace can't hold both. Every root workspace crate (native, Pinocchio, ASM and Anchor v2) moves to LiteSVM 0.18.1, as does the standalonecross-program-invocation/nativeworkspace. The test-sidesolana-transaction,solana-message,solana-accountandsolana-pubkeycrates move to their 4.x lines.escrow/nativekeeps its own lockfile and was updated within it.^4.3, which allows 4.4.0, but its code doesn't compile against 4.4.0. The Anchor v2 projects commit no lockfile, so every CI build resolves fresh. Every crate that pulls in LiteSVM 0.18.1 without a lockfile now constrainssolana-program-runtimeandsolana-feeto~4.3. Agave pins its own crates to each other exactly, so the rest follow. Each pin carries a comment saying to remove it once a LiteSVM release builds against Agave 4.4.Changes
anchor-langandanchor-spl2.0.0-rc.1→2.0.0-rc.2,wincode0.5 → 0.6, andanchor-v2-testingrev3e38a121→a2066021, the commit thev2.0.0-rc.2tag points at.solana-kite0.4.0 → 0.7.0. Kite's senders and helpers take a new last argument,compute_unit_limit. All 574 calls passNone, which tells kite to set the limit from a simulation.anchor-v2-testingno longer exportsLiteSVMfrom its root, so the tests importanchor_v2_testing::litesvm::LiteSVM.hello-solana,optionsandorder-bookbuild their own transactions with kite'sbuild_transaction_from_instructions, as their Anchor v1 copies do, so they send v1 too.basics/transaction-v1/anchor: the Anchor v2 port of the transaction v1 example.solana-address = ">=2.6, <2.7"in the Anchor v2 crates. rc.2 and solana-address 2.7 are both on wincode 0.6. The three compression crates keepsolana-addressfor itsborshfeature.mpl-token-metadata = "=5.1.2-alpha.2"→"5.1.2-alpha.2". A range starting at the pre-release still matches anchor-spl's exact pin.quasar-svm = "=0.1.0"→"0.1.0", sincequasar-testalready pins it exactly.zeropod = "=0.3.3"andsolana-address = ">=2.2, <2.6"in the Quasar crates: both are tied to Quasar revbe60fca, which this PR doesn't change.block-list/pinocchioandshank-and-codama/nativestay on LiteSVM 0.13.1. Each is its own workspace, and its comments pin the test stack to the generation of its generated client.finance/managed-fund/anchor/app/src/idl/managed_fund.jsonis regenerated with rc.2. rc.2 drops thepdaentry for accounts with an explicit bump or an associated token, and theaddressofswap_router_program; the latter looks like the bug that anchor-next later fixed in Fix/v2 idl address aliases otter-sec/anchor#5075. The app passes every account explicitly withaccountsStrict, andpnpm verifyandpnpm typecheckpass.lever.jsonregenerates unchanged.anchor-cli 2.0.0-rc.2and drops the fix(lang-v2): emit enum variants in IDL otter-sec/anchor#4947 IDL workaround, which rc.2 fixes.CONTRIBUTING.md,docs/anchor-v2-migration.mdandCHANGELOG.mdare updated to match.Testing
cargo check --workspace --tests,cargo fmt --check, andcargo clippy -- -D warnings -A clippy::diverging_sub_expression(therust.ymlcommand) all pass.cross-program-invocation/native, each as its own workspace with a fresh resolve (the wayanchor buildresolves in CI):cargo check --testspasses for all 58, each resolvingsolana-program-runtime4.3.2.release.anza.xyz, socargo-build-sbfcouldn't be installed, and the type checks above ran against empty placeholder.sofiles. The Anchor v2, Native, Pinocchio and ASM workflows on this PR are the first real build-and-test run.Generated by Claude Code