diff --git a/.github/workflows/anchor-v1.yml b/.github/workflows/anchor-v1.yml index 25c5385ee..3a02bf4eb 100644 --- a/.github/workflows/anchor-v1.yml +++ b/.github/workflows/anchor-v1.yml @@ -217,7 +217,7 @@ jobs: # Install the CLI from crates.io rather than through avm, matching the # Anchor v2 job. `cargo install --git ... avm` builds avm from the tip of # anchor's main branch, so what CI installs drifts with whatever landed - # there. 1.2.1 is an ordinary published release — unlike the 2.0.0-rc.1 + # there. 1.2.1 is an ordinary published release — unlike the 2.0.0-rc.2 # pre-release that forced the v2 job off avm — so the CLI comes straight # from the registry. --locked builds it against its own published lockfile # so the result does not drift with the registry either. diff --git a/.github/workflows/anchor.yml b/.github/workflows/anchor.yml index 899cc0c5a..90df8d70c 100644 --- a/.github/workflows/anchor.yml +++ b/.github/workflows/anchor.yml @@ -205,25 +205,25 @@ jobs: path: | ~/.cargo/bin/anchor # Pinned to match the anchor-lang/anchor-spl crate version the programs depend on. - key: anchor-cli-crates-io-${{ runner.os }}-2.0.0-rc.1 - - name: Install Anchor 2.0.0-rc.1 + key: anchor-cli-crates-io-${{ runner.os }}-2.0.0-rc.2 + - name: Install Anchor 2.0.0-rc.2 run: | export PATH="$HOME/.cargo/bin:$PATH" # `anchor --version` can emit more than one line; read the first line only so # a multi-line value never reaches downstream parsing. current="$(anchor --version 2>/dev/null | head -n1 | awk '{print $2}' || true)" - if [ "$current" != "2.0.0-rc.1" ]; then + if [ "$current" != "2.0.0-rc.2" ]; then # Install the CLI from crates.io rather than through avm. avm has no # prebuilt binary for this pre-release (a plain `avm install` 404s), and # its --from-source path builds the CLI from the git tag, which is not - # the same code as the published anchor-lang 2.0.0-rc.1 the programs + # the same code as the published anchor-lang 2.0.0-rc.2 the programs # compile against: `anchor idl build` then emits a shim referencing # `anchor_lang::IdlBuild`, which that crate does not have, and writes # IDL JSON the parser rejects with "missing field `variants`". # Installing the CLI from crates.io keeps it and the library on one # published release. --locked builds it against its own published # lockfile so the result does not drift with the registry. - cargo install anchor-cli --version 2.0.0-rc.1 --locked --force + cargo install anchor-cli --version 2.0.0-rc.2 --locked --force fi echo "$HOME/.cargo/bin" >> "$GITHUB_PATH" - name: Install Surfpool @@ -275,58 +275,8 @@ jobs: done fi - # TEMPORARY WORKAROUND - delete this block and the `$idl_flag` and - # `$test_flag` below once an Anchor release after 2.0.0-rc.1 is out. - # - # anchor-derive-accounts 2.0.0-rc.1 emits enum type definitions with - # the JSON key "fields" where the IDL spec requires "variants", so - # `anchor build` cannot parse the IDL it just generated and dies - # with `Error: missing field variants`. Every project below has - # an enum reachable from its IDL and hits it. Reproduce with any - # program containing `#[derive(IdlType)] pub enum E { A, B }`. - # - # Fixed upstream, unreleased at time of writing: - # https://github.com/otter-sec/anchor/pull/4947 - # - # Patching just the derive crate to that fix is not an option: it - # requires solana-address 2.7, and these programs pin - # `>=2.6, <2.7` because anchor-lang 2.0.0-rc.1 is built against - # wincode 0.5 while solana-address 2.7 moved to 0.6. - # - # Skipping IDL generation costs nothing today: none of these - # projects consumes a generated IDL (no `idls/` directory, no - # `declare_program!`). The program is still compiled and its tests - # still run. - # - # The skip also means `anchor test` must not start a validator for - # these projects. Surfpool 1.6 deploys the program at startup - # through a runbook that reads `target/idl/.json`, and with - # no IDL it exits with `Runbook execution failed` before any test - # runs. None of these projects needs a validator: each one's - # Anchor.toml runs `cargo test`, which tests against LiteSVM - # in-process. - case "$project" in - ./basics/pyth/anchor \ - |./finance/betting-market/anchor \ - |./finance/options/anchor \ - |./finance/order-book/anchor \ - |./finance/perpetual-futures/anchor \ - |./finance/prop-amm/anchor \ - |./tokens/token-extensions/default-account-state/anchor \ - |./tokens/token-extensions/metadata/anchor \ - |./tokens/token-extensions/transfer-hook/allow-block-list-token/anchor) - echo "::notice::skipping IDL generation for $project (anchor#4947)" - idl_flag="--no-idl" - test_flag="--skip-local-validator" - ;; - *) - idl_flag="" - test_flag="" - ;; - esac - # Run anchor build - if ! anchor build $idl_flag; then + if ! anchor build; then echo "::error::anchor build failed for $project" echo "$project: anchor build failed" >> $GITHUB_WORKSPACE/failed_projects.txt rm -rf target node_modules @@ -334,10 +284,8 @@ jobs: return 1 fi - # Run anchor test. It regenerates the IDL too, so the skip above - # has to apply here as well or the projects it exempts fail at the - # test step instead of the build step. - if ! anchor test $idl_flag $test_flag; then + # Run anchor test + if ! anchor test; then echo "::error::anchor test failed for $project" echo "$project: anchor test failed" >> $GITHUB_WORKSPACE/failed_projects.txt rm -rf target node_modules diff --git a/.github/workflows/solana-asm.yml b/.github/workflows/solana-asm.yml index 9cb0e8b7e..96a6e64dd 100644 --- a/.github/workflows/solana-asm.yml +++ b/.github/workflows/solana-asm.yml @@ -201,7 +201,7 @@ jobs: # Install sbpf assembler from HEAD. HEAD emits SBPF v3 (0x03 OS-ABI) # ELF, which requires litesvm >= 0.13 (Agave 4.0) to load; the - # workspace pins litesvm 0.13.1. If a future sbpf change breaks + # workspace pins litesvm 0.18.1. If a future sbpf change breaks # loading, pin a revision here with --rev. # # The package name is required: the repository now also ships an diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e86f8ea3..4e769f666 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,89 @@ All notable changes to this repository are documented here. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## [2026-10-28] - Anchor v2 examples on Anchor 2.0.0-rc.2, sending v1 transactions + +Anchor 2.0.0-rc.2's test harness, `anchor-v2-testing`, runs on LiteSVM 0.18, which +executes v1 transactions, and `solana-kite` 0.7.0 is built on the same LiteSVM line. +Together they let the Anchor v2 tests send v1 transactions, as the Anchor v1 tests +have since 2026-10-08. rc.2 needs `solana-instruction` 3.5, which LiteSVM 0.13.1's +exact `=3.2.0` pin rules out, so every crate in the root workspace moves to +LiteSVM 0.18 together. + +### Changed + +- All Anchor v2 examples move `anchor-lang` and `anchor-spl` from `2.0.0-rc.1` to + `2.0.0-rc.2`, `wincode` from 0.5 to 0.6, and `anchor-v2-testing` from revision + `3e38a121` to `a2066021`, the commit the `v2.0.0-rc.2` tag points at. +- The Anchor v2 tests move from `solana-kite` 0.4.0 to 0.7.0, so they send v1 + transactions. Kite's senders and helpers take a new last argument, + `compute_unit_limit: Option`, and every call passes `None`: kite simulates + the transaction and sends it with the compute units the simulation used. +- `anchor-v2-testing` no longer re-exports `LiteSVM` at its root, so the tests + import `anchor_v2_testing::litesvm::LiteSVM`. +- The three Anchor v2 tests that build a transaction themselves (`hello-solana`, + `options` and `order-book`, to read logs or measure compute units) build it with + kite's `build_transaction_from_instructions` and `get_transaction_config`, with + `MAX_COMPUTE_UNIT_LIMIT` from `solana-compute-budget`, as their Anchor v1 copies do. +- The native, Pinocchio and ASM tests in the root workspace, and the standalone + `cross-program-invocation/native` and `escrow/native` workspaces, move from + LiteSVM 0.13.1 to 0.18.1, with `solana-transaction`, `solana-message`, + `solana-account` and `solana-pubkey` on the 4.x lines LiteSVM 0.18 uses. Their + tests still send legacy transactions. +- The Anchor v2 workflow installs and caches `anchor-cli 2.0.0-rc.2`. Every Anchor + v2 README, `CONTRIBUTING.md` and `docs/anchor-v2-migration.md` name rc.2. +- Fixes for what LiteSVM 0.18 and rc.2 changed under the examples: + - `basics/transfer-sol/asm` finds its instruction data from the system program + account's data length instead of a fixed offset. Agave 4.3 renamed that builtin + from `system_program` to `solana_system_program`, and the longer name moved the + instruction data 8 bytes. `checking-accounts/asm` already worked this way. + - LiteSVM 0.18 starts at a recent mainnet slot instead of slot 0, so the + `prop-amm` and `perpetual-futures` stale-price tests warp relative to the + current slot. + - `create-account/anchor`'s test reads the rent-exempt minimum from LiteSVM, which + the program reads too, rather than the SDK's `Rent::default()`. + - With anchor#4947 fixed, `pyth` and `order-book` build an IDL again. rc.2 needs + `IdlType` on `pyth`'s vendored Pyth types and `IdlAccountType` in place of the + removed `IdlBuild` on `order-book`'s slab types. +- `finance/managed-fund/anchor/app/src/idl/managed_fund.json` is regenerated with + `anchor idl build` from rc.2. rc.2 no longer writes `pda` for accounts whose + constraint names an explicit bump or an associated token, nor `address` for + `swap_router_program`; the app passes every account explicitly with + `accountsStrict`, so it uses neither, and `pnpm verify` and `pnpm typecheck` + pass. `basics/cross-program-invocation/anchor/idls/lever.json` regenerates + unchanged. +- The native token examples and the root workspace ask for `mpl-token-metadata` + `5.1.2-alpha.2` rather than exactly `=5.1.2-alpha.2`: a range that starts at the + pre-release still matches anchor-spl's exact pin. `finance/lending/quasar` asks + for `quasar-svm` `0.1.0` rather than `=0.1.0`, since quasar-test pins it exactly. + The resolved versions do not change. + +### Added + +- `basics/transaction-v1/anchor`: the Anchor v2 copy of the transaction v1 example. +- `solana-program-runtime = "~4.3"` and `solana-fee = "~4.3"` dev-dependencies in + every Anchor v2 crate and in `cross-program-invocation/native`. LiteSVM 0.18.1 + asks for the Agave crates with `^4.3` ranges, so a fresh resolve picks Agave + 4.4.0, released 2026-10-28, which LiteSVM 0.18.1 does not compile against. These + workspaces commit no lockfile, so every build resolves fresh. The two constraints + hold the Agave crates at 4.3 until a LiteSVM release builds against 4.4. + +### Removed + +- The `solana-address = ">=2.6, <2.7"` pin from the Anchor v2 manifests. rc.1 was + built against wincode 0.5 and solana-address 2.7 against 0.6; rc.2 is on 0.6 too. + The three compression examples keep a direct `solana-address` dependency for its + `borsh` feature. +- The Anchor v2 workflow's workaround for anchor#4947, which skipped IDL generation + for nine projects whose enums rc.1 wrote into the IDL under the wrong key. rc.2 + carries the fix. + +### Unchanged + +- `tokens/token-extensions/transfer-hook/block-list/pinocchio` and + `tools/shank-and-codama/native` stay on LiteSVM 0.13.1. Each is its own + workspace, and each pins its test stack to the generation of its generated client. + ## [2026-10-15] - Anchor v1 examples on Anchor 1.2.1 Anchor 1.2.1 is a patch release of the v1 line. Its one change is an opt-in diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5574ef5bc..b31c5b5e1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -14,7 +14,7 @@ See [CHANGELOG.md](./CHANGELOG.md) for release history. This file had no changel - Each example lives at `category/example-name//`, e.g. `basics/counter/anchor/`. - Supported frameworks: `anchor`, `anchor-v1`, `quasar`, `pinocchio`, `native`, `asm`. Use the existing layout as a reference. - `anchor-v1/` is Anchor v1 (1.2.1), the current stable Anchor. `anchor/` is the same example - on Anchor v2 (2.0.0-rc.1), the release candidate for the next major version, and is where new + on Anchor v2 (2.0.0-rc.2), the release candidate for the next major version, and is where new Anchor work starts; the v1 copy tracks its v2 counterpart. A change to what an example does (a new handler, a new check, a fix, a renamed field) goes into both copies, in the same pull request where practical, so a v1 reader gets the same program and the same tests. The copies differ only where the Anchor @@ -33,10 +33,10 @@ See [CHANGELOG.md](./CHANGELOG.md) for release history. This file had no changel Run an example's tests with the command for its framework, from the framework directory (e.g. `basics/counter/anchor/`): -- **Anchor v2** (in `anchor/`): `anchor test` (runs `cargo test`, per the `[scripts]` table in `Anchor.toml`), with the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked`. +- **Anchor v2** (in `anchor/`): `anchor test` (runs `cargo test`, per the `[scripts]` table in `Anchor.toml`), with the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked`. - **Anchor v1** (in `anchor-v1/`): the same `anchor test`, with the v1 CLI: `avm install 1.2.1 && avm use 1.2.1`. Selecting the wrong CLI is the usual cause of a confusing build failure in these directories. - Anchor v1 tests send v1 transactions (4,096 bytes, resource limits in the message) through - `solana-kite` 0.6. Its senders take a last `compute_unit_limit: Option`: pass `None` and kite + Both Anchor copies' tests send v1 transactions (4,096 bytes, resource limits in the message) + through `solana-kite`: 0.6 for Anchor v1, 0.7 for Anchor v2. Its senders take a last `compute_unit_limit: Option`: pass `None` and kite simulates the transaction and sends it with the compute units the simulation used. A test that needs the transaction's metadata (logs, compute units, a program error code) builds it with kite's `build_transaction_from_instructions` and sends it through LiteSVM itself. Kite rejects ComputeBudget diff --git a/Cargo.lock b/Cargo.lock index da4bc3c32..c4869f266 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,12 +10,13 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", + "solana-program-runtime", "spl-discriminator 0.5.2", "spl-tlv-account-resolution 0.11.1", "spl-transfer-hook-interface 2.1.0", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -25,8 +26,10 @@ dependencies = [ "anchor-lang", "anchor-v2-testing", "borsh 1.7.0", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -37,11 +40,11 @@ dependencies = [ "borsh-derive 1.7.0", "litesvm", "solana-keypair", - "solana-message 4.0.0", + "solana-message 4.6.0", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", - "solana-signer 3.0.0", + "solana-pubkey 4.3.0", + "solana-signer 3.0.1", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -55,10 +58,10 @@ dependencies = [ "pinocchio-log", "pinocchio-system 0.5.0", "solana-keypair", - "solana-message 4.0.0", + "solana-message 4.6.0", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", - "solana-signer 3.0.0", + "solana-pubkey 4.3.0", + "solana-signer 3.0.1", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -99,88 +102,48 @@ dependencies = [ "zeroize", ] -[[package]] -name = "agave-bls12-381" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "210b1ef312273aa81ccb4c52687d96e3cf07621f3619a7998be20eb9741b08e3" -dependencies = [ - "blst", - "blstrs", - "bytemuck", - "bytemuck_derive", - "group 0.13.0", - "pairing", -] - [[package]] name = "agave-feature-set" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde74a2d1f2f99a3ea59938d1533c7973c344e47d24c1b645ee81e958c54226a" +checksum = "70940a29886a32d5c86192905a8df13d6b46f5b7f87baffac66e62b63fef5043" dependencies = [ "ahash", - "solana-epoch-schedule 3.0.0", - "solana-hash 4.2.0", + "solana-epoch-schedule 3.3.0", + "solana-hash 4.6.0", "solana-keypair", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sha256-hasher 3.1.0", "solana-svm-feature-set", ] [[package]] name = "agave-reserved-account-keys" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "798e559c514af005950ea81586a3856f9297ecb80a7359057c19bf6717f5f537" +checksum = "70e51a2c2a18b4dad3381f2e2df639d56fb58dbad50f3473367fcdbf029e7f95" dependencies = [ "agave-feature-set", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sdk-ids 3.1.0", ] [[package]] -name = "agave-syscalls" -version = "4.0.0" +name = "agave-transaction-view" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84debd4abe0cbab5a6aac2ee50e3969ef0e0961f7dff7e8f96bda0be7998bca2" +checksum = "83adf0eb2a269e96090deb451df68e72ed03bc3005bd8222dd82bdf33f8fbd08" dependencies = [ - "agave-bls12-381", - "bincode", - "libsecp256k1 0.6.0", - "num-traits", - "solana-account 3.4.0", - "solana-account-info 3.1.1", - "solana-big-mod-exp 3.0.0", - "solana-blake3-hasher 3.1.0", - "solana-bn254", - "solana-clock 3.1.1", - "solana-cpi 3.1.0", - "solana-curve25519 4.0.1", - "solana-hash 4.2.0", - "solana-instruction 3.2.0", - "solana-keccak-hasher 3.1.0", - "solana-loader-v3-interface 6.1.0", - "solana-poseidon", - "solana-program-entrypoint 3.1.1", - "solana-program-runtime", - "solana-pubkey 4.1.0", - "solana-sbpf", + "bytes", + "solana-hash 4.6.0", + "solana-message 4.6.0", + "solana-packet", + "solana-pubkey 4.3.0", "solana-sdk-ids 3.1.0", - "solana-secp256k1-recover 3.2.0", - "solana-sha256-hasher 3.1.0", - "solana-stable-layout 3.0.1", - "solana-stake-interface 2.0.2", - "solana-svm-callback", - "solana-svm-feature-set", - "solana-svm-log-collector", - "solana-svm-measure", - "solana-svm-timings", - "solana-svm-type-overrides", - "solana-sysvar 3.1.1", - "solana-sysvar-id 3.1.0", - "solana-transaction-context", - "thiserror 2.0.18", + "solana-short-vec 3.3.0", + "solana-signature 3.5.2", + "solana-svm-transaction", + "solana-transaction", ] [[package]] @@ -213,9 +176,9 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "anchor-derive-accounts" -version = "2.0.0-rc.1" +version = "2.0.0-rc.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a0ce0bc596146ce0a73e2422e951d153cf88bf58af957c46a52e03d3048e4c" +checksum = "18c5bd235119ae47e37190da06b9c0961a686aa9e31986ccab207b1234540e4f" dependencies = [ "anchor-lang-idl", "bs58", @@ -224,32 +187,31 @@ dependencies = [ "quote", "serde_json", "sha2 0.10.9", - "solana-address 2.6.1", + "solana-address 2.7.0", "syn 2.0.118", ] [[package]] name = "anchor-lang" -version = "2.0.0-rc.1" +version = "2.0.0-rc.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "163e7ec1855744f29f116b3fa4c469947b43f17008d086e558f9b9b047fbf47d" +checksum = "356811863224722c5eff648869b67ea8d769b0da8c4924cc38cc242ced617e38" dependencies = [ "anchor-derive-accounts", "bytemuck", "pinocchio 0.11.2", "pinocchio-system 0.6.1", "sha2 0.10.9", - "solana-address 2.6.1", - "solana-define-syscall 5.1.0", - "solana-instruction 3.2.0", + "solana-address 2.7.0", + "solana-instruction 3.5.1", "solana-msg 3.1.0", "solana-program-error 3.0.1", "solana-program-log", "solana-program-memory 3.1.0", "solana-sha256-hasher 3.1.0", - "solana-system-interface 2.0.0", - "solana-sysvar 3.1.1", - "wincode 0.5.5", + "solana-system-interface 3.3.0", + "solana-sysvar 4.2.0", + "wincode", ] [[package]] @@ -283,15 +245,17 @@ dependencies = [ "anchor-lang", "anchor-v2-testing", "borsh 1.7.0", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] name = "anchor-spl" -version = "2.0.0-rc.1" +version = "2.0.0-rc.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29717fb1be787b9d71b085d960c217e009787dabd16b5d0fc31118f9a6534793" +checksum = "94269c342b12e11d285282d9fffca54e46b9abbac13708ccee9b6f1a2f27c6eb" dependencies = [ "anchor-lang", "borsh 1.7.0", @@ -300,10 +264,10 @@ dependencies = [ "pinocchio 0.11.2", "pinocchio-token", "pinocchio-token-2022", - "solana-address 2.6.1", - "solana-instruction 3.2.0", + "solana-address 2.7.0", + "solana-instruction 3.5.1", "solana-program-error 3.0.1", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "spl-pod 0.7.3", "spl-token-2022-interface", "spl-token-group-interface", @@ -314,13 +278,13 @@ dependencies = [ [[package]] name = "anchor-v2-testing" version = "0.1.0" -source = "git+https://github.com/otter-sec/anchor.git?rev=3e38a121b969d1a77230baeb0056baf5cc9b3c1a#3e38a121b969d1a77230baeb0056baf5cc9b3c1a" +source = "git+https://github.com/otter-sec/anchor.git?rev=a20660219882af5f199d56ea3f9326f387f89d8b#a20660219882af5f199d56ea3f9326f387f89d8b" dependencies = [ "litesvm", "solana-keypair", - "solana-message 3.1.0", + "solana-message 4.6.0", "solana-program-runtime", - "solana-signer 3.0.0", + "solana-signer 3.0.1", "solana-transaction", "solana-transaction-context", ] @@ -394,7 +358,7 @@ dependencies = [ "fnv", "hashbrown 0.15.5", "itertools 0.13.0", - "num-bigint 0.4.6", + "num-bigint", "num-integer", "num-traits", "zeroize", @@ -413,7 +377,7 @@ dependencies = [ "derivative", "digest 0.10.7", "itertools 0.10.5", - "num-bigint 0.4.6", + "num-bigint", "num-traits", "paste", "rustc_version", @@ -434,7 +398,7 @@ dependencies = [ "digest 0.10.7", "educe", "itertools 0.13.0", - "num-bigint 0.4.6", + "num-bigint", "num-traits", "paste", "zeroize", @@ -466,7 +430,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ - "num-bigint 0.4.6", + "num-bigint", "num-traits", "proc-macro2", "quote", @@ -479,7 +443,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" dependencies = [ - "num-bigint 0.4.6", + "num-bigint", "num-traits", "proc-macro2", "quote", @@ -523,7 +487,7 @@ dependencies = [ "ark-serialize-derive 0.4.2", "ark-std 0.4.0", "digest 0.10.7", - "num-bigint 0.4.6", + "num-bigint", ] [[package]] @@ -536,7 +500,7 @@ dependencies = [ "ark-std 0.5.0", "arrayvec", "digest 0.10.7", - "num-bigint 0.4.6", + "num-bigint", ] [[package]] @@ -604,11 +568,11 @@ name = "asm" version = "0.1.0" dependencies = [ "litesvm", - "solana-address 2.6.1", - "solana-instruction 3.2.0", + "solana-address 2.7.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -621,9 +585,9 @@ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] name = "base16ct" -version = "0.2.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" +checksum = "fd307490d624467aa6f74b0eabb77633d1f758a7b25f12bceb0b22e08d9726f6" [[package]] name = "base64" @@ -651,12 +615,13 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", - "solana-clock 3.1.1", + "solana-clock 3.2.1", + "solana-fee", "solana-kite", + "solana-program-runtime", "spl-associated-token-account", "spl-token", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -754,7 +719,7 @@ checksum = "7a8a8ed6fefbeef4a8c7b460e4110e12c5e22a5b7cf32621aae6ad650c4dcf29" dependencies = [ "blst", "byte-slice-cast", - "ff", + "ff 0.13.1", "group 0.13.0", "pairing", "rand_core 0.6.4", @@ -899,9 +864,9 @@ checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" [[package]] name = "bytemuck" -version = "1.25.0" +version = "1.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" +checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" dependencies = [ "bytemuck_derive", ] @@ -925,9 +890,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae3f5d315924270530207e2a68396c3cc547f6dca3fbdca317cfb1a51edb593" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "carnival" @@ -935,8 +900,10 @@ version = "0.1.0" dependencies = [ "anchor-lang", "anchor-v2-testing", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -977,13 +944,13 @@ name = "checking-account-asm-program" version = "0.1.0" dependencies = [ "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", - "solana-transaction-error 3.1.0", + "solana-transaction-error 3.4.0", ] [[package]] @@ -993,8 +960,10 @@ dependencies = [ "anchor-lang", "anchor-v2-testing", "borsh 1.7.0", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -1002,11 +971,11 @@ name = "checking-accounts-native-program" version = "0.1.0" dependencies = [ "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -1019,10 +988,10 @@ dependencies = [ "pinocchio 0.10.2", "pinocchio-log", "pinocchio-system 0.5.0", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -1044,11 +1013,11 @@ dependencies = [ "borsh 1.7.0", "borsh-derive 1.7.0", "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -1062,12 +1031,12 @@ dependencies = [ "pinocchio-log", "pinocchio-pubkey", "pinocchio-system 0.5.0", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", - "solana-message 4.0.0", + "solana-message 4.6.0", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", - "solana-signer 3.0.0", + "solana-pubkey 4.3.0", + "solana-signer 3.0.1", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -1078,9 +1047,10 @@ version = "0.1.0" dependencies = [ "anchor-lang", "anchor-v2-testing", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -1096,16 +1066,18 @@ dependencies = [ "anchor-lang", "anchor-v2-testing", "borsh 1.7.0", - "solana-account 3.4.0", - "solana-address 2.6.1", - "solana-instruction 3.2.0", + "solana-account 4.7.0", + "solana-address 2.7.0", + "solana-fee", + "solana-instruction 3.5.1", "solana-keccak-hasher 3.1.0", "solana-kite", - "solana-message 3.1.0", + "solana-message 4.6.0", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", + "solana-program-runtime", + "solana-pubkey 4.3.0", "solana-transaction", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -1115,16 +1087,18 @@ dependencies = [ "anchor-lang", "anchor-v2-testing", "borsh 1.7.0", - "solana-account 3.4.0", - "solana-address 2.6.1", - "solana-instruction 3.2.0", + "solana-account 4.7.0", + "solana-address 2.7.0", + "solana-fee", + "solana-instruction 3.5.1", "solana-keccak-hasher 3.1.0", "solana-kite", - "solana-message 3.1.0", + "solana-message 4.6.0", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", + "solana-program-runtime", + "solana-pubkey 4.3.0", "solana-transaction", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -1166,6 +1140,12 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const-oid" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" + [[package]] name = "constant_time_eq" version = "0.4.2" @@ -1179,12 +1159,12 @@ dependencies = [ "borsh 1.7.0", "borsh-derive 1.7.0", "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", - "solana-rent 4.3.0", + "solana-pubkey 4.3.0", + "solana-rent 4.4.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -1197,11 +1177,11 @@ dependencies = [ "pinocchio 0.10.2", "pinocchio-log", "pinocchio-pubkey", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", - "solana-rent 4.3.0", + "solana-pubkey 4.3.0", + "solana-rent 4.4.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -1213,8 +1193,10 @@ dependencies = [ "anchor-lang", "anchor-v2-testing", "borsh 1.7.0", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -1225,11 +1207,18 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] +[[package]] +name = "cpubits" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15b85f9c39137c3a891689859392b1bd49812121d0d61c9caf00d46ed5ce06ae" + [[package]] name = "cpufeatures" version = "0.2.17" @@ -1253,10 +1242,10 @@ name = "create-account-asm-program" version = "0.1.0" dependencies = [ "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -1270,10 +1259,10 @@ dependencies = [ "pinocchio-log", "pinocchio-pubkey", "pinocchio-system 0.5.0", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -1283,11 +1272,11 @@ name = "create-account-program" version = "0.1.0" dependencies = [ "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -1298,8 +1287,10 @@ version = "0.1.0" dependencies = [ "anchor-lang", "anchor-v2-testing", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -1310,9 +1301,10 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -1323,12 +1315,12 @@ dependencies = [ "borsh-derive 1.7.0", "litesvm", "mpl-token-metadata", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", "spl-token-interface", @@ -1349,10 +1341,10 @@ dependencies = [ "pinocchio 0.10.2", "pinocchio-log", "pinocchio-system 0.5.0", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -1365,12 +1357,16 @@ checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "crypto-bigint" -version = "0.5.5" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +checksum = "9c035cb64cba03dad2fb921f3e218785e8cf9a41790da5eb3a1400f62fa2be11" dependencies = [ - "generic-array", - "rand_core 0.6.4", + "cpubits", + "ctutils", + "getrandom 0.4.3", + "hybrid-array", + "num-traits", + "rand_core 0.10.1", "subtle", "zeroize", ] @@ -1392,7 +1388,9 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453" dependencies = [ + "getrandom 0.4.3", "hybrid-array", + "rand_core 0.10.1", ] [[package]] @@ -1416,11 +1414,12 @@ dependencies = [ [[package]] name = "ctutils" -version = "0.4.2" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5515a3834141de9eafb9717ad39eea8247b5674e6066c404e8c4b365d2a29e" +checksum = "fe3e9d21d39e6f39ff46e03d5b621424f88ee23d8a1672c6bfc9ccc7f2da4f6a" dependencies = [ "cmov", + "subtle", ] [[package]] @@ -1460,16 +1459,18 @@ dependencies = [ "anchor-v2-testing", "borsh 1.7.0", "sha3", - "solana-account 3.4.0", - "solana-address 2.6.1", - "solana-instruction 3.2.0", + "solana-account 4.7.0", + "solana-address 2.7.0", + "solana-fee", + "solana-instruction 3.5.1", "solana-keccak-hasher 3.1.0", "solana-kite", - "solana-message 3.1.0", + "solana-message 4.6.0", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", + "solana-program-runtime", + "solana-pubkey 4.3.0", "solana-transaction", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -1514,9 +1515,10 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -1525,7 +1527,17 @@ version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" dependencies = [ - "const-oid", + "const-oid 0.9.6", + "zeroize", +] + +[[package]] +name = "der" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a996a108feb8b427a6e12fcf6af4aa83409b79d72c15337d7741368131ee004" +dependencies = [ + "const-oid 0.10.2", "zeroize", ] @@ -1562,7 +1574,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", - "const-oid", "crypto-common 0.1.7", "subtle", ] @@ -1574,6 +1585,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" dependencies = [ "block-buffer 0.12.1", + "const-oid 0.10.2", "crypto-common 0.2.2", "ctutils", ] @@ -1586,16 +1598,17 @@ checksum = "abe71d579d1812060163dff96056261deb5bf6729b100fa2e36a68b9649ba3d3" [[package]] name = "ecdsa" -version = "0.16.9" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +checksum = "c0681a4fc24c767085329728d8dfba959af91228aa4610cca4f8ce317ba46ae0" dependencies = [ - "der", - "digest 0.10.7", + "der 0.8.3", + "digest 0.11.3", "elliptic-curve", "rfc6979", - "signature", - "spki", + "signature 3.0.0", + "spki 0.8.1", + "zeroize", ] [[package]] @@ -1604,8 +1617,8 @@ version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ - "pkcs8", - "signature", + "pkcs8 0.10.2", + "signature 2.2.0", ] [[package]] @@ -1643,18 +1656,19 @@ checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" [[package]] name = "elliptic-curve" -version = "0.13.8" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +checksum = "900f37e7e18d74a2347389af6cd69e3a30d5cc9e697f40004865679aa75e9c7c" dependencies = [ "base16ct", "crypto-bigint", - "digest 0.10.7", - "ff", - "generic-array", - "group 0.13.0", - "pkcs8", - "rand_core 0.6.4", + "crypto-common 0.2.2", + "digest 0.11.3", + "ff 0.14.0", + "group 0.14.0", + "hybrid-array", + "pkcs8 0.11.0", + "rand_core 0.10.1", "sec1", "subtle", "zeroize", @@ -1714,9 +1728,10 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -1727,11 +1742,12 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", - "solana-instruction 3.2.0", + "solana-fee", + "solana-instruction 3.5.1", "solana-kite", - "solana-pubkey 3.0.0", - "wincode 0.5.5", + "solana-program-runtime", + "solana-pubkey 4.3.0", + "wincode", ] [[package]] @@ -1744,10 +1760,11 @@ dependencies = [ "borsh 1.7.0", "libsecp256k1 0.7.2", "sha3", - "solana-address 2.6.1", + "solana-fee", "solana-kite", + "solana-program-runtime", "solana-secp256k1-recover 2.2.1", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -1756,8 +1773,10 @@ version = "0.1.0" dependencies = [ "anchor-lang", "anchor-v2-testing", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -1767,11 +1786,11 @@ dependencies = [ "borsh 1.7.0", "borsh-derive 1.7.0", "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -1785,10 +1804,10 @@ dependencies = [ "pinocchio-log", "pinocchio-pubkey", "pinocchio-system 0.5.0", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -1810,6 +1829,16 @@ dependencies = [ "subtle", ] +[[package]] +name = "ff" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f686ab92a9fb0eaf188f6c6c87b89490baa6fdb0db4544ba4dc47f7942489f" +dependencies = [ + "rand_core 0.10.1", + "subtle", +] + [[package]] name = "fiat-crypto" version = "0.2.9" @@ -1876,6 +1905,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "fundraiser" version = "0.1.0" @@ -1884,12 +1919,13 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", - "solana-clock 3.1.1", + "solana-clock 3.2.1", + "solana-fee", "solana-kite", + "solana-program-runtime", "spl-associated-token-account", "spl-token", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -1944,7 +1980,6 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", - "zeroize", ] [[package]] @@ -1979,10 +2014,22 @@ checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", "libc", - "r-efi", + "r-efi 5.3.0", "wasip2", ] +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", + "rand_core 0.10.1", +] + [[package]] name = "glob" version = "0.3.3" @@ -1997,9 +2044,10 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -2008,21 +2056,34 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff", + "ff 0.13.1", "rand 0.8.6", "rand_core 0.6.4", "rand_xorshift", "subtle", ] +[[package]] +name = "group" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fd1a1c7a5206c5b7a3f5a0d7ccd3ff85d0c8f5133d62a02680255b0004af5f4" +dependencies = [ + "ff 0.14.0", + "rand_core 0.10.1", + "subtle", +] + [[package]] name = "hand" version = "0.1.0" dependencies = [ "anchor-lang", "anchor-v2-testing", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -2050,6 +2111,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "allocator-api2", + "equivalent", + "foldhash", ] [[package]] @@ -2073,9 +2136,11 @@ version = "0.1.0" dependencies = [ "anchor-lang", "anchor-v2-testing", + "solana-compute-budget", + "solana-fee", "solana-kite", - "solana-transaction", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -2083,10 +2148,10 @@ name = "hello-solana-asm-program" version = "0.1.0" dependencies = [ "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -2096,11 +2161,11 @@ name = "hello-solana-program" version = "0.1.0" dependencies = [ "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-transaction", ] @@ -2111,10 +2176,10 @@ dependencies = [ "litesvm", "pinocchio 0.10.2", "pinocchio-log", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-transaction", ] @@ -2130,6 +2195,15 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac 0.12.1", +] + [[package]] name = "hmac" version = "0.8.1" @@ -2149,6 +2223,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "hmac" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6303bc9732ae41b04cb554b844a762b4115a61bfaa81e3e83050991eeb56863f" +dependencies = [ + "digest 0.11.3", +] + [[package]] name = "hmac-drbg" version = "0.3.0" @@ -2166,7 +2249,9 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "818356c5132c1fede50f837ca96afbe78ff42413047f4abb886217845e1b6c8c" dependencies = [ + "subtle", "typenum", + "zeroize", ] [[package]] @@ -2183,9 +2268,10 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -2215,9 +2301,10 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -2256,6 +2343,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b4baf93f58d4425749ca49a51c50ebab072c5df6994d08fed93541c331481dc" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.18" @@ -2275,16 +2371,17 @@ dependencies = [ [[package]] name = "k256" -version = "0.13.4" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +checksum = "93f50113171a713f4a4231ef82eb26703607139b35dcb56241f0ceab2ae1f7d8" dependencies = [ - "cfg-if", + "cpubits", "ecdsa", "elliptic-curve", - "once_cell", - "sha2 0.10.9", - "signature", + "primeorder", + "sha2 0.11.1", + "signature 3.0.0", + "wnaf", ] [[package]] @@ -2320,12 +2417,13 @@ dependencies = [ "anchor-v2-testing", "borsh 1.7.0", "pinocchio 0.11.2", - "solana-address 2.6.1", - "solana-clock 3.1.1", + "solana-clock 3.2.1", + "solana-fee", "solana-kite", - "solana-pubkey 3.0.0", + "solana-program-runtime", + "solana-pubkey 4.3.0", "solana-sysvar 3.1.1", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -2334,8 +2432,10 @@ version = "0.1.0" dependencies = [ "anchor-lang", "anchor-v2-testing", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -2446,7 +2546,7 @@ checksum = "3c9a85a9752c549ceb7578064b4ed891179d20acd85f27318573b64d2d7ee7ee" dependencies = [ "ark-bn254 0.4.0", "ark-ff 0.4.2", - "num-bigint 0.4.6", + "num-bigint", "thiserror 1.0.69", ] @@ -2458,77 +2558,76 @@ checksum = "47a1ccadd0bb5a32c196da536fd72c59183de24a055f6bf0513bf845fefab862" dependencies = [ "ark-bn254 0.5.0", "ark-ff 0.5.0", - "num-bigint 0.4.6", + "num-bigint", "thiserror 1.0.69", ] [[package]] name = "litesvm" -version = "0.13.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1e00083aad2a7aa9d6900454604f7776da40be57304e5119f09222a1e9b105a" +checksum = "b8fe187ac113cebaa49af5dce82dfd1084177e5434d78815f409a6a22676b294" dependencies = [ "agave-feature-set", "agave-reserved-account-keys", - "agave-syscalls", "ansi_term", - "bincode", "hex", "indexmap", - "itertools 0.14.0", + "itertools 0.15.0", "log", "nom", - "serde", "sha2 0.10.9", - "solana-account 3.4.0", - "solana-address 2.6.1", - "solana-address-lookup-table-interface 3.0.1", - "solana-bpf-loader-program", + "solana-account 4.7.0", + "solana-address 2.7.0", + "solana-address-lookup-table-interface 3.2.0", "solana-builtins", - "solana-clock 3.1.1", + "solana-clock 3.2.1", "solana-compute-budget", "solana-compute-budget-instruction", - "solana-epoch-rewards 3.0.1", - "solana-epoch-schedule 3.0.0", - "solana-feature-gate-interface 3.1.0", + "solana-epoch-rewards 3.2.0", + "solana-epoch-schedule 3.3.0", + "solana-feature-gate-interface 4.0.0", "solana-fee", + "solana-fee-calculator 3.3.0", "solana-fee-structure", - "solana-hash 4.2.0", - "solana-instruction 3.2.0", + "solana-hash 4.6.0", + "solana-instruction 3.5.1", "solana-instruction-error", - "solana-instructions-sysvar 3.0.0", + "solana-instructions-sysvar 4.0.0", "solana-keypair", - "solana-last-restart-slot 3.1.0", - "solana-loader-v3-interface 6.1.0", + "solana-last-restart-slot 3.2.0", + "solana-loader-v3-interface 8.1.1", "solana-loader-v4-interface 3.1.0", - "solana-loader-v4-program", - "solana-message 3.1.0", + "solana-message 4.6.0", "solana-native-token 3.0.0", - "solana-nonce 3.1.0", + "solana-nonce 3.3.0", "solana-nonce-account", "solana-precompile-error", "solana-program-error 3.0.1", "solana-program-runtime", - "solana-rent 3.1.0", + "solana-rent 4.4.0", + "solana-runtime-transaction", "solana-sdk-ids 3.1.0", "solana-sha256-hasher 3.1.0", - "solana-signature 3.3.0", - "solana-signer 3.0.0", - "solana-slot-hashes 3.0.1", - "solana-slot-history 3.1.0", - "solana-stake-interface 2.0.2", + "solana-signature 3.5.2", + "solana-signer 3.0.1", + "solana-slot-hashes 3.2.0", + "solana-slot-history 3.2.0", + "solana-stake-history", "solana-svm-callback", "solana-svm-log-collector", "solana-svm-timings", "solana-svm-transaction", - "solana-system-interface 3.1.0", + "solana-syscalls", + "solana-system-interface 3.3.0", "solana-system-program", - "solana-sysvar 3.1.1", + "solana-sysvar 4.2.0", "solana-sysvar-id 3.1.0", "solana-transaction", "solana-transaction-context", - "solana-transaction-error 3.1.0", - "thiserror 2.0.18", + "solana-transaction-error 3.4.0", + "thiserror 2.0.21", + "wincode", ] [[package]] @@ -2562,12 +2661,13 @@ dependencies = [ "borsh 1.7.0", "mock-swap-router", "pinocchio 0.11.2", - "solana-account 3.4.0", - "solana-address 2.6.1", - "solana-clock 3.1.1", + "solana-account 4.7.0", + "solana-clock 3.2.1", + "solana-fee", "solana-kite", + "solana-program-runtime", "solana-sysvar 3.1.1", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -2584,9 +2684,10 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -2618,11 +2719,12 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", + "solana-program-runtime", "spl-token-metadata-interface", "spl-type-length-value 0.9.1", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -2633,9 +2735,10 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -2646,9 +2749,10 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -2659,11 +2763,10 @@ dependencies = [ "anchor-spl", "borsh 1.7.0", "litesvm", - "solana-address 2.6.1", "solana-keypair", "solana-kite", - "solana-signer 3.0.0", - "wincode 0.5.5", + "solana-signer 3.0.1", + "wincode", ] [[package]] @@ -2671,8 +2774,7 @@ name = "mock_price_feed" version = "0.1.0" dependencies = [ "anchor-lang", - "solana-address 2.6.1", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -2680,8 +2782,7 @@ name = "mock_price_feed_prop_amm" version = "0.1.0" dependencies = [ "anchor-lang", - "solana-address 2.6.1", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -2707,9 +2808,10 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -2720,12 +2822,12 @@ dependencies = [ "borsh-derive 1.7.0", "litesvm", "mpl-token-metadata", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", "spl-associated-token-account-interface", @@ -2749,53 +2851,19 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] -name = "num" -version = "0.2.1" +name = "num-bigint" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "num-bigint 0.2.6", - "num-complex", "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" -dependencies = [ - "autocfg", "num-traits", ] @@ -2830,29 +2898,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" -dependencies = [ - "autocfg", - "num-bigint 0.2.6", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -2915,12 +2960,14 @@ dependencies = [ "anchor-v2-testing", "borsh 1.7.0", "litesvm", - "solana-address 2.6.1", - "solana-clock 3.1.1", + "solana-clock 3.2.1", + "solana-compute-budget", + "solana-fee", "solana-kite", + "solana-program-runtime", "spl-associated-token-account", "spl-token", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -2931,10 +2978,12 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "bytemuck", - "solana-address 2.6.1", + "solana-compute-budget", + "solana-fee", "solana-kite", + "solana-program-runtime", "static_assertions", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -2998,10 +3047,11 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", "solana-program-pack 3.1.0", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -3012,12 +3062,12 @@ dependencies = [ "borsh-derive 1.7.0", "litesvm", "mpl-token-metadata", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", "spl-associated-token-account-interface", @@ -3030,8 +3080,10 @@ version = "0.1.0" dependencies = [ "anchor-lang", "anchor-v2-testing", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -3043,10 +3095,10 @@ dependencies = [ "pinocchio-log", "pinocchio-pubkey", "pinocchio-system 0.5.0", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -3058,11 +3110,11 @@ dependencies = [ "borsh 1.7.0", "borsh-derive 1.7.0", "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -3073,15 +3125,6 @@ version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" -[[package]] -name = "percentage" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd23b938276f14057220b707937bcb42fa76dda7560e57a2da30cb52d557937" -dependencies = [ - "num", -] - [[package]] name = "permanent-delegate" version = "0.1.0" @@ -3090,9 +3133,10 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -3105,13 +3149,14 @@ dependencies = [ "borsh 1.7.0", "mock_price_feed", "pinocchio 0.11.2", - "solana-address 2.6.1", - "solana-clock 3.1.1", + "solana-clock 3.2.1", + "solana-fee", "solana-kite", + "solana-program-runtime", "solana-sysvar 3.1.1", "spl-associated-token-account", "spl-token", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -3133,7 +3178,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06810dac15a4ef83d3dabdb4f2f22fb39c9adff669cd2781da4f716510a647c" dependencies = [ "solana-account-view 1.0.0", - "solana-address 2.6.1", + "solana-address 2.7.0", "solana-define-syscall 4.0.1", "solana-instruction-view 1.0.0", "solana-program-error 3.0.1", @@ -3146,8 +3191,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6cababcb62a2e739c7078ae16eda02789a6e3edd21bbdded864e85c38a7914d" dependencies = [ "solana-account-view 2.0.0", - "solana-address 2.6.1", - "solana-define-syscall 5.1.0", + "solana-address 2.7.0", + "solana-define-syscall 5.3.0", "solana-instruction-view 2.1.0", "solana-program-error 3.0.1", ] @@ -3190,7 +3235,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24044a0815753862b558e179e78f03f7344cb755de48617a09d7d23b50883b6c" dependencies = [ "pinocchio 0.10.2", - "solana-address 2.6.1", + "solana-address 2.7.0", ] [[package]] @@ -3200,7 +3245,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3ae2ee67b42e2ac797dd88312da473c895660e270d8093e0ba2749b885b5778" dependencies = [ "pinocchio 0.11.2", - "solana-address 2.6.1", + "solana-address 2.7.0", ] [[package]] @@ -3210,7 +3255,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "825f59c8348e5c2d3fd56432ef927f5819542b3b05fae4f5b6869801113e775e" dependencies = [ "solana-account-view 2.0.0", - "solana-address 2.6.1", + "solana-address 2.7.0", "solana-instruction-view 2.1.0", "solana-program-error 3.0.1", ] @@ -3222,7 +3267,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57dbab5718ab6ae446b2217c47598fabd29173a09bd32b05344f031739db92b8" dependencies = [ "solana-account-view 2.0.0", - "solana-address 2.6.1", + "solana-address 2.7.0", "solana-instruction-view 2.1.0", "solana-program-error 3.0.1", ] @@ -3233,8 +3278,18 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der", - "spki", + "der 0.7.10", + "spki 0.7.3", +] + +[[package]] +name = "pkcs8" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "451913da69c775a56034ea8d9003d27ee8948e12443eae7c038ba100a4f21cb7" +dependencies = [ + "der 0.8.3", + "spki 0.8.1", ] [[package]] @@ -3258,6 +3313,33 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "primefield" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c555a6e4eb7d4e158fcb028c835c3b8642206ddc279b5c6b202ef9a8bdb592f4" +dependencies = [ + "crypto-bigint", + "crypto-common 0.2.2", + "ff 0.14.0", + "rand_core 0.10.1", + "subtle", + "zeroize", +] + +[[package]] +name = "primeorder" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c9f42978c78a00e3d68f69fc03e57a234debae69da4020a4fb588fcdcd07b06" +dependencies = [ + "elliptic-curve", + "once_cell", + "primefield", + "serdect", + "wnaf", +] + [[package]] name = "proc-macro-crate" version = "0.1.5" @@ -3291,8 +3373,10 @@ version = "0.1.0" dependencies = [ "anchor-lang", "anchor-v2-testing", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -3302,10 +3386,10 @@ dependencies = [ "litesvm", "pinocchio 0.10.2", "pinocchio-log", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-transaction", ] @@ -3316,11 +3400,11 @@ dependencies = [ "borsh 1.7.0", "borsh-derive 1.7.0", "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-transaction", ] @@ -3331,12 +3415,12 @@ dependencies = [ "borsh 1.7.0", "borsh-derive 1.7.0", "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", - "solana-rent 4.3.0", + "solana-pubkey 4.3.0", + "solana-rent 4.4.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -3348,12 +3432,12 @@ dependencies = [ "borsh 1.7.0", "borsh-derive 1.7.0", "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", - "solana-rent 4.3.0", + "solana-pubkey 4.3.0", + "solana-rent 4.4.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -3365,11 +3449,11 @@ dependencies = [ "litesvm", "pinocchio 0.10.2", "pinocchio-system 0.5.0", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", - "solana-rent 4.3.0", + "solana-pubkey 4.3.0", + "solana-rent 4.4.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -3381,8 +3465,10 @@ dependencies = [ "anchor-lang", "anchor-v2-testing", "borsh 1.7.0", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -3395,13 +3481,14 @@ dependencies = [ "borsh 1.7.0", "mock_price_feed_prop_amm", "pinocchio 0.11.2", - "solana-address 2.6.1", - "solana-clock 3.1.1", + "solana-clock 3.2.1", + "solana-fee", "solana-kite", + "solana-program-runtime", "solana-sysvar 3.1.1", "spl-associated-token-account", "spl-token", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -3413,11 +3500,12 @@ dependencies = [ "borsh 1.7.0", "pythexample", "sha2 0.10.9", - "solana-account 3.4.0", - "solana-address 2.6.1", - "solana-clock 3.1.1", + "solana-account 4.7.0", + "solana-clock 3.2.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -3455,6 +3543,12 @@ version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + [[package]] name = "radium" version = "0.7.0" @@ -3495,6 +3589,16 @@ dependencies = [ "rand_core 0.9.5", ] +[[package]] +name = "rand" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af" +dependencies = [ + "getrandom 0.4.3", + "rand_core 0.10.1", +] + [[package]] name = "rand_chacha" version = "0.2.2" @@ -3552,6 +3656,12 @@ dependencies = [ "getrandom 0.3.4", ] +[[package]] +name = "rand_core" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" + [[package]] name = "rand_hc" version = "0.2.0" @@ -3578,10 +3688,10 @@ dependencies = [ "pinocchio 0.10.2", "pinocchio-log", "pinocchio-system 0.5.0", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -3593,11 +3703,11 @@ dependencies = [ "borsh 1.7.0", "borsh-derive 1.7.0", "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -3646,8 +3756,10 @@ version = "0.1.0" dependencies = [ "anchor-lang", "anchor-v2-testing", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -3658,11 +3770,11 @@ dependencies = [ "pinocchio 0.10.2", "pinocchio-log", "pinocchio-system 0.5.0", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", - "solana-rent 4.3.0", + "solana-pubkey 4.3.0", + "solana-rent 4.4.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -3674,10 +3786,10 @@ dependencies = [ "litesvm", "pinocchio 0.10.2", "pinocchio-log", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-transaction", ] @@ -3688,22 +3800,22 @@ dependencies = [ "borsh 1.7.0", "borsh-derive 0.9.3", "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-transaction", ] [[package]] name = "rfc6979" -version = "0.4.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +checksum = "b4a459cddafb3fe76b31fd8f1108007566c40301feb64dc7b54656eb7388172b" dependencies = [ - "hmac 0.12.1", - "subtle", + "crypto-bigint", + "hmac 0.13.0", ] [[package]] @@ -3735,14 +3847,14 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sec1" -version = "0.7.3" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +checksum = "d56d437c2f19203ce5f7122e507831de96f3d2d4d3be5af44a0b0a09d8a80e4d" dependencies = [ "base16ct", - "der", - "generic-array", - "pkcs8", + "ctutils", + "der 0.8.3", + "hybrid-array", "subtle", "zeroize", ] @@ -3755,23 +3867,14 @@ checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" [[package]] name = "serde" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" dependencies = [ "serde_core", "serde_derive", ] -[[package]] -name = "serde-big-array" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11fc7cc2c76d73e0f27ee52abbd64eec84d46f370c88371120433196934e4b7f" -dependencies = [ - "serde", -] - [[package]] name = "serde_bytes" version = "0.11.19" @@ -3784,22 +3887,22 @@ dependencies = [ [[package]] name = "serde_core" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 3.0.9", ] [[package]] @@ -3837,6 +3940,16 @@ dependencies = [ "syn 2.0.118", ] +[[package]] +name = "serdect" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66cf8fedced2fcf12406bcb34223dffb92eaf34908ede12fed414c82b7f00b3e" +dependencies = [ + "base16ct", + "serde", +] + [[package]] name = "sha2" version = "0.9.9" @@ -3861,6 +3974,17 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha2" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d7069beb7d6ac7b9acd1039986e73443f24234f41074da099d6f994ac9ad19" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "digest 0.11.3", +] + [[package]] name = "sha2-const-stable" version = "0.1.0" @@ -3889,10 +4013,19 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest 0.10.7", "rand_core 0.6.4", ] +[[package]] +name = "signature" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d567dcbaf0049cb8ac2608a76cd95ff9e4412e1899d389ee400918ca7537f5" +dependencies = [ + "digest 0.11.3", + "rand_core 0.10.1", +] + [[package]] name = "slab" version = "0.4.12" @@ -3920,20 +4053,21 @@ dependencies = [ [[package]] name = "solana-account" -version = "3.4.0" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efc0ed36decb689413b9da5d57f2be49eea5bebb3cf7897015167b0c4336e731" +checksum = "981155967c57428348ca75b2296e079688d09bf16c5751502eaa49f65da83cb1" dependencies = [ "bincode", "serde", "serde_bytes", "serde_derive", "solana-account-info 3.1.1", - "solana-clock 3.1.1", + "solana-clock 3.2.1", "solana-instruction-error", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sdk-ids 3.1.0", - "solana-sysvar 3.1.1", + "solana-sysvar 4.2.0", + "wincode", ] [[package]] @@ -3957,7 +4091,7 @@ checksum = "a9cf16495d9eb53e3d04e72366a33bb1c20c24e78c171d8b8f5978357b63ae95" dependencies = [ "bincode", "serde_core", - "solana-address 2.6.1", + "solana-address 2.7.0", "solana-program-error 3.0.1", "solana-program-memory 3.1.0", ] @@ -3968,7 +4102,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f37ca34c37f92ee341b73d5ce7c8ef5bb38e9a87955b4bd343c63fa18b149215" dependencies = [ - "solana-address 2.6.1", + "solana-address 2.7.0", "solana-program-error 3.0.1", ] @@ -3978,7 +4112,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc141b940560430425ebaadb7645496c45f6a10fad9911d719bd03eab7f4d422" dependencies = [ - "solana-address 2.6.1", + "solana-address 2.7.0", "solana-program-error 3.0.1", ] @@ -3988,14 +4122,14 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2ecac8e1b7f74c2baa9e774c42817e3e75b20787134b76cc4d45e8a604488f5" dependencies = [ - "solana-address 2.6.1", + "solana-address 2.7.0", ] [[package]] name = "solana-address" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c93e262f671bf402e1040e4a7e40b05d81da5956c7681948c975a0997517bb" +checksum = "01332a01c0a3098404d55a724c8d9a92aed4a50fe40a7dd0c7a51e29274c14de" dependencies = [ "borsh 1.7.0", "bytemuck", @@ -4003,15 +4137,16 @@ dependencies = [ "curve25519-dalek", "five8 1.0.0", "five8_const 1.0.0", + "rand 0.9.4", "serde", "serde_derive", "sha2-const-stable", "solana-atomic-u64 3.0.1", - "solana-define-syscall 5.1.0", + "solana-define-syscall 5.3.0", "solana-program-error 3.0.1", "solana-sanitize 3.0.1", "solana-sha256-hasher 3.1.0", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -4033,20 +4168,20 @@ dependencies = [ [[package]] name = "solana-address-lookup-table-interface" -version = "3.0.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e8df0b083c10ce32490410f3795016b1b5d9b4d094658c0a5e496753645b7cd" +checksum = "8dedafa11d25554279235dd0539d378adc144183eca65072a302c9592cc6a591" dependencies = [ "bincode", "bytemuck", "serde", "serde_derive", - "solana-clock 3.1.1", - "solana-instruction 3.2.0", + "solana-clock 3.2.1", + "solana-instruction 3.5.1", "solana-instruction-error", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sdk-ids 3.1.0", - "solana-slot-hashes 3.0.1", + "solana-slot-hashes 3.2.0", ] [[package]] @@ -4073,7 +4208,7 @@ version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75db7f2bbac3e62cfd139065d15bcda9e2428883ba61fc8d27ccb251081e7567" dependencies = [ - "num-bigint 0.4.6", + "num-bigint", "num-traits", "solana-define-syscall 2.3.0", ] @@ -4084,11 +4219,21 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30c80fb6d791b3925d5ec4bf23a7c169ef5090c013059ec3ed7d0b2c04efa085" dependencies = [ - "num-bigint 0.4.6", + "num-bigint", "num-traits", "solana-define-syscall 3.0.0", ] +[[package]] +name = "solana-big-mod-exp" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05789c4afc39164132db9dcc117218d412ca1f1271d2c629fc6f554c19e5a44" +dependencies = [ + "num-bigint", + "solana-define-syscall 5.3.0", +] + [[package]] name = "solana-bincode" version = "2.2.1" @@ -4131,27 +4276,42 @@ checksum = "7116e1d942a2432ca3f514625104757ab8a56233787e95144c93950029e31176" dependencies = [ "blake3", "solana-define-syscall 4.0.1", - "solana-hash 4.2.0", + "solana-hash 4.6.0", ] [[package]] name = "solana-bls-signatures" -version = "3.2.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3d8a6e1a009bddbdbfe13ee6ff206c16afa9f8fae7d04612d779ac2254ad5f" +checksum = "3f7e9dbeff4dab3484175666a367171b60fe514b707d6de1ab3b741f0168e735" dependencies = [ "base64 0.22.1", "blst", "blstrs", "cfg_eval", - "ff", + "ff 0.13.1", "group 0.13.0", "pairing", "rand 0.8.6", "serde", "serde_json", "serde_with", - "thiserror 2.0.18", + "thiserror 2.0.21", + "wincode", + "zeroize", +] + +[[package]] +name = "solana-bls12-381-syscall" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94e8256fda0542709fd1320a96d81c3c66e10ac5f680cca9b991d7d3b0e3fe86" +dependencies = [ + "blst", + "blstrs", + "bytemuck", + "bytemuck_derive", + "pairing", ] [[package]] @@ -4165,8 +4325,8 @@ dependencies = [ "ark-ff 0.5.0", "ark-serialize 0.5.0", "bytemuck", - "solana-define-syscall 5.1.0", - "thiserror 2.0.18", + "solana-define-syscall 5.3.0", + "thiserror 2.0.21", ] [[package]] @@ -4190,46 +4350,43 @@ dependencies = [ [[package]] name = "solana-bpf-loader-program" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219bfba64973ac9e64aa181f03fd56ac319e2d50d8a23d16c54bbd7fa9807a47" +checksum = "bcb78ed7a639359ebc07d0a765d33e9b61e81dbc6790399e1ef68e2869305890" dependencies = [ - "agave-syscalls", "bincode", "qualifier_attr", - "solana-account 3.4.0", + "solana-account 4.7.0", "solana-bincode 3.1.0", - "solana-clock 3.1.1", - "solana-instruction 3.2.0", - "solana-loader-v3-interface 6.1.0", - "solana-loader-v4-interface 3.1.0", + "solana-clock 3.2.1", + "solana-instruction 3.5.1", + "solana-loader-v3-interface 7.0.0", "solana-packet", - "solana-program-entrypoint 3.1.1", "solana-program-runtime", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sbpf", "solana-sdk-ids 3.1.0", "solana-svm-feature-set", "solana-svm-log-collector", "solana-svm-measure", "solana-svm-type-overrides", - "solana-system-interface 3.1.0", + "solana-syscalls", + "solana-system-interface 3.3.0", "solana-transaction-context", ] [[package]] name = "solana-builtins" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dda9d147935c741533496edf72c5b712885d4793a0bca13a21bd75d8f5dc30e9" +checksum = "9eee096dc70609ccdd247ca587f57f466bba39cfc348dcee70bc457aa5ed6b44" dependencies = [ "agave-feature-set", "solana-bpf-loader-program", "solana-compute-budget-program", - "solana-hash 4.2.0", - "solana-loader-v4-program", + "solana-hash 4.6.0", "solana-program-runtime", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sdk-ids 3.1.0", "solana-system-program", "solana-vote-program", @@ -4239,20 +4396,14 @@ dependencies = [ [[package]] name = "solana-builtins-default-costs" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3167997e8ac0fe100c4ed54503568d22204aeda56f4d3549e0c09a700b609aa8" +checksum = "fb5e6761778ff426e7310795c63f42679199f1dc0ee34a616b63cdd481c5b31c" dependencies = [ "agave-feature-set", "ahash", - "log", - "solana-bpf-loader-program", - "solana-compute-budget-program", - "solana-loader-v4-program", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sdk-ids 3.1.0", - "solana-system-program", - "solana-vote-program", ] [[package]] @@ -4270,9 +4421,18 @@ dependencies = [ [[package]] name = "solana-clock" -version = "3.1.1" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0acdace90d96e2c9e70d681465b4fe888b6bcf27c354ae9774e9f8a3b72923d" +checksum = "5f536b035433918d204397c2989d3c75f0d57af6948c3235599cfe909038af43" +dependencies = [ + "solana-clock 4.0.0", +] + +[[package]] +name = "solana-clock" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "178fc0c31655aa16190cc112919dcdf279437e14b2f2f9790fe1ec29157ff20c" dependencies = [ "serde", "serde_derive", @@ -4280,13 +4440,14 @@ dependencies = [ "solana-sdk-ids 3.1.0", "solana-sdk-macro 3.0.1", "solana-sysvar-id 3.1.0", + "wincode", ] [[package]] name = "solana-compute-budget" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b591fbaed6d9ab4cba6a5a82eb5df208072ced2e5b74c59e9d309ff87af0615f" +checksum = "48ab34f04fa0a5de43c630a1afb415f093066acbf0882ee5f19bf18362a03e52" dependencies = [ "solana-fee-structure", "solana-program-runtime", @@ -4294,41 +4455,38 @@ dependencies = [ [[package]] name = "solana-compute-budget-instruction" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006d9b6a34f9d7b719100653317990ed55e572107702104c054133b40f587306" +checksum = "df4efee43d4ccbd4017cfaf690d6339010a3ebf8913186b4fc36545a88959416" dependencies = [ "agave-feature-set", - "log", "solana-borsh 3.0.2", "solana-builtins-default-costs", "solana-compute-budget", "solana-compute-budget-interface", - "solana-instruction 3.2.0", - "solana-packet", - "solana-pubkey 4.1.0", + "solana-instruction 3.5.1", + "solana-pubkey 4.3.0", "solana-sdk-ids 3.1.0", "solana-svm-transaction", - "solana-transaction-error 3.1.0", - "thiserror 2.0.18", + "solana-transaction-error 3.4.0", ] [[package]] name = "solana-compute-budget-interface" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8292c436b269ad23cecc8b24f7da3ab07ca111661e25e00ce0e1d22771951ab9" +checksum = "0139c131989ae133c23b31c04ecf03949c198a335e5dc028ddd54bb5c9fe6ee8" dependencies = [ "borsh 1.7.0", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-sdk-ids 3.1.0", ] [[package]] name = "solana-compute-budget-program" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a22bcf5088ebe5cb2aa548580d0a466de813032b425707a7745a2a63a7764cdc" +checksum = "6bcbb61fa41b917b59850feb8f7f588317611898af10611fe6977207511d1177" dependencies = [ "solana-program-runtime", ] @@ -4355,9 +4513,9 @@ checksum = "4dea26709d867aada85d0d3617db0944215c8bb28d3745b912de7db13a23280c" dependencies = [ "solana-account-info 3.1.1", "solana-define-syscall 4.0.1", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-program-error 3.0.1", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-stable-layout 3.0.1", ] @@ -4372,7 +4530,7 @@ dependencies = [ "curve25519-dalek", "solana-define-syscall 3.0.0", "subtle", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -4384,9 +4542,9 @@ dependencies = [ "bytemuck", "bytemuck_derive", "curve25519-dalek", - "solana-define-syscall 5.1.0", + "solana-define-syscall 5.3.0", "subtle", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -4418,9 +4576,9 @@ checksum = "57e5b1c0bc1d4a4d10c88a4100499d954c09d3fecfae4912c1a074dff68b1738" [[package]] name = "solana-define-syscall" -version = "5.1.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e14a4f604117f379840956a8fc8695e4c84f5b0ebed192f31f60d9b85d581d" +checksum = "e4d02bb1453b6f9e1e705383a44b98a8722669b44adcdfe3643183987fdad72e" [[package]] name = "solana-derivation-path" @@ -4444,6 +4602,26 @@ dependencies = [ "uriparse", ] +[[package]] +name = "solana-ed25519" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff4c7caf3fe3d70815869a5838ee45b4d2b009eaacea1790ef3cd9b3c89edbbd" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "curve25519-dalek-derive", + "digest 0.11.3", + "ed25519", + "hashbrown 0.15.5", + "rand 0.10.3", + "rand_core 0.10.1", + "rustc_version", + "sha2 0.11.1", + "subtle", + "zeroize", +] + [[package]] name = "solana-epoch-rewards" version = "2.2.1" @@ -4460,16 +4638,18 @@ dependencies = [ [[package]] name = "solana-epoch-rewards" -version = "3.0.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5e7b0ba210593ba8ddd39d6d234d81795d1671cebf3026baa10d5dc23ac42f0" +checksum = "0788d74ee15778deecaa15ed1a1e37727ba954f86cbc35225450a1f2b5012969" dependencies = [ "serde", "serde_derive", - "solana-hash 4.2.0", + "solana-get-sysvar", + "solana-hash 4.6.0", "solana-sdk-ids 3.1.0", "solana-sdk-macro 3.0.1", "solana-sysvar-id 3.1.0", + "wincode", ] [[package]] @@ -4487,15 +4667,18 @@ dependencies = [ [[package]] name = "solana-epoch-schedule" -version = "3.0.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e5481e72cc4d52c169db73e4c0cd16de8bc943078aac587ec4817a75cc6388f" +checksum = "a1633cfd10cde127f2caf8f12021b4f8e9a425e7e4eea4326e428c422376d6fd" dependencies = [ "serde", "serde_derive", + "solana-get-sysvar", + "solana-program-error 3.0.1", "solana-sdk-ids 3.1.0", "solana-sdk-macro 3.0.1", "solana-sysvar-id 3.1.0", + "wincode", ] [[package]] @@ -4504,8 +4687,8 @@ version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "027e6d0b9e7daac5b2ac7c3f9ca1b727861121d9ef05084cf435ff736051e7c2" dependencies = [ - "solana-define-syscall 5.1.0", - "solana-pubkey 4.1.0", + "solana-define-syscall 5.3.0", + "solana-pubkey 4.3.0", ] [[package]] @@ -4526,7 +4709,7 @@ dependencies = [ "solana-pubkey 2.4.0", "solana-sdk-ids 2.2.1", "solana-system-interface 1.0.0", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -4537,17 +4720,17 @@ checksum = "978855d164845c1b0235d4b4d101cadc55373fffaf0b5b6cfa2194d25b2ed658" dependencies = [ "serde", "serde_derive", - "solana-address-lookup-table-interface 3.0.1", - "solana-clock 3.1.1", + "solana-address-lookup-table-interface 3.2.0", + "solana-clock 3.2.1", "solana-hash 3.1.0", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keccak-hasher 3.1.0", "solana-message 3.1.0", - "solana-nonce 3.1.0", + "solana-nonce 3.3.0", "solana-pubkey 3.0.0", "solana-sdk-ids 3.1.0", "solana-system-interface 2.0.0", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -4558,13 +4741,13 @@ checksum = "0eb265ff95e28eceda117e2e3d2d2a611ecbbfe911dfeeeecd1521814540ffab" dependencies = [ "serde", "serde_derive", - "solana-hash 4.2.0", - "solana-instruction 3.2.0", - "solana-nonce 3.1.0", - "solana-pubkey 4.1.0", + "solana-hash 4.6.0", + "solana-instruction 3.5.1", + "solana-nonce 3.3.0", + "solana-pubkey 4.3.0", "solana-sdk-ids 3.1.0", - "solana-system-interface 3.1.0", - "thiserror 2.0.18", + "solana-system-interface 3.3.0", + "thiserror 2.0.21", ] [[package]] @@ -4588,30 +4771,29 @@ dependencies = [ [[package]] name = "solana-feature-gate-interface" -version = "3.1.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75ca9b5cbb6f500f7fd73db5bd95640f71a83f04d6121a0e59a43b202dca2731" +checksum = "bd7545e02f91da1d6996f32b18f7796aa01e0682f8f3a7434b82cd1a10448add" dependencies = [ "bincode", "serde", "serde_derive", - "solana-account 3.4.0", + "solana-account 4.7.0", "solana-account-info 3.1.1", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-program-error 3.0.1", - "solana-pubkey 4.1.0", - "solana-rent 4.3.0", + "solana-pubkey 4.3.0", + "solana-rent 4.4.0", "solana-sdk-ids 3.1.0", - "solana-system-interface 3.1.0", + "solana-system-interface 3.3.0", ] [[package]] name = "solana-fee" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e506f6ec94e5733b0f2114b43bd8a2abac33a0256e19c65e1d119de008981339" +checksum = "aef1955027445b05366d9c550507f45cafb2310949a3ffdd41a72d70aa94c940" dependencies = [ - "agave-feature-set", "solana-fee-structure", "solana-svm-transaction", ] @@ -4629,20 +4811,21 @@ dependencies = [ [[package]] name = "solana-fee-calculator" -version = "3.2.2" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef67f01cc6a0c72e99a08d0d484683f995de4c80e9568728fa77d1537f9b7e09" +checksum = "d4bf4f4afb4704212ef1d994ee65bef7293441721639dfd16f0e60996f37be51" dependencies = [ "log", "serde", "serde_derive", + "wincode", ] [[package]] name = "solana-fee-structure" -version = "3.0.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e2abdb1223eea8ec64136f39cb1ffcf257e00f915c957c35c0dd9e3f4e700b0" +checksum = "3591f4827715ebb49c290b829f707ec1747a152973436f27699897f752a31cd6" [[package]] name = "solana-get-sysvar" @@ -4650,8 +4833,8 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef3bc859fc036ed490146793557386cbfae614ebba4adc704c37d94350824ed4" dependencies = [ - "solana-address 2.6.1", - "solana-define-syscall 5.1.0", + "solana-address 2.7.0", + "solana-define-syscall 5.3.0", "solana-program-error 3.0.1", ] @@ -4679,14 +4862,14 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "337c246447142f660f778cf6cb582beba8e28deb05b3b24bfb9ffd7c562e5f41" dependencies = [ - "solana-hash 4.2.0", + "solana-hash 4.6.0", ] [[package]] name = "solana-hash" -version = "4.2.0" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8064ea1d591ec791be95245058ca40f4f5345d390c200069d0f79bbf55bfae55" +checksum = "0df9b01495ed31100aca97a7f5862d5e19ab1636d60d1a9f02391408dd9dec84" dependencies = [ "borsh 1.7.0", "bytemuck", @@ -4696,9 +4879,15 @@ dependencies = [ "serde_derive", "solana-atomic-u64 3.0.1", "solana-sanitize 3.0.1", - "wincode 0.4.9", + "wincode", ] +[[package]] +name = "solana-hash-512" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee9c987913768643be3f4fc5f8ec667e8ec19e59e6d131688ade8d1430dafe9" + [[package]] name = "solana-instruction" version = "2.3.3" @@ -4720,28 +4909,36 @@ dependencies = [ [[package]] name = "solana-instruction" -version = "3.2.0" +version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6a6d22d0a6fdf345be294bb9afdcd40c296cdc095e64e7ceaa3bb3c2f608c1c" +checksum = "6d8f113d1312870e2d8698033e9d153d3329c520e1065f05145a55a889e21c91" +dependencies = [ + "solana-instruction 4.0.0", + "solana-instruction-error", +] + +[[package]] +name = "solana-instruction" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ea8442b67a58dd54d5497bfc6cd3106b00f9fe6f6877d33c271c3ec4672eedc" dependencies = [ "bincode", "borsh 1.7.0", "serde", "serde_derive", - "solana-define-syscall 5.1.0", - "solana-instruction-error", - "solana-pubkey 4.1.0", + "solana-define-syscall 5.3.0", + "solana-pubkey 4.3.0", + "wincode", ] [[package]] name = "solana-instruction-error" -version = "2.2.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3d048edaaeef5a3dc8c01853e585539a74417e4c2d43a9e2c161270045b838" +checksum = "e8e7db78c122d02189619490b1fef04a2a042c389662920617c0e6381fdf8fdd" dependencies = [ "num-traits", - "serde", - "serde_derive", "solana-program-error 3.0.1", ] @@ -4752,7 +4949,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60147e4d0a4620013df40bf30a86dd299203ff12fcb8b593cd51014fce0875d8" dependencies = [ "solana-account-view 1.0.0", - "solana-address 2.6.1", + "solana-address 2.7.0", "solana-define-syscall 4.0.1", "solana-program-error 3.0.1", ] @@ -4764,8 +4961,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ab7a27d0c4214b9f7389c3dd00b68c93093a67f1dcc5b7893aebe299bbcbb47" dependencies = [ "solana-account-view 2.0.0", - "solana-address 2.6.1", - "solana-define-syscall 5.1.0", + "solana-address 2.7.0", + "solana-define-syscall 5.3.0", "solana-program-error 3.0.1", ] @@ -4794,13 +4991,30 @@ checksum = "7ddf67876c541aa1e21ee1acae35c95c6fbc61119814bfef70579317a5e26955" dependencies = [ "bitflags 2.13.0", "solana-account-info 3.1.1", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-instruction-error", "solana-program-error 3.0.1", "solana-pubkey 3.0.0", "solana-sanitize 3.0.1", "solana-sdk-ids 3.1.0", - "solana-serialize-utils 3.1.1", + "solana-serialize-utils 3.1.2", + "solana-sysvar-id 3.1.0", +] + +[[package]] +name = "solana-instructions-sysvar" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e38363a181313d607f7a118df2b401bb27b477a0104b09283cbf504f5f0f00cc" +dependencies = [ + "bitflags 2.13.0", + "solana-account-info 3.1.1", + "solana-instruction 3.5.1", + "solana-instruction-error", + "solana-program-error 3.0.1", + "solana-sanitize 3.0.1", + "solana-sdk-ids 3.1.0", + "solana-serialize-utils 3.1.2", "solana-sysvar-id 3.1.0", ] @@ -4824,7 +5038,7 @@ checksum = "ed1c0d16d6fdeba12291a1f068cdf0d479d9bff1141bf44afd7aa9d485f65ef8" dependencies = [ "sha3", "solana-define-syscall 4.0.1", - "solana-hash 4.2.0", + "solana-hash 4.6.0", ] [[package]] @@ -4837,26 +5051,28 @@ dependencies = [ "five8 1.0.0", "five8_core 1.0.0", "rand 0.9.4", - "solana-address 2.6.1", + "solana-address 2.7.0", "solana-seed-phrase 3.0.0", - "solana-signature 3.3.0", - "solana-signer 3.0.0", + "solana-signature 3.5.2", + "solana-signer 3.0.1", ] [[package]] name = "solana-kite" -version = "0.4.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d7a10e83d728f396699efbf559d340d7d6b941deeef6f1b0423ee8d3081a3c" +checksum = "e81501634d790c56907a9c08084d84919472920e44ce5c4d3b76959d5f9568b0" dependencies = [ "litesvm", - "solana-account 3.4.0", - "solana-instruction 3.2.0", + "solana-account 4.7.0", + "solana-compute-budget", + "solana-instruction 3.5.1", "solana-keypair", - "solana-message 3.1.0", + "solana-message 4.6.0", "solana-program 3.0.0", "solana-pubkey 3.0.0", - "solana-signer 3.0.0", + "solana-sdk-ids 3.1.0", + "solana-signer 3.0.1", "solana-transaction", "spl-associated-token-account", "spl-token", @@ -4877,9 +5093,9 @@ dependencies = [ [[package]] name = "solana-last-restart-slot" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22474b83d3c7c318e1c3a725784fc2d1d03b728e36369e58ce48769a61ed85e" +checksum = "5099e736c3c06c451b307a60637d69eb65b3144143ebeed899e2fd1134f4fc35" dependencies = [ "serde", "serde_derive", @@ -4887,6 +5103,7 @@ dependencies = [ "solana-sdk-ids 3.1.0", "solana-sdk-macro 3.0.1", "solana-sysvar-id 3.1.0", + "wincode", ] [[package]] @@ -4920,18 +5137,31 @@ dependencies = [ [[package]] name = "solana-loader-v3-interface" -version = "6.1.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee44c9b1328c5c712c68966fb8de07b47f3e7bac006e74ddd1bb053d3e46e5d" +checksum = "68029ab11d9c891d4ce23ada75745e40f983c5674af366f447b672569634231b" dependencies = [ "serde", "serde_bytes", "serde_derive", - "solana-instruction 3.2.0", - "solana-pubkey 3.0.0", + "solana-instruction 3.5.1", + "solana-pubkey 4.3.0", "solana-sdk-ids 3.1.0", ] +[[package]] +name = "solana-loader-v3-interface" +version = "8.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46255f7494fa739cb0c65ad43aaa12f49d1ed884d8632f0437b9c91ce48a936a" +dependencies = [ + "solana-instruction 3.5.1", + "solana-pubkey 4.3.0", + "solana-sdk-ids 3.1.0", + "solana-system-interface 3.3.0", + "wincode", +] + [[package]] name = "solana-loader-v4-interface" version = "2.2.1" @@ -4953,37 +5183,9 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4c948b33ff81fa89699911b207059e493defdba9647eaf18f23abdf3674e0fb" dependencies = [ - "serde", - "serde_bytes", - "serde_derive", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-pubkey 3.0.0", "solana-sdk-ids 3.1.0", - "solana-system-interface 2.0.0", -] - -[[package]] -name = "solana-loader-v4-program" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b5191cd34f04e4ec9fd5f2ac8a431ba9ffd6c827511fd35f2cae0256a0c6b12" -dependencies = [ - "log", - "solana-account 3.4.0", - "solana-bincode 3.1.0", - "solana-bpf-loader-program", - "solana-instruction 3.2.0", - "solana-loader-v3-interface 6.1.0", - "solana-loader-v4-interface 3.1.0", - "solana-packet", - "solana-program-runtime", - "solana-pubkey 4.1.0", - "solana-sbpf", - "solana-sdk-ids 3.1.0", - "solana-svm-log-collector", - "solana-svm-measure", - "solana-svm-type-overrides", - "solana-transaction-context", ] [[package]] @@ -5015,33 +5217,33 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0448b1fd891c5f46491e5dc7d9986385ba3c852c340db2911dd29faa01d2b08d" dependencies = [ - "bincode", - "blake3", "lazy_static", "serde", "serde_derive", - "solana-address 2.6.1", - "solana-hash 4.2.0", - "solana-instruction 3.2.0", + "solana-address 2.7.0", + "solana-hash 4.6.0", + "solana-instruction 3.5.1", "solana-sanitize 3.0.1", "solana-sdk-ids 3.1.0", - "solana-short-vec 3.2.2", - "solana-transaction-error 3.1.0", + "solana-short-vec 3.3.0", + "solana-transaction-error 3.4.0", ] [[package]] name = "solana-message" -version = "4.0.0" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6435a6070b6c5898201aae845db328cf3bd3cebc17b55af9b43138da5ced4a85" +checksum = "ef4b58f6d685adebefc945f28cf051cf3c11e295233e6dd3adfc0a71c3c6fb76" dependencies = [ - "lazy_static", - "solana-address 2.6.1", - "solana-hash 4.2.0", - "solana-instruction 3.2.0", + "blake3", + "solana-address 2.7.0", + "solana-hash 4.6.0", + "solana-instruction 3.5.1", "solana-sanitize 3.0.1", "solana-sdk-ids 3.1.0", - "solana-transaction-error 3.1.0", + "solana-short-vec 3.3.0", + "solana-transaction-error 3.4.0", + "wincode", ] [[package]] @@ -5059,7 +5261,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726b7cbbc6be6f1c6f29146ac824343b9415133eee8cce156452ad1db93f8008" dependencies = [ - "solana-define-syscall 5.1.0", + "solana-define-syscall 5.3.0", ] [[package]] @@ -5090,38 +5292,45 @@ dependencies = [ [[package]] name = "solana-nonce" -version = "3.1.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc469152a63284ef959b80c59cda015262a021da55d3b8fe42171d89c4b64f8" +checksum = "1f13b7ec92de6dd4ef713ed763d22585efa0042cd244bce81997e52077885c47" dependencies = [ "serde", "serde_derive", - "solana-fee-calculator 3.2.2", - "solana-hash 4.2.0", - "solana-pubkey 4.1.0", + "solana-fee-calculator 3.3.0", + "solana-hash 4.6.0", + "solana-pubkey 4.3.0", "solana-sha256-hasher 3.1.0", + "wincode", ] [[package]] name = "solana-nonce-account" -version = "3.0.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "805fd25b29e5a1a0e6c3dd6320c9da80f275fbe4ff6e392617c303a2085c435e" +checksum = "337cf70e23d7e33d61e5020106ae9894fe10434b3de943e8bc57eb5d7207c1bf" dependencies = [ - "solana-account 3.4.0", - "solana-hash 3.1.0", - "solana-nonce 3.1.0", + "solana-account 4.7.0", + "solana-hash 4.6.0", + "solana-nonce 3.3.0", "solana-sdk-ids 3.1.0", ] +[[package]] +name = "solana-nullable" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "889194d8c5faec648f2f6fadddb60566249921ebb074e2707e7095458d5864e2" + [[package]] name = "solana-packet" -version = "4.1.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad62e1045c2347a0c0e219a6ceb0abfe904be622920996bfcac8d116fabe3c7" +checksum = "0d52aa155d0a8f35de2ded492c1711dfc74795b12de45f199834ccc20da3177b" dependencies = [ "bitflags 2.13.0", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", ] [[package]] @@ -5135,7 +5344,7 @@ dependencies = [ "light-poseidon 0.2.0", "light-poseidon 0.4.0", "solana-define-syscall 4.0.1", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -5165,7 +5374,7 @@ dependencies = [ "lazy_static", "log", "memoffset", - "num-bigint 0.4.6", + "num-bigint", "num-derive 0.4.2", "num-traits", "rand 0.8.6", @@ -5218,12 +5427,12 @@ dependencies = [ "solana-slot-hashes 2.2.1", "solana-slot-history 2.2.1", "solana-stable-layout 2.2.1", - "solana-stake-interface 1.2.1", + "solana-stake-interface", "solana-system-interface 1.0.0", "solana-sysvar 2.3.0", "solana-sysvar-id 2.2.1", "solana-vote-interface 2.2.6", - "thiserror 2.0.18", + "thiserror 2.0.21", "wasm-bindgen", ] @@ -5238,20 +5447,20 @@ dependencies = [ "solana-big-mod-exp 3.0.0", "solana-blake3-hasher 3.1.0", "solana-borsh 3.0.2", - "solana-clock 3.1.1", + "solana-clock 3.2.1", "solana-cpi 3.1.0", "solana-define-syscall 3.0.0", - "solana-epoch-rewards 3.0.1", - "solana-epoch-schedule 3.0.0", + "solana-epoch-rewards 3.2.0", + "solana-epoch-schedule 3.3.0", "solana-epoch-stake", "solana-example-mocks 3.0.0", - "solana-fee-calculator 3.2.2", + "solana-fee-calculator 3.3.0", "solana-hash 3.1.0", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-instruction-error", "solana-instructions-sysvar 3.0.0", "solana-keccak-hasher 3.1.0", - "solana-last-restart-slot 3.1.0", + "solana-last-restart-slot 3.2.0", "solana-msg 3.1.0", "solana-native-token 3.0.0", "solana-program-entrypoint 3.1.1", @@ -5262,13 +5471,13 @@ dependencies = [ "solana-pubkey 3.0.0", "solana-rent 3.1.0", "solana-sdk-ids 3.1.0", - "solana-secp256k1-recover 3.2.0", + "solana-secp256k1-recover 3.3.1", "solana-serde-varint 3.0.1", - "solana-serialize-utils 3.1.1", + "solana-serialize-utils 3.1.2", "solana-sha256-hasher 3.1.0", - "solana-short-vec 3.2.2", - "solana-slot-hashes 3.0.1", - "solana-slot-history 3.1.0", + "solana-short-vec 3.3.0", + "solana-slot-hashes 3.2.0", + "solana-slot-history 3.2.0", "solana-stable-layout 3.0.1", "solana-sysvar 3.1.1", "solana-sysvar-id 3.1.0", @@ -5285,20 +5494,20 @@ dependencies = [ "solana-big-mod-exp 3.0.0", "solana-blake3-hasher 3.1.0", "solana-borsh 3.0.2", - "solana-clock 3.1.1", + "solana-clock 3.2.1", "solana-cpi 3.1.0", - "solana-define-syscall 5.1.0", - "solana-epoch-rewards 3.0.1", - "solana-epoch-schedule 3.0.0", + "solana-define-syscall 5.3.0", + "solana-epoch-rewards 3.2.0", + "solana-epoch-schedule 3.3.0", "solana-epoch-stake", "solana-example-mocks 4.0.0", - "solana-fee-calculator 3.2.2", - "solana-hash 4.2.0", - "solana-instruction 3.2.0", + "solana-fee-calculator 3.3.0", + "solana-hash 4.6.0", + "solana-instruction 3.5.1", "solana-instruction-error", "solana-instructions-sysvar 3.0.0", "solana-keccak-hasher 3.1.0", - "solana-last-restart-slot 3.1.0", + "solana-last-restart-slot 3.2.0", "solana-msg 3.1.0", "solana-native-token 3.0.0", "solana-program-entrypoint 3.1.1", @@ -5306,18 +5515,18 @@ dependencies = [ "solana-program-memory 3.1.0", "solana-program-option 3.1.0", "solana-program-pack 3.1.0", - "solana-pubkey 4.1.0", - "solana-rent 4.3.0", + "solana-pubkey 4.3.0", + "solana-rent 4.4.0", "solana-sdk-ids 3.1.0", - "solana-secp256k1-recover 3.2.0", + "solana-secp256k1-recover 3.3.1", "solana-serde-varint 3.0.1", - "solana-serialize-utils 3.1.1", + "solana-serialize-utils 3.1.2", "solana-sha256-hasher 3.1.0", - "solana-short-vec 3.2.2", - "solana-slot-hashes 3.0.1", - "solana-slot-history 3.1.0", + "solana-short-vec 3.3.0", + "solana-slot-hashes 3.2.0", + "solana-slot-history 3.2.0", "solana-stable-layout 3.0.1", - "solana-sysvar 4.0.0", + "solana-sysvar 4.2.0", "solana-sysvar-id 3.1.0", ] @@ -5342,7 +5551,7 @@ dependencies = [ "solana-account-info 3.1.1", "solana-define-syscall 4.0.1", "solana-program-error 3.0.1", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", ] [[package]] @@ -5378,7 +5587,7 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffd48ddef444e6db138fb11bdb9ab8117bb830a78cef051a453454de5613039b" dependencies = [ - "solana-define-syscall 5.1.0", + "solana-define-syscall 5.3.0", "solana-program-log-macro", ] @@ -5443,36 +5652,35 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6c7f89c89d5ff25f64a41c8cb00478b1d62f941f14a7dd8537c9e50bb2acc92" +checksum = "88c8bc45f8c07f5eb88dd0621e1ec4541accfaa33c0bdf03de40082e88ee5f49" dependencies = [ "base64 0.22.1", "bincode", "cfg-if", "itertools 0.14.0", "log", - "percentage", "rand 0.9.4", "serde", - "solana-account 3.4.0", + "solana-account 4.7.0", "solana-account-info 3.1.1", - "solana-clock 3.1.1", - "solana-epoch-rewards 3.0.1", - "solana-epoch-schedule 3.0.0", + "solana-clock 3.2.1", + "solana-epoch-rewards 3.2.0", + "solana-epoch-schedule 3.3.0", "solana-fee-structure", - "solana-hash 4.2.0", - "solana-instruction 3.2.0", - "solana-last-restart-slot 3.1.0", - "solana-loader-v3-interface 6.1.0", + "solana-hash 4.6.0", + "solana-instruction 3.5.1", + "solana-last-restart-slot 3.2.0", + "solana-loader-v3-interface 7.0.0", "solana-program-entrypoint 3.1.1", - "solana-pubkey 4.1.0", - "solana-rent 3.1.0", + "solana-pubkey 4.3.0", + "solana-rent 4.4.0", "solana-sbpf", "solana-sdk-ids 3.1.0", - "solana-slot-hashes 3.0.1", + "solana-slot-hashes 3.2.0", "solana-stable-layout 3.0.1", - "solana-stake-interface 2.0.2", + "solana-stake-history", "solana-svm-callback", "solana-svm-feature-set", "solana-svm-log-collector", @@ -5480,11 +5688,12 @@ dependencies = [ "solana-svm-timings", "solana-svm-transaction", "solana-svm-type-overrides", - "solana-system-interface 3.1.0", - "solana-sysvar 3.1.1", + "solana-system-interface 3.3.0", + "solana-sysvar 4.2.0", "solana-sysvar-id 3.1.0", "solana-transaction-context", - "thiserror 2.0.18", + "thiserror 2.0.21", + "wincode", ] [[package]] @@ -5524,11 +5733,12 @@ dependencies = [ [[package]] name = "solana-pubkey" -version = "4.1.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b06bd918d60111ee1f97de817113e2040ca0cedb740099ee8d646233f6b906c" +checksum = "10f71b7a414de2ced1071f015834e9be581592d013432adbd06d02e4af11eba9" dependencies = [ - "solana-address 2.6.1", + "rand 0.9.4", + "solana-address 2.7.0", ] [[package]] @@ -5559,9 +5769,9 @@ dependencies = [ [[package]] name = "solana-rent" -version = "4.3.0" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39f0d780bf8e8a1fe8b5b5fce1acad6b209485b86dec246e7523d5e4a8b7c7fc" +checksum = "dc016b348926395ba01f8288cdf5da25fc30f5a0806028b32d5e5b3147b10bf9" dependencies = [ "serde", "serde_derive", @@ -5569,6 +5779,30 @@ dependencies = [ "solana-sdk-ids 3.1.0", "solana-sdk-macro 3.0.1", "solana-sysvar-id 3.1.0", + "wincode", +] + +[[package]] +name = "solana-runtime-transaction" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17fa8d6894320fdd524d83a5570b75d9db40bb215c354972281a4d5eeb5292f0" +dependencies = [ + "agave-feature-set", + "agave-transaction-view", + "solana-compute-budget", + "solana-compute-budget-instruction", + "solana-hash 4.6.0", + "solana-message 4.6.0", + "solana-program-entrypoint 3.1.1", + "solana-pubkey 4.3.0", + "solana-sdk-ids 3.1.0", + "solana-signature 3.5.2", + "solana-svm-transaction", + "solana-transaction", + "solana-transaction-context", + "solana-transaction-error 3.4.0", + "wincode", ] [[package]] @@ -5585,9 +5819,9 @@ checksum = "dcf09694a0fc14e5ffb18f9b7b7c0f15ecb6eac5b5610bf76a1853459d19daf9" [[package]] name = "solana-sbpf" -version = "0.14.4" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733b3657a0fab205102b799dbe17f85d3972cf984232c1b0b108fa6ba438e382" +checksum = "ccbbc7c304b4b3bf26b91b39431013d3305312d0d025cf0a82db94b88996035b" dependencies = [ "byteorder", "combine", @@ -5597,7 +5831,7 @@ dependencies = [ "log", "rand 0.8.6", "rustc-demangle", - "thiserror 2.0.18", + "thiserror 2.0.21", "winapi", ] @@ -5616,7 +5850,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "def234c1956ff616d46c9dd953f251fa7096ddbaa6d52b165218de97882b7280" dependencies = [ - "solana-address 2.6.1", + "solana-address 2.7.0", ] [[package]] @@ -5651,18 +5885,18 @@ checksum = "baa3120b6cdaa270f39444f5093a90a7b03d296d362878f7a6991d6de3bbe496" dependencies = [ "libsecp256k1 0.6.0", "solana-define-syscall 2.3.0", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] name = "solana-secp256k1-recover" -version = "3.2.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a1ad3ed7846631c88c71c5d2f21a2ecb6b61da333d9be173b6b061b35609ae" +checksum = "99f00f973301968be9f05f4af951974a28848b6513fb16edf77c8af20e681914" dependencies = [ "k256", - "solana-define-syscall 5.1.0", - "thiserror 2.0.18", + "solana-define-syscall 5.3.0", + "thiserror 2.0.21", ] [[package]] @@ -5736,12 +5970,12 @@ dependencies = [ [[package]] name = "solana-serialize-utils" -version = "3.1.1" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d7cc401931d178472358e6b78dc72d031dc08f752d7410f0e8bd259dd6f02fa" +checksum = "761357b0853c9623bf12c1d2314b3d6160a85b087b84c45224fb85766d22616b" dependencies = [ "solana-instruction-error", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sanitize 3.0.1", ] @@ -5764,7 +5998,18 @@ checksum = "db7dc3011ea4c0334aaaa7e7128cb390ecf546b28d412e9bf2064680f57f588f" dependencies = [ "sha2 0.10.9", "solana-define-syscall 4.0.1", - "solana-hash 4.2.0", + "solana-hash 4.6.0", +] + +[[package]] +name = "solana-sha512-hasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11e10e103ab5bd52af341e7bc2f4123a2f4e66bb7ba4e6ca40f1e00cd6314e02" +dependencies = [ + "sha2 0.10.9", + "solana-define-syscall 5.3.0", + "solana-hash-512", ] [[package]] @@ -5778,11 +6023,12 @@ dependencies = [ [[package]] name = "solana-short-vec" -version = "3.2.2" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d8250a4495aad49ad20556a607da53bdcb20de78da10b65afbf918b7f1de647" +checksum = "c75782529cc4521114c1ecd71c7e2cdebd41a6fe9844b5d088fd36ef08c57c36" dependencies = [ "serde_core", + "wincode", ] [[package]] @@ -5797,17 +6043,15 @@ dependencies = [ [[package]] name = "solana-signature" -version = "3.3.0" +version = "3.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "132a93134f1262aa832f1849b83bec6c9945669b866da18661a427943b9e801e" +checksum = "fe45ce95700ac8045e422344b88e273843d70185873cc1cc880ba06dd9fa9002" dependencies = [ - "ed25519-dalek", "five8 1.0.0", "serde", - "serde-big-array", - "serde_derive", + "solana-ed25519", "solana-sanitize 3.0.1", - "wincode 0.4.9", + "wincode", ] [[package]] @@ -5823,13 +6067,13 @@ dependencies = [ [[package]] name = "solana-signer" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bfea97951fee8bae0d6038f39a5efcb6230ecdfe33425ac75196d1a1e3e3235" +checksum = "520bd6021163ee517f4bdc7ae03ded904f97e11320001ba0b3355f45eb14f558" dependencies = [ - "solana-pubkey 3.0.0", - "solana-signature 3.3.0", - "solana-transaction-error 3.1.0", + "solana-pubkey 4.3.0", + "solana-signature 3.5.2", + "solana-transaction-error 3.4.0", ] [[package]] @@ -5847,15 +6091,17 @@ dependencies = [ [[package]] name = "solana-slot-hashes" -version = "3.0.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2585f70191623887329dfb5078da3a00e15e3980ea67f42c2e10b07028419f43" +checksum = "007d6bc909599eea325c9d09f7ff16ef6166c134876ff47a6a122d693d058dad" dependencies = [ "serde", "serde_derive", - "solana-hash 4.2.0", + "solana-get-sysvar", + "solana-hash 4.6.0", "solana-sdk-ids 3.1.0", "solana-sysvar-id 3.1.0", + "wincode", ] [[package]] @@ -5873,9 +6119,9 @@ dependencies = [ [[package]] name = "solana-slot-history" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40427c04d3e808493cb5e3d1a97cef84d7c15cb6f89b15c5684d0d4027105600" +checksum = "4560fde841a6f2001aedc33b74fe99840ee3d56a71fe9b98ee332303b8597900" dependencies = [ "bv", "serde", @@ -5883,6 +6129,7 @@ dependencies = [ "solana-get-sysvar", "solana-sdk-ids 3.1.0", "solana-sysvar-id 3.1.0", + "wincode", ] [[package]] @@ -5901,8 +6148,23 @@ version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9f6a291ba063a37780af29e7db14bdd3dc447584d8ba5b3fc4b88e2bbc982fa" dependencies = [ - "solana-instruction 3.2.0", - "solana-pubkey 4.1.0", + "solana-instruction 3.5.1", + "solana-pubkey 4.3.0", +] + +[[package]] +name = "solana-stake-history" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c814b4e2570f8c343eb1d4f968ff981bdf518afc3643d070d8e5a28158e85a4b" +dependencies = [ + "serde", + "serde_derive", + "solana-clock 3.2.1", + "solana-get-sysvar", + "solana-sdk-ids 3.1.0", + "solana-sysvar-id 3.1.0", + "wincode", ] [[package]] @@ -5926,92 +6188,116 @@ dependencies = [ "solana-sysvar-id 2.2.1", ] -[[package]] -name = "solana-stake-interface" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9bc26191b533f9a6e5a14cca05174119819ced680a80febff2f5051a713f0db" -dependencies = [ - "num-traits", - "serde", - "serde_derive", - "solana-clock 3.1.1", - "solana-cpi 3.1.0", - "solana-instruction 3.2.0", - "solana-program-error 3.0.1", - "solana-pubkey 3.0.0", - "solana-system-interface 2.0.0", - "solana-sysvar 3.1.1", - "solana-sysvar-id 3.1.0", -] - [[package]] name = "solana-svm-callback" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4006b0da7e50cba514ced6b47bcf8f9591552458200e361fd4bdef4068cb2fed" +checksum = "73c7516287cbd47f2990f82cf5d5afd3fc7cf3c56a1397d1397d238ce6042415" dependencies = [ - "solana-account 3.4.0", - "solana-clock 3.1.1", + "solana-account 4.7.0", + "solana-clock 3.2.1", "solana-precompile-error", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", ] [[package]] name = "solana-svm-feature-set" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24ea15c0d91403375e3d017cc09780cf138b629abba4ccaaa7cf66b1afea1059" +checksum = "aeecab4b2418f9f1cc5e99515a7f21402a4b6b88365dfeff0e6be4d9b9fd80f3" [[package]] name = "solana-svm-log-collector" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb7d3ccd3a51b85807ff16b2f513069e8b55e220b280774a3e9b899bcb81987" +checksum = "895fc9ebc48bf6645088fe364c6306d00dd9f5f516023dc04eacb24a114a3201" dependencies = [ "log", ] [[package]] name = "solana-svm-measure" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d70c9972c1f03cb2bbc64d23dc2079419a66d89b49d6b44f79206530551ddc8c" +checksum = "18b970d100026b090ef55793cae5e06dc737c0cada20adfbcede1fcdb836d0e6" [[package]] name = "solana-svm-timings" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20f3d66aa88c9001a076362108f7967d6a00d121ba38428e56928935566ed5bd" +checksum = "ac391bfdb859591b46242cfda0ed278006735373394f6955fe9b014db4f1deb3" dependencies = [ "eager", "enum-iterator", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", ] [[package]] name = "solana-svm-transaction" -version = "4.0.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "067861db805d135a6fbe489bf2b74d701f270df8d03afd3257f7d51a2ff3467e" +checksum = "0afde938e0d3f06e87853e6e189396d67256e3b600675d867a47d066f8cebadb" dependencies = [ - "solana-hash 4.2.0", - "solana-message 3.1.0", - "solana-pubkey 4.1.0", + "solana-hash 4.6.0", + "solana-message 4.6.0", + "solana-pubkey 4.3.0", "solana-sdk-ids 3.1.0", - "solana-signature 3.3.0", + "solana-signature 3.5.2", "solana-transaction", ] [[package]] name = "solana-svm-type-overrides" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e41661ebf0edcc296b15251c08fee0ad2da3257e6ab86cea2a0a8f6fba642c6" +checksum = "cb43b01b9df0ef785b3e952b36d384da522c2eb5df511f45c2c84d054f6438fa" dependencies = [ "rand 0.9.4", ] +[[package]] +name = "solana-syscalls" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2335d6f994a1ff4c6b65eadcfef0cb011bc5165b69affbcef28fd1e9d6cb39c2" +dependencies = [ + "bincode", + "libsecp256k1 0.7.2", + "num-traits", + "solana-account 4.7.0", + "solana-account-info 3.1.1", + "solana-big-mod-exp 4.0.0", + "solana-blake3-hasher 3.1.0", + "solana-bls12-381-syscall", + "solana-bn254", + "solana-clock 3.2.1", + "solana-cpi 3.1.0", + "solana-curve25519 4.0.1", + "solana-define-syscall 5.3.0", + "solana-hash 4.6.0", + "solana-hash-512", + "solana-instruction 3.5.1", + "solana-keccak-hasher 3.1.0", + "solana-poseidon", + "solana-program-entrypoint 3.1.1", + "solana-program-runtime", + "solana-pubkey 4.3.0", + "solana-sbpf", + "solana-sdk-ids 3.1.0", + "solana-secp256k1-recover 3.3.1", + "solana-sha256-hasher 3.1.0", + "solana-sha512-hasher", + "solana-stable-layout 3.0.1", + "solana-stake-history", + "solana-svm-feature-set", + "solana-svm-log-collector", + "solana-svm-type-overrides", + "solana-sysvar-id 3.1.0", + "solana-transaction-context", + "thiserror 2.0.21", + "wincode", +] + [[package]] name = "solana-system-interface" version = "1.0.0" @@ -6037,7 +6323,7 @@ dependencies = [ "num-traits", "serde", "serde_derive", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-msg 3.1.0", "solana-program-error 3.0.1", "solana-pubkey 3.0.0", @@ -6045,42 +6331,41 @@ dependencies = [ [[package]] name = "solana-system-interface" -version = "3.1.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a95a6f2e23ed861d6444ad4a6d6896c418d7d101b960787e65a8e33157cee81b" +checksum = "2e2d5311d0584af231c6c2b0503ba1c3aa50118ead4f503ab215ccbdd1ffac57" dependencies = [ "num-traits", "serde", "serde_derive", - "solana-address 2.6.1", - "solana-instruction 3.2.0", + "solana-address 2.7.0", + "solana-instruction 3.5.1", "solana-msg 3.1.0", "solana-program-error 3.0.1", + "wincode", ] [[package]] name = "solana-system-program" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "450479004fee3396c88cc4aa2f9b2b8db9c77be42ee7c1c53e6fac9eaec5fd51" +checksum = "5c93fc4ebe7aa9ec71ebea68c8cad95cff8ef332e8353a35a536a9e2e3774c93" dependencies = [ "bincode", "log", - "serde", - "solana-account 3.4.0", + "solana-account 4.7.0", "solana-bincode 3.1.0", - "solana-fee-calculator 3.2.2", - "solana-instruction 3.2.0", - "solana-nonce 3.1.0", + "solana-fee-calculator 3.3.0", + "solana-instruction 3.5.1", + "solana-nonce 3.3.0", "solana-nonce-account", "solana-packet", "solana-program-runtime", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sdk-ids 3.1.0", "solana-svm-log-collector", - "solana-svm-type-overrides", - "solana-system-interface 3.1.0", - "solana-sysvar 3.1.1", + "solana-system-interface 3.3.0", + "solana-sysvar 4.2.0", "solana-transaction-context", ] @@ -6117,7 +6402,7 @@ dependencies = [ "solana-sdk-macro 2.2.1", "solana-slot-hashes 2.2.1", "solana-slot-history 2.2.1", - "solana-stake-interface 1.2.1", + "solana-stake-interface", "solana-sysvar-id 2.2.1", ] @@ -6135,31 +6420,31 @@ dependencies = [ "serde", "serde_derive", "solana-account-info 3.1.1", - "solana-clock 3.1.1", + "solana-clock 3.2.1", "solana-define-syscall 4.0.1", - "solana-epoch-rewards 3.0.1", - "solana-epoch-schedule 3.0.0", - "solana-fee-calculator 3.2.2", - "solana-hash 4.2.0", - "solana-instruction 3.2.0", - "solana-last-restart-slot 3.1.0", + "solana-epoch-rewards 3.2.0", + "solana-epoch-schedule 3.3.0", + "solana-fee-calculator 3.3.0", + "solana-hash 4.6.0", + "solana-instruction 3.5.1", + "solana-last-restart-slot 3.2.0", "solana-program-entrypoint 3.1.1", "solana-program-error 3.0.1", "solana-program-memory 3.1.0", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-rent 3.1.0", "solana-sdk-ids 3.1.0", "solana-sdk-macro 3.0.1", - "solana-slot-hashes 3.0.1", - "solana-slot-history 3.1.0", + "solana-slot-hashes 3.2.0", + "solana-slot-history 3.2.0", "solana-sysvar-id 3.1.0", ] [[package]] name = "solana-sysvar" -version = "4.0.0" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1632b69b4f72489db5949a10e8308c229dfa003f99ecaa7477b376807c7b81f4" +checksum = "0214d668b0aab7a64b49e43b7947307985fca4e03d3ef880cd8ee43f52f13a34" dependencies = [ "base64 0.22.1", "bincode", @@ -6169,24 +6454,27 @@ dependencies = [ "serde", "serde_derive", "solana-account-info 3.1.1", - "solana-clock 3.1.1", - "solana-define-syscall 5.1.0", - "solana-epoch-rewards 3.0.1", - "solana-epoch-schedule 3.0.0", - "solana-fee-calculator 3.2.2", - "solana-hash 4.2.0", - "solana-instruction 3.2.0", - "solana-last-restart-slot 3.1.0", + "solana-clock 3.2.1", + "solana-define-syscall 5.3.0", + "solana-epoch-rewards 3.2.0", + "solana-epoch-schedule 3.3.0", + "solana-fee-calculator 3.3.0", + "solana-get-sysvar", + "solana-hash 4.6.0", + "solana-instruction 3.5.1", + "solana-last-restart-slot 3.2.0", "solana-program-entrypoint 3.1.1", "solana-program-error 3.0.1", "solana-program-memory 3.1.0", - "solana-pubkey 4.1.0", - "solana-rent 4.3.0", + "solana-pubkey 4.3.0", + "solana-rent 4.4.0", "solana-sdk-ids 3.1.0", "solana-sdk-macro 3.0.1", - "solana-slot-hashes 3.0.1", - "solana-slot-history 3.1.0", + "solana-slot-hashes 3.2.0", + "solana-slot-history 3.2.0", + "solana-stake-history", "solana-sysvar-id 3.1.0", + "wincode", ] [[package]] @@ -6205,47 +6493,46 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17358d1e9a13e5b9c2264d301102126cf11a47fd394cdf3dec174fe7bc96e1de" dependencies = [ - "solana-address 2.6.1", + "solana-address 2.7.0", "solana-sdk-ids 3.1.0", ] [[package]] name = "solana-transaction" -version = "3.1.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96697cff5075a028265324255efed226099f6d761ca67342b230d09f72cc48d2" +checksum = "444a979f617ef7ed4e01aa228800df52d0af55f533e1840e8d48d468e607885f" dependencies = [ - "bincode", - "serde", - "serde_derive", - "solana-address 2.6.1", - "solana-hash 4.2.0", - "solana-instruction 3.2.0", + "solana-address 2.7.0", + "solana-hash 4.6.0", + "solana-instruction 3.5.1", "solana-instruction-error", - "solana-message 3.1.0", + "solana-message 4.6.0", "solana-sanitize 3.0.1", "solana-sdk-ids 3.1.0", - "solana-short-vec 3.2.2", - "solana-signature 3.3.0", - "solana-signer 3.0.0", - "solana-transaction-error 3.1.0", + "solana-short-vec 3.3.0", + "solana-signature 3.5.2", + "solana-signer 3.0.1", + "solana-transaction-error 3.4.0", + "wincode", ] [[package]] name = "solana-transaction-context" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecefe8b30e334e2891ca82da35becd9a3f4c16021d9ca782e2a82adf31084fa3" +checksum = "90ba8f4584068bd24a2ccb2a41a737f7e5c8ee752dc8dee2a7b1d0ee3e34d55b" dependencies = [ "bincode", "serde", - "solana-account 3.4.0", - "solana-instruction 3.2.0", - "solana-instructions-sysvar 3.0.0", - "solana-pubkey 4.1.0", - "solana-rent 3.1.0", + "solana-account 4.7.0", + "solana-instruction 3.5.1", + "solana-instructions-sysvar 4.0.0", + "solana-pubkey 4.3.0", + "solana-rent 4.4.0", "solana-sbpf", "solana-sdk-ids 3.1.0", + "wincode", ] [[package]] @@ -6260,12 +6547,10 @@ dependencies = [ [[package]] name = "solana-transaction-error" -version = "3.1.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8396904805b0b385b9de115a652fe80fd01e5b98ce0513f4fcd8184ada9bb792" +checksum = "8a37cf28c58b03878d38c38411f0414d3a99a9e3b7e5ebb0f83f3317b2796d18" dependencies = [ - "serde", - "serde_derive", "solana-instruction-error", "solana-sanitize 3.0.1", ] @@ -6296,9 +6581,9 @@ dependencies = [ [[package]] name = "solana-vote-interface" -version = "5.1.1" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d444ce30b6b4f9c281ba06061ea96638d063b53c2171b1e41ba02ebff79ed28f" +checksum = "c372a70d5c9738590f9762eb8bf01f7a794fdf0170ee5c1624df9a05e09603bc" dependencies = [ "bincode", "cfg_eval", @@ -6307,51 +6592,56 @@ dependencies = [ "serde", "serde_derive", "serde_with", - "solana-clock 3.1.1", - "solana-hash 4.2.0", - "solana-instruction 3.2.0", + "solana-clock 3.2.1", + "solana-hash 4.6.0", + "solana-instruction 3.5.1", "solana-instruction-error", - "solana-pubkey 4.1.0", - "solana-rent 4.3.0", + "solana-pubkey 4.3.0", + "solana-rent 4.4.0", "solana-sdk-ids 3.1.0", "solana-serde-varint 3.0.1", - "solana-serialize-utils 3.1.1", - "solana-short-vec 3.2.2", - "solana-system-interface 3.1.0", + "solana-serialize-utils 3.1.2", + "solana-short-vec 3.3.0", + "solana-system-interface 3.3.0", + "solana-wincode-varint", + "wincode", ] [[package]] name = "solana-vote-program" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4537fd6efe65f53ccd28d54d2ad43275b024834a4a8ca4dfa4babfa01e6d11ab" +checksum = "c08fc6f2691224d49e5c4bb98652bac1a7ed97f1f25e0c6092908d2cd543fd2b" dependencies = [ "agave-feature-set", "bincode", "log", - "num-derive 0.4.2", - "num-traits", - "serde", - "solana-account 3.4.0", + "solana-account 4.7.0", "solana-bincode 3.1.0", "solana-bls-signatures", - "solana-clock 3.1.1", - "solana-epoch-schedule 3.0.0", - "solana-hash 4.2.0", - "solana-instruction 3.2.0", - "solana-keypair", + "solana-clock 3.2.1", + "solana-epoch-schedule 3.3.0", + "solana-hash 4.6.0", + "solana-instruction 3.5.1", "solana-packet", "solana-program-runtime", - "solana-pubkey 4.1.0", - "solana-rent 3.1.0", + "solana-pubkey 4.3.0", + "solana-rent 4.4.0", "solana-sdk-ids 3.1.0", - "solana-signer 3.0.0", - "solana-slot-hashes 3.0.1", - "solana-system-interface 3.1.0", - "solana-transaction", + "solana-slot-hashes 3.2.0", + "solana-system-interface 3.3.0", "solana-transaction-context", - "solana-vote-interface 5.1.1", - "thiserror 2.0.18", + "solana-vote-interface 6.1.0", + "wincode", +] + +[[package]] +name = "solana-wincode-varint" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d15737770cec70afc784649526db191289e2b7ca988a878ed2d171f2cdd60b66" +dependencies = [ + "wincode", ] [[package]] @@ -6366,20 +6656,34 @@ dependencies = [ ] [[package]] -name = "solana-zk-elgamal-proof-program" -version = "4.0.0" +name = "solana-zk-elgamal-proof-interface" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdf97ec816e8c6d45b5f05e21381bcc4b856cb3c89b69e465ee20972368b4c31" +checksum = "d8da7f01db2148a1dc16261ff1dc6f3930a1e255a33cece4f1b56658694f27f7" dependencies = [ - "agave-feature-set", "bytemuck", + "bytemuck_derive", "num-derive 0.4.2", "num-traits", - "solana-instruction 3.2.0", + "solana-address 2.7.0", + "solana-instruction 3.5.1", + "solana-sdk-ids 3.1.0", + "solana-zk-sdk-pod", +] + +[[package]] +name = "solana-zk-elgamal-proof-program" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9ac53798348994c909d9913944a01d5c2e37881f4a28538da6ef057247a6885" +dependencies = [ + "bytemuck", + "solana-instruction 3.5.1", "solana-program-runtime", "solana-sdk-ids 3.1.0", "solana-svm-log-collector", - "solana-zk-sdk 5.0.1", + "solana-zk-elgamal-proof-interface", + "solana-zk-sdk 7.0.1", ] [[package]] @@ -6413,7 +6717,7 @@ dependencies = [ "solana-signature 2.3.0", "solana-signer 2.2.1", "subtle", - "thiserror 2.0.18", + "thiserror 2.0.21", "wasm-bindgen", "zeroize", ] @@ -6442,58 +6746,70 @@ dependencies = [ "serde_json", "sha3", "solana-derivation-path 3.0.0", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-pubkey 3.0.0", "solana-sdk-ids 3.1.0", "solana-seed-derivable 3.0.0", "solana-seed-phrase 3.0.0", - "solana-signature 3.3.0", - "solana-signer 3.0.0", + "solana-signature 3.5.2", + "solana-signer 3.0.1", "subtle", - "thiserror 2.0.18", + "thiserror 2.0.21", "wasm-bindgen", "zeroize", ] [[package]] name = "solana-zk-sdk" -version = "5.0.1" +version = "7.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09670ff59f60e6ddc2209c2e4353992a9b9f01d4e244f3e9d67bd5146e33d388" +checksum = "96cd8535d2f40d43a1d47af2849e1c86706a597a2ad84207441f51a50f09d8fd" dependencies = [ "aes-gcm-siv", "base64 0.22.1", "bincode", "bytemuck", - "bytemuck_derive", "curve25519-dalek", + "hkdf", "itertools 0.14.0", "merlin", - "num-derive 0.4.2", - "num-traits", "rand 0.8.6", "serde", "serde_derive", "serde_json", + "sha2 0.10.9", "sha3", - "solana-address 2.6.1", + "solana-address 2.7.0", "solana-derivation-path 3.0.0", - "solana-instruction 3.2.0", - "solana-sdk-ids 3.1.0", "solana-seed-derivable 3.0.0", "solana-seed-phrase 3.0.0", - "solana-signature 3.3.0", - "solana-signer 3.0.0", + "solana-signature 3.5.2", + "solana-signer 3.0.1", + "solana-zk-elgamal-proof-interface", + "solana-zk-sdk-pod", "subtle", - "thiserror 2.0.18", + "thiserror 2.0.21", "zeroize", ] +[[package]] +name = "solana-zk-sdk-pod" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a800583b7a4cea3e851686af162cc6e4712eef97fa91dfa9aca2459b95c84777" +dependencies = [ + "base64 0.22.1", + "bytemuck", + "bytemuck_derive", + "solana-nullable", + "thiserror 2.0.21", +] + [[package]] name = "solana-zk-token-proof-program" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f08a8be7008cec95d74c0ded5ae10b6869bd06bd9761c800e7e098bd45097e6" +checksum = "363190b5aedad14b5bc57b1095b06b0fd5e2a73923bc7708c422e727b9b1fdce" dependencies = [ "solana-program-runtime", ] @@ -6505,7 +6821,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der", + "der 0.7.10", +] + +[[package]] +name = "spki" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef958a98b9d5da290cfc78946e9f3e61e1e62a18db0d92cac0b83cc161491a9" +dependencies = [ + "base64ct", + "der 0.8.3", ] [[package]] @@ -6519,7 +6845,7 @@ dependencies = [ "num-traits", "solana-account-info 3.1.1", "solana-cpi 3.1.0", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-msg 3.1.0", "solana-program-entrypoint 3.1.1", "solana-program-error 3.0.1", @@ -6531,7 +6857,7 @@ dependencies = [ "spl-associated-token-account-interface", "spl-token-2022-interface", "spl-token-interface", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -6541,7 +6867,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6433917b60441d68d99a17e121d9db0ea15a9a69c0e5afa34649cf5ba12612f" dependencies = [ "borsh 1.7.0", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-pubkey 3.0.0", ] @@ -6609,7 +6935,7 @@ dependencies = [ "solana-program-option 2.2.1", "solana-pubkey 2.4.0", "solana-zk-sdk 2.3.13", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -6629,7 +6955,7 @@ dependencies = [ "solana-pubkey 3.0.0", "solana-zero-copy", "solana-zk-sdk 4.0.0", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -6657,7 +6983,7 @@ dependencies = [ "solana-msg 3.1.0", "solana-program-error 3.0.1", "spl-program-error-derive 0.6.0", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -6717,14 +7043,14 @@ dependencies = [ "num-traits", "num_enum", "solana-account-info 3.1.1", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-program-error 3.0.1", "solana-pubkey 3.0.0", "spl-discriminator 0.5.2", "spl-pod 0.7.3", "spl-program-error 0.8.0", "spl-type-length-value 0.9.1", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -6740,7 +7066,7 @@ dependencies = [ "num_enum", "solana-account-info 3.1.1", "solana-cpi 3.1.0", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-msg 3.1.0", "solana-program-entrypoint 3.1.1", "solana-program-error 3.0.1", @@ -6752,7 +7078,7 @@ dependencies = [ "solana-sdk-ids 3.1.0", "solana-sysvar 3.1.1", "spl-token-interface", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -6767,7 +7093,7 @@ dependencies = [ "num-traits", "num_enum", "solana-account-info 3.1.1", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-program-error 3.0.1", "solana-program-option 3.1.0", "solana-program-pack 3.1.0", @@ -6780,7 +7106,7 @@ dependencies = [ "spl-token-group-interface", "spl-token-metadata-interface", "spl-type-length-value 0.9.1", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -6792,7 +7118,7 @@ dependencies = [ "bytemuck", "solana-account-info 3.1.1", "solana-curve25519 3.1.14", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-instructions-sysvar 3.0.0", "solana-msg 3.1.0", "solana-program-error 3.0.1", @@ -6800,7 +7126,7 @@ dependencies = [ "solana-sdk-ids 3.1.0", "solana-zk-sdk 4.0.0", "spl-pod 0.7.3", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -6811,7 +7137,7 @@ checksum = "a0cd59fce3dc00f563c6fa364d67c3f200d278eae681f4dc250240afcfe044b1" dependencies = [ "curve25519-dalek", "solana-zk-sdk 4.0.0", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -6824,12 +7150,12 @@ dependencies = [ "num-derive 0.4.2", "num-traits", "num_enum", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-program-error 3.0.1", "solana-pubkey 3.0.0", "spl-discriminator 0.5.2", "spl-pod 0.7.3", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -6843,13 +7169,13 @@ dependencies = [ "num-derive 0.4.2", "num-traits", "num_enum", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-program-error 3.0.1", "solana-program-option 3.1.0", "solana-program-pack 3.1.0", "solana-pubkey 3.0.0", "solana-sdk-ids 3.1.0", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -6862,13 +7188,13 @@ dependencies = [ "num-derive 0.4.2", "num-traits", "solana-borsh 3.0.2", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-program-error 3.0.1", "solana-pubkey 3.0.0", "spl-discriminator 0.5.2", "spl-pod 0.7.3", "spl-type-length-value 0.9.1", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -6908,7 +7234,7 @@ dependencies = [ "num-traits", "solana-account-info 3.1.1", "solana-cpi 3.1.0", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-msg 3.1.0", "solana-program-error 3.0.1", "solana-pubkey 3.0.0", @@ -6919,7 +7245,7 @@ dependencies = [ "spl-program-error 0.8.0", "spl-tlv-account-resolution 0.11.1", "spl-type-length-value 0.9.1", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -6954,7 +7280,7 @@ dependencies = [ "solana-program-error 3.0.1", "solana-zero-copy", "spl-discriminator 0.5.2", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -6983,9 +7309,10 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -7010,6 +7337,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "3.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "tap" version = "1.0.1" @@ -7027,11 +7365,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.18" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" dependencies = [ - "thiserror-impl 2.0.18", + "thiserror-impl 2.0.21", ] [[package]] @@ -7047,13 +7385,13 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.18" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 3.0.9", ] [[package]] @@ -7088,9 +7426,10 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -7100,11 +7439,11 @@ dependencies = [ "borsh 1.7.0", "borsh-derive 1.7.0", "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", "spl-associated-token-account-interface", @@ -7119,11 +7458,11 @@ dependencies = [ "borsh 1.7.0", "borsh-derive 1.7.0", "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", "spl-token-2022-interface", @@ -7136,11 +7475,11 @@ dependencies = [ "borsh 1.7.0", "borsh-derive 1.7.0", "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", "spl-token-2022-interface", @@ -7153,11 +7492,11 @@ dependencies = [ "borsh 1.7.0", "borsh-derive 1.7.0", "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", "spl-token-2022-interface", @@ -7170,11 +7509,11 @@ dependencies = [ "borsh 1.7.0", "borsh-derive 1.7.0", "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", "spl-token-2022-interface", @@ -7188,9 +7527,10 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -7201,12 +7541,12 @@ dependencies = [ "borsh-derive 1.7.0", "litesvm", "mpl-token-metadata", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", "spl-associated-token-account-interface", @@ -7252,6 +7592,23 @@ dependencies = [ "winnow", ] +[[package]] +name = "transaction-v1-anchor-program" +version = "0.1.0" +dependencies = [ + "anchor-lang", + "anchor-v2-testing", + "borsh 1.7.0", + "solana-fee", + "solana-message 4.6.0", + "solana-native-token 3.0.0", + "solana-packet", + "solana-program-runtime", + "solana-transaction", + "solana-transaction-error 3.4.0", + "wincode", +] + [[package]] name = "transfer-fee" version = "0.1.0" @@ -7260,9 +7617,10 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -7273,12 +7631,13 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", + "solana-program-runtime", "spl-discriminator 0.4.1", "spl-tlv-account-resolution 0.9.0", "spl-transfer-hook-interface 0.9.0", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -7289,12 +7648,13 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", + "solana-program-runtime", "spl-discriminator 0.4.1", "spl-tlv-account-resolution 0.9.0", "spl-transfer-hook-interface 0.9.0", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -7305,12 +7665,13 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", + "solana-program-runtime", "spl-discriminator 0.4.1", "spl-tlv-account-resolution 0.9.0", "spl-transfer-hook-interface 0.9.0", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -7321,12 +7682,13 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", + "solana-program-runtime", "spl-discriminator 0.5.2", "spl-tlv-account-resolution 0.11.1", "spl-transfer-hook-interface 2.1.0", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -7337,12 +7699,13 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", + "solana-program-runtime", "spl-discriminator 0.4.1", "spl-tlv-account-resolution 0.9.0", "spl-transfer-hook-interface 0.9.0", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -7351,8 +7714,10 @@ version = "0.1.0" dependencies = [ "anchor-lang", "anchor-v2-testing", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -7362,10 +7727,10 @@ dependencies = [ "litesvm", "pinocchio 0.10.2", "pinocchio-system 0.5.0", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -7377,11 +7742,11 @@ dependencies = [ "borsh 1.7.0", "borsh-derive 1.7.0", "litesvm", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", ] @@ -7394,12 +7759,13 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", + "solana-program-runtime", "spl-discriminator 0.4.1", "spl-tlv-account-resolution 0.9.0", "spl-transfer-hook-interface 0.9.0", - "wincode 0.5.5", + "wincode", ] [[package]] @@ -7410,9 +7776,10 @@ dependencies = [ "anchor-spl", "anchor-v2-testing", "borsh 1.7.0", - "solana-address 2.6.1", + "solana-fee", "solana-kite", - "wincode 0.5.5", + "solana-program-runtime", + "wincode", ] [[package]] @@ -7423,12 +7790,12 @@ dependencies = [ "borsh-derive 1.7.0", "litesvm", "mpl-token-metadata", - "solana-instruction 3.2.0", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token 3.0.0", "solana-program 3.0.0", "solana-program 4.0.0", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", "spl-associated-token-account-interface", @@ -7594,35 +7961,23 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "wincode" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "657690780ce23e6f66576a782ffd88eb353512381817029cc1d7a99154bb6d1f" -dependencies = [ - "pastey", - "proc-macro2", - "quote", - "thiserror 2.0.18", - "wincode-derive", -] - -[[package]] -name = "wincode" -version = "0.5.5" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d967db7705dc29120bb6e8ce5b5a2e27734ed5976d1c904e95bd238d1c3c5a" +checksum = "063b5affe63fb4e584a33101d8808f01f2348b4f533db6223bf27263a0fdb9e9" dependencies = [ + "bv", "pastey", "proc-macro2", "quote", - "thiserror 2.0.18", + "thiserror 2.0.21", "wincode-derive", ] [[package]] name = "wincode-derive" -version = "0.4.6" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15ab90b719560d0fda79c74550ad1c948d17b118765942838055ebaf34d67071" +checksum = "11d582d9fc9d813264407a9e16bfa16846ccf15ef032f9bbcd700741bdc00255" dependencies = [ "darling", "proc-macro2", @@ -7651,6 +8006,18 @@ version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" +[[package]] +name = "wnaf" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "795ca18b3fdb5e62bf982199278341ddcf7ebf7d32e25e212ad05d496e95f6fa" +dependencies = [ + "ff 0.14.0", + "group 0.14.0", + "hybrid-array", + "primefield", +] + [[package]] name = "wyz" version = "0.5.1" diff --git a/Cargo.toml b/Cargo.toml index e1b8135d3..c6f046762 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,6 +60,7 @@ members = [ "basics/repository-layout/native/program", "basics/repository-layout/pinocchio/program", "basics/repository-layout/anchor/programs/*", + "basics/transaction-v1/anchor/programs/transaction-v1", "basics/transfer-sol/native/program", "basics/transfer-sol/pinocchio/program", "basics/transfer-sol/anchor/programs/*", @@ -143,7 +144,7 @@ overflow-checks = true # misc borsh = "1.6.1" borsh-derive = "1.5.7" -mpl-token-metadata = { version = "=5.1.2-alpha.2", features = [ "no-entrypoint" ] } +mpl-token-metadata = { version = "5.1.2-alpha.2", features = [ "no-entrypoint" ] } # spl @@ -165,10 +166,10 @@ pinocchio-system = "0.5.0" pinocchio-pubkey = "0.3.0" # testing -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" solana-native-token = "3.0.0" -solana-address = "2.6.0" +solana-address = "2.7" diff --git a/README.md b/README.md index c8a8f515f..a0df6f6ea 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ _The most complete and actvely maintained set of Solana programs ('smart contrac Each example is available in one or more of the following frameworks: - [⚓ Anchor v1](https://www.anchor-lang.com/) - the most popular framework for Solana development, in its current major version. Lives in `anchor-v1/`. Install with `avm install 1.2.1 && avm use 1.2.1`, build with `anchor build`, test with `anchor test`. -- [⚓ Anchor v2](https://www.anchor-lang.com/) - the next major version of Anchor, a ground-up rewrite that is not yet released. Lives in `anchor/`, alongside the v1 copy of the same example, and builds on the release candidate: install with `cargo install anchor-cli --version 2.0.0-rc.1 --locked`, then the same `anchor build` / `anchor test`. +- [⚓ Anchor v2](https://www.anchor-lang.com/) - the next major version of Anchor, a ground-up rewrite that is not yet released. Lives in `anchor/`, alongside the v1 copy of the same example, and builds on the release candidate: install with `cargo install anchor-cli --version 2.0.0-rc.2 --locked`, then the same `anchor build` / `anchor test`. - [💫 Quasar](https://quasar-lang.com/docs) - a newer, more performant framework with Anchor-compatible ergonomics. Build with `quasar build`, test with `quasar test`. - [🤥 Pinocchio](https://github.com/anza-xyz/pinocchio) - a zero-copy, zero-allocation library for Solana programs. Build with `cargo build-sbf --manifest-path=./program/Cargo.toml`, test with `cargo test --manifest-path=./program/Cargo.toml`. - [🦀 Native Rust](https://docs.anza.xyz/) - vanilla Rust using Solana's native crates. Build with `cargo build-sbf --manifest-path=./program/Cargo.toml`, test with `cargo test --manifest-path=./program/Cargo.toml`. @@ -195,7 +195,7 @@ Send SOL between two accounts. Store a 3,000 byte document in one instruction using Solana's v1 transaction format, live on mainnet since September 2026: 4,096 bytes instead of 1,232, and a transaction config in the message in place of ComputeBudget instructions. The program needs no change for v1; the LiteSVM tests are what build the v1 transactions, and they show the config fields one by one. -[⚓ Anchor v1](./basics/transaction-v1/anchor-v1) +[⚓ Anchor v1](./basics/transaction-v1/anchor-v1) [⚓ Anchor v2](./basics/transaction-v1/anchor) ### Pyth Price Feeds @@ -415,7 +415,7 @@ Start with the [escrow example](./finance/escrow/anchor/), the best first financ ### Do these examples work with Solana transaction v1? -Yes. The v1 format (4,096 byte transactions, live on mainnet since epoch 1035 on 15 September 2026) changes how a client builds a transaction, not what a program sees, so every program here can be called through v1 as is. Every Anchor v1 example's tests send their transactions as v1, through [solana-kite](https://crates.io/crates/solana-kite) 0.6, and the [transaction v1 example](./basics/transaction-v1/anchor-v1/) shows the config fields that replace ComputeBudget instructions. The Anchor v2 and Quasar tests still send legacy transactions, because their test harnesses run on virtual machines that predate v1. +Yes. The v1 format (4,096 byte transactions, live on mainnet since epoch 1035 on 15 September 2026) changes how a client builds a transaction, not what a program sees, so every program here can be called through v1 as is. Every Anchor v1 and Anchor v2 example's tests send their transactions as v1, through [solana-kite](https://crates.io/crates/solana-kite) (0.6 for Anchor v1, 0.7 for Anchor v2), and the transaction v1 example ([Anchor v1](./basics/transaction-v1/anchor-v1/), [Anchor v2](./basics/transaction-v1/anchor/)) shows the config fields that replace ComputeBudget instructions. The Quasar tests send no transactions at all: their harness runs each instruction directly, so the transaction format never comes up. ### How do I test a Solana program without running a validator? diff --git a/basics/account-data/anchor/README.md b/basics/account-data/anchor/README.md index cf47112f1..e6d66cf82 100644 --- a/basics/account-data/anchor/README.md +++ b/basics/account-data/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/basics/account-data/anchor/programs/anchor-program-example/Cargo.toml b/basics/account-data/anchor/programs/anchor-program-example/Cargo.toml index 9be646c7b..2d417b4ba 100644 --- a/basics/account-data/anchor/programs/anchor-program-example/Cargo.toml +++ b/basics/account-data/anchor/programs/anchor-program-example/Cargo.toml @@ -22,10 +22,10 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } +wincode = { version = "0.6", features = ["derive"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -42,9 +42,15 @@ wincode = { version = "0.5", features = ["derive"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" borsh = "1.6.1" -solana-kite = "0.4.0" +solana-kite = "0.7.0" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/basics/account-data/anchor/programs/anchor-program-example/tests/test_account_data.rs b/basics/account-data/anchor/programs/anchor-program-example/tests/test_account_data.rs index 2a41ec80d..b58af502e 100644 --- a/basics/account-data/anchor/programs/anchor-program-example/tests/test_account_data.rs +++ b/basics/account-data/anchor/programs/anchor-program-example/tests/test_account_data.rs @@ -2,7 +2,7 @@ use { anchor_lang::{ solana_program::instruction::Instruction, system_program, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{Keypair, Signer}, borsh::BorshDeserialize, solana_kite::{create_wallet, send_transaction_from_instructions}, }; @@ -49,6 +49,7 @@ fn test_create_address_info() { vec![instruction], &[&payer, &address_info_keypair], &payer.pubkey(), + None, ) .unwrap(); diff --git a/basics/account-data/native/program/Cargo.toml b/basics/account-data/native/program/Cargo.toml index bce18e24e..89d44bb8e 100644 --- a/basics/account-data/native/program/Cargo.toml +++ b/basics/account-data/native/program/Cargo.toml @@ -20,10 +20,10 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-keypair = "3.0.1" -solana-message = "4.0.0" +solana-message = "4.5" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" +solana-pubkey = "4.3" solana-signer = "3.0.0" -solana-transaction = "3.0.1" +solana-transaction = "4.2" diff --git a/basics/account-data/pinocchio/program/Cargo.toml b/basics/account-data/pinocchio/program/Cargo.toml index c01b9252f..eff9e3967 100644 --- a/basics/account-data/pinocchio/program/Cargo.toml +++ b/basics/account-data/pinocchio/program/Cargo.toml @@ -9,13 +9,13 @@ pinocchio-log.workspace = true pinocchio-system.workspace = true [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-keypair = "3.0.1" -solana-message = "4.0.0" +solana-message = "4.5" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" +solana-pubkey = "4.3" solana-signer = "3.0.0" -solana-transaction = "3.0.1" +solana-transaction = "4.2" solana-system-interface.workspace = true [lib] diff --git a/basics/checking-accounts/anchor/README.md b/basics/checking-accounts/anchor/README.md index 829401d5e..3e8205d0e 100644 --- a/basics/checking-accounts/anchor/README.md +++ b/basics/checking-accounts/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/basics/checking-accounts/anchor/programs/anchor-program-example/Cargo.toml b/basics/checking-accounts/anchor/programs/anchor-program-example/Cargo.toml index da8cedf37..8302b371f 100644 --- a/basics/checking-accounts/anchor/programs/anchor-program-example/Cargo.toml +++ b/basics/checking-accounts/anchor/programs/anchor-program-example/Cargo.toml @@ -22,10 +22,10 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } +wincode = { version = "0.6", features = ["derive"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -42,9 +42,15 @@ wincode = { version = "0.5", features = ["derive"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" borsh = "1.6.1" -solana-kite = "0.4.0" +solana-kite = "0.7.0" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/basics/checking-accounts/anchor/programs/anchor-program-example/tests/test_checking_accounts.rs b/basics/checking-accounts/anchor/programs/anchor-program-example/tests/test_checking_accounts.rs index dc1226e52..89a31774f 100644 --- a/basics/checking-accounts/anchor/programs/anchor-program-example/tests/test_checking_accounts.rs +++ b/basics/checking-accounts/anchor/programs/anchor-program-example/tests/test_checking_accounts.rs @@ -3,7 +3,7 @@ use { solana_program::{instruction::Instruction, system_instruction}, system_program, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{Keypair, Signer}, solana_kite::{create_wallet, send_transaction_from_instructions}, }; @@ -32,6 +32,7 @@ fn test_check_accounts() { vec![create_account_ix], &[&payer, &account_to_change], &payer.pubkey(), + None, ) .unwrap(); @@ -54,6 +55,7 @@ fn test_check_accounts() { vec![check_accounts_ix], &[&payer], &payer.pubkey(), + None, ) .unwrap(); } diff --git a/basics/checking-accounts/asm/Cargo.toml b/basics/checking-accounts/asm/Cargo.toml index 19349c560..9239236b3 100644 --- a/basics/checking-accounts/asm/Cargo.toml +++ b/basics/checking-accounts/asm/Cargo.toml @@ -7,12 +7,12 @@ edition = "2021" [dependencies] [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" solana-system-interface.workspace = true solana-transaction-error = "3.0.0" diff --git a/basics/checking-accounts/native/program/Cargo.toml b/basics/checking-accounts/native/program/Cargo.toml index 15f875b88..e2448a449 100644 --- a/basics/checking-accounts/native/program/Cargo.toml +++ b/basics/checking-accounts/native/program/Cargo.toml @@ -19,9 +19,9 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" diff --git a/basics/close-account/anchor/README.md b/basics/close-account/anchor/README.md index 533899a91..d00edcb0b 100644 --- a/basics/close-account/anchor/README.md +++ b/basics/close-account/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/basics/close-account/anchor/programs/close-account/Cargo.toml b/basics/close-account/anchor/programs/close-account/Cargo.toml index 0a98f07ac..215933097 100644 --- a/basics/close-account/anchor/programs/close-account/Cargo.toml +++ b/basics/close-account/anchor/programs/close-account/Cargo.toml @@ -22,16 +22,10 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. Both end up in the graph, and `Address`'s wincode impls -# then belong to the version the `#[account(borsh)]` derive is not using, so an -# `Address` field fails to satisfy `SchemaRead`/`SchemaWrite`. 2.6.1 is the last -# release on the 0.5 line. -solana-address = ">=2.6, <2.7" +wincode = { version = "0.6", features = ["derive"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -48,8 +42,14 @@ solana-address = ">=2.6, <2.7" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/basics/close-account/anchor/programs/close-account/tests/test_close_account.rs b/basics/close-account/anchor/programs/close-account/tests/test_close_account.rs index 844e06a95..cd90afa07 100644 --- a/basics/close-account/anchor/programs/close-account/tests/test_close_account.rs +++ b/basics/close-account/anchor/programs/close-account/tests/test_close_account.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{create_wallet, send_transaction_from_instructions}, }; @@ -39,7 +39,7 @@ fn test_create_and_close_user() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![create_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![create_ix], &[&payer], &payer.pubkey(), None) .unwrap(); // Verify account exists and has correct data @@ -60,7 +60,7 @@ fn test_create_and_close_user() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![close_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![close_ix], &[&payer], &payer.pubkey(), None) .unwrap(); // Verify account is closed diff --git a/basics/close-account/native/program/Cargo.toml b/basics/close-account/native/program/Cargo.toml index b70262cb6..d4db139d9 100644 --- a/basics/close-account/native/program/Cargo.toml +++ b/basics/close-account/native/program/Cargo.toml @@ -20,9 +20,9 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" diff --git a/basics/close-account/pinocchio/program/Cargo.toml b/basics/close-account/pinocchio/program/Cargo.toml index 6004cabcb..8c93d352a 100644 --- a/basics/close-account/pinocchio/program/Cargo.toml +++ b/basics/close-account/pinocchio/program/Cargo.toml @@ -10,13 +10,13 @@ pinocchio-pubkey.workspace = true pinocchio-system.workspace = true [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-keypair = "3.0.1" -solana-message = "4.0.0" +solana-message = "4.5" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" +solana-pubkey = "4.3" solana-signer = "3.0.0" -solana-transaction = "3.0.1" +solana-transaction = "4.2" solana-system-interface.workspace = true solana-instruction.workspace = true diff --git a/basics/counter/anchor/README.md b/basics/counter/anchor/README.md index 938a2454e..42bcac8c9 100644 --- a/basics/counter/anchor/README.md +++ b/basics/counter/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/basics/counter/anchor/programs/counter_anchor/Cargo.toml b/basics/counter/anchor/programs/counter_anchor/Cargo.toml index 19da071a5..36ae95b32 100644 --- a/basics/counter/anchor/programs/counter_anchor/Cargo.toml +++ b/basics/counter/anchor/programs/counter_anchor/Cargo.toml @@ -22,10 +22,10 @@ custom-heap = [] custom-panic = [] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } +wincode = { version = "0.6", features = ["derive"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -42,9 +42,15 @@ wincode = { version = "0.5", features = ["derive"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" borsh = "1.6.1" -solana-kite = "0.4.0" +solana-kite = "0.7.0" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/basics/counter/anchor/programs/counter_anchor/tests/test_counter.rs b/basics/counter/anchor/programs/counter_anchor/tests/test_counter.rs index 59698f033..16cf38470 100644 --- a/basics/counter/anchor/programs/counter_anchor/tests/test_counter.rs +++ b/basics/counter/anchor/programs/counter_anchor/tests/test_counter.rs @@ -2,7 +2,7 @@ use { anchor_lang::{ solana_program::instruction::Instruction, system_program, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, borsh::BorshDeserialize, solana_kite::{create_wallet, send_transaction_from_instructions}, }; @@ -50,6 +50,7 @@ fn test_initialize_counter() { vec![instruction], &[&payer, &counter_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -78,6 +79,7 @@ fn test_increment_counter() { vec![init_ix], &[&payer, &counter_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -90,7 +92,8 @@ fn test_increment_counter() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![inc_ix], &[&payer], &payer.pubkey()).unwrap(); + send_transaction_from_instructions(&mut svm, vec![inc_ix], &[&payer], &payer.pubkey(), None) + .unwrap(); let count = fetch_counter(&svm, &counter_keypair.pubkey()); assert_eq!(count, 1, "Expected count to be 1"); @@ -117,6 +120,7 @@ fn test_increment_counter_again() { vec![init_ix], &[&payer, &counter_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -130,8 +134,14 @@ fn test_increment_counter_again() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![inc_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![inc_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); svm.expire_blockhash(); } diff --git a/basics/counter/native/program/Cargo.toml b/basics/counter/native/program/Cargo.toml index 7ef94827e..abccb7fb1 100644 --- a/basics/counter/native/program/Cargo.toml +++ b/basics/counter/native/program/Cargo.toml @@ -22,11 +22,11 @@ solana-program.workspace = true unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" solana-rent = "4.1.0" solana-system-interface.workspace = true diff --git a/basics/counter/pinocchio/program/Cargo.toml b/basics/counter/pinocchio/program/Cargo.toml index 1aa72f3a5..171703794 100644 --- a/basics/counter/pinocchio/program/Cargo.toml +++ b/basics/counter/pinocchio/program/Cargo.toml @@ -22,11 +22,11 @@ pinocchio-pubkey.workspace = true unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" solana-rent = "4.1.0" solana-system-interface.workspace = true diff --git a/basics/create-account/anchor/README.md b/basics/create-account/anchor/README.md index 5986209b8..a462d9b35 100644 --- a/basics/create-account/anchor/README.md +++ b/basics/create-account/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/basics/create-account/anchor/programs/create-system-account/Cargo.toml b/basics/create-account/anchor/programs/create-system-account/Cargo.toml index 6db8fb0c6..7a47c7daa 100644 --- a/basics/create-account/anchor/programs/create-system-account/Cargo.toml +++ b/basics/create-account/anchor/programs/create-system-account/Cargo.toml @@ -22,10 +22,10 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } +wincode = { version = "0.6", features = ["derive"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -42,8 +42,14 @@ wincode = { version = "0.5", features = ["derive"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/basics/create-account/anchor/programs/create-system-account/tests/test_create_account.rs b/basics/create-account/anchor/programs/create-system-account/tests/test_create_account.rs index 8717a3e62..55d9d06cd 100644 --- a/basics/create-account/anchor/programs/create-system-account/tests/test_create_account.rs +++ b/basics/create-account/anchor/programs/create-system-account/tests/test_create_account.rs @@ -1,9 +1,8 @@ use { anchor_lang::{ - solana_program::{instruction::Instruction, rent::Rent}, - system_program, InstructionData, ToAccountMetas, + solana_program::instruction::Instruction, system_program, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{Keypair, Signer}, solana_kite::{create_wallet, send_transaction_from_instructions}, }; @@ -33,11 +32,14 @@ fn test_create_the_account() { vec![instruction], &[&payer, &new_account], &payer.pubkey(), + None, ) .unwrap(); - // Minimum balance for rent exemption for 0-data account - let lamports = Rent::default().minimum_balance(0); + // Minimum balance for rent exemption for a 0-data account, from the Rent + // sysvar the program reads rather than the SDK's default, which LiteSVM's + // rent no longer matches. + let lamports = svm.minimum_balance_for_rent_exemption(0); let account_info = svm.get_account(&new_account.pubkey()).unwrap(); assert_eq!(account_info.lamports, lamports); diff --git a/basics/create-account/asm/Cargo.toml b/basics/create-account/asm/Cargo.toml index b37de8565..a1fdc9636 100644 --- a/basics/create-account/asm/Cargo.toml +++ b/basics/create-account/asm/Cargo.toml @@ -7,12 +7,12 @@ edition = "2021" [dependencies] [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" solana-system-interface.workspace = true [features] diff --git a/basics/create-account/native/program/Cargo.toml b/basics/create-account/native/program/Cargo.toml index d4bfb87ca..8a5baaa9c 100644 --- a/basics/create-account/native/program/Cargo.toml +++ b/basics/create-account/native/program/Cargo.toml @@ -18,9 +18,9 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" diff --git a/basics/create-account/pinocchio/program/Cargo.toml b/basics/create-account/pinocchio/program/Cargo.toml index 6bd3c5392..4f3e3c240 100644 --- a/basics/create-account/pinocchio/program/Cargo.toml +++ b/basics/create-account/pinocchio/program/Cargo.toml @@ -20,10 +20,10 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" solana-system-interface.workspace = true diff --git a/basics/cross-program-invocation/anchor/README.md b/basics/cross-program-invocation/anchor/README.md index cd7b7fe51..36e2e0f8e 100644 --- a/basics/cross-program-invocation/anchor/README.md +++ b/basics/cross-program-invocation/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/basics/cross-program-invocation/anchor/programs/hand/Cargo.toml b/basics/cross-program-invocation/anchor/programs/hand/Cargo.toml index 4f727579c..54fbc367b 100644 --- a/basics/cross-program-invocation/anchor/programs/hand/Cargo.toml +++ b/basics/cross-program-invocation/anchor/programs/hand/Cargo.toml @@ -22,10 +22,10 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } +wincode = { version = "0.6", features = ["derive"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -42,8 +42,14 @@ wincode = { version = "0.5", features = ["derive"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/basics/cross-program-invocation/anchor/programs/hand/tests/test_hand.rs b/basics/cross-program-invocation/anchor/programs/hand/tests/test_hand.rs index a5e333b24..39c87a1b2 100644 --- a/basics/cross-program-invocation/anchor/programs/hand/tests/test_hand.rs +++ b/basics/cross-program-invocation/anchor/programs/hand/tests/test_hand.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::{AccountMeta, Instruction}, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{create_wallet, send_transaction_from_instructions}, }; @@ -68,6 +68,7 @@ fn test_pull_lever_cpi() { vec![init_ix], &[&payer, &power_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -91,7 +92,7 @@ fn test_pull_lever_cpi() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![pull_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![pull_ix], &[&payer], &payer.pubkey(), None) .unwrap(); // Verify power is now on @@ -114,7 +115,7 @@ fn test_pull_lever_cpi() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![pull_ix2], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![pull_ix2], &[&payer], &payer.pubkey(), None) .unwrap(); // Verify power is now off again diff --git a/basics/cross-program-invocation/anchor/programs/lever/Cargo.toml b/basics/cross-program-invocation/anchor/programs/lever/Cargo.toml index a5cdf4b92..f729a33a3 100644 --- a/basics/cross-program-invocation/anchor/programs/lever/Cargo.toml +++ b/basics/cross-program-invocation/anchor/programs/lever/Cargo.toml @@ -22,10 +22,10 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } +wincode = { version = "0.6", features = ["derive"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -42,8 +42,14 @@ wincode = { version = "0.5", features = ["derive"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/basics/cross-program-invocation/anchor/programs/lever/tests/test_lever.rs b/basics/cross-program-invocation/anchor/programs/lever/tests/test_lever.rs index 38ca75616..9db7e4f90 100644 --- a/basics/cross-program-invocation/anchor/programs/lever/tests/test_lever.rs +++ b/basics/cross-program-invocation/anchor/programs/lever/tests/test_lever.rs @@ -2,7 +2,7 @@ use { anchor_lang::{ solana_program::instruction::Instruction, system_program, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{create_wallet, send_transaction_from_instructions}, }; @@ -39,6 +39,7 @@ fn test_initialize_lever() { vec![instruction], &[&payer, &power_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -74,6 +75,7 @@ fn test_switch_power() { vec![init_ix], &[&payer, &power_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -90,7 +92,7 @@ fn test_switch_power() { .to_account_metas(None), ); svm.expire_blockhash(); - send_transaction_from_instructions(&mut svm, vec![switch_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![switch_ix], &[&payer], &payer.pubkey(), None) .unwrap(); assert!( @@ -111,8 +113,14 @@ fn test_switch_power() { .to_account_metas(None), ); svm.expire_blockhash(); - send_transaction_from_instructions(&mut svm, vec![switch_ix2], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![switch_ix2], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); assert!( !read_power_is_on(&svm, &power_keypair.pubkey()), diff --git a/basics/cross-program-invocation/native/programs/hand/Cargo.toml b/basics/cross-program-invocation/native/programs/hand/Cargo.toml index 49c445556..744e393f4 100644 --- a/basics/cross-program-invocation/native/programs/hand/Cargo.toml +++ b/basics/cross-program-invocation/native/programs/hand/Cargo.toml @@ -19,12 +19,18 @@ cross-program-invocatio-native-lever = { path = "../lever", features = ["cpi"] } crate-type = ["cdylib", "lib"] [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" solana-system-interface = {version = "2.0.0", features = ["bincode"]} [lints.rust] diff --git a/basics/cross-program-invocation/pinocchio/programs/lever/Cargo.toml b/basics/cross-program-invocation/pinocchio/programs/lever/Cargo.toml index 2c4d1283a..ad8e4504c 100644 --- a/basics/cross-program-invocation/pinocchio/programs/lever/Cargo.toml +++ b/basics/cross-program-invocation/pinocchio/programs/lever/Cargo.toml @@ -20,10 +20,10 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" solana-system-interface.workspace = true diff --git a/basics/favorites/anchor/README.md b/basics/favorites/anchor/README.md index 2ff9e9c97..30713c938 100644 --- a/basics/favorites/anchor/README.md +++ b/basics/favorites/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/basics/favorites/anchor/programs/favorites/Cargo.toml b/basics/favorites/anchor/programs/favorites/Cargo.toml index 83a6e9a57..59f50ced0 100644 --- a/basics/favorites/anchor/programs/favorites/Cargo.toml +++ b/basics/favorites/anchor/programs/favorites/Cargo.toml @@ -22,10 +22,10 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } +wincode = { version = "0.6", features = ["derive"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -42,8 +42,14 @@ wincode = { version = "0.5", features = ["derive"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/basics/favorites/anchor/programs/favorites/tests/test_favorites.rs b/basics/favorites/anchor/programs/favorites/tests/test_favorites.rs index 48b64f75a..aeb8dcca1 100644 --- a/basics/favorites/anchor/programs/favorites/tests/test_favorites.rs +++ b/basics/favorites/anchor/programs/favorites/tests/test_favorites.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Signer}, solana_kite::{create_wallet, send_transaction_from_instructions}, }; @@ -88,8 +88,14 @@ fn test_set_favorites() { .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![instruction], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![instruction], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); let data = read_favorites(&svm, &pda); assert_eq!(data.number, 23); @@ -122,8 +128,14 @@ fn test_update_favorites() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![instruction], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![instruction], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); // Update favorites with new hobbies svm.expire_blockhash(); @@ -147,7 +159,7 @@ fn test_update_favorites() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![update_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![update_ix], &[&payer], &payer.pubkey(), None) .unwrap(); let data = read_favorites(&svm, &pda); diff --git a/basics/favorites/native/program/Cargo.toml b/basics/favorites/native/program/Cargo.toml index eccc472c4..d5cc79ad2 100644 --- a/basics/favorites/native/program/Cargo.toml +++ b/basics/favorites/native/program/Cargo.toml @@ -20,9 +20,9 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" diff --git a/basics/favorites/pinocchio/program/Cargo.toml b/basics/favorites/pinocchio/program/Cargo.toml index c8a43e791..84782e380 100644 --- a/basics/favorites/pinocchio/program/Cargo.toml +++ b/basics/favorites/pinocchio/program/Cargo.toml @@ -21,10 +21,10 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" solana-system-interface.workspace = true diff --git a/basics/hello-solana/anchor/README.md b/basics/hello-solana/anchor/README.md index 35e2643a7..d72f6c066 100644 --- a/basics/hello-solana/anchor/README.md +++ b/basics/hello-solana/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/basics/hello-solana/anchor/programs/hello-solana/Cargo.toml b/basics/hello-solana/anchor/programs/hello-solana/Cargo.toml index f1c2a1ffa..95c90a607 100644 --- a/basics/hello-solana/anchor/programs/hello-solana/Cargo.toml +++ b/basics/hello-solana/anchor/programs/hello-solana/Cargo.toml @@ -22,10 +22,10 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } +wincode = { version = "0.6", features = ["derive"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -42,9 +42,17 @@ wincode = { version = "0.5", features = ["derive"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" -solana-transaction = "3.0.1" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" +# The named limit for the one transaction the test builds itself. Same version +# solana-kite 0.7 builds against. +solana-compute-budget = "4.3" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/basics/hello-solana/anchor/programs/hello-solana/tests/test_hello.rs b/basics/hello-solana/anchor/programs/hello-solana/tests/test_hello.rs index 615095ab1..e8f05e51f 100644 --- a/basics/hello-solana/anchor/programs/hello-solana/tests/test_hello.rs +++ b/basics/hello-solana/anchor/programs/hello-solana/tests/test_hello.rs @@ -1,8 +1,8 @@ use { anchor_lang::{solana_program::instruction::Instruction, InstructionData, ToAccountMetas}, - anchor_v2_testing::{LiteSVM, Signer}, - solana_kite::create_wallet, - solana_transaction::Transaction, + anchor_v2_testing::{litesvm::LiteSVM, Signer}, + solana_compute_budget::compute_budget_limits::MAX_COMPUTE_UNIT_LIMIT, + solana_kite::{build_transaction_from_instructions, create_wallet, get_transaction_config}, }; #[test] @@ -21,13 +21,16 @@ fn test_say_hello() { // The program only logs; assert it emitted its greeting rather than merely // that the transaction landed. kite's send helper discards the metadata, so - // send through LiteSVM directly to read the logs. - let transaction = Transaction::new_signed_with_payer( + // build the transaction with kite and send it through LiteSVM directly to + // read the logs. + let transaction = build_transaction_from_instructions( + &svm, &[instruction], - Some(&payer.pubkey()), &[&payer], - svm.latest_blockhash(), - ); + &payer.pubkey(), + get_transaction_config(MAX_COMPUTE_UNIT_LIMIT), + ) + .unwrap(); let metadata = svm.send_transaction(transaction).unwrap(); assert!( diff --git a/basics/hello-solana/native/program/Cargo.toml b/basics/hello-solana/native/program/Cargo.toml index c70558e7b..dfe1ba45b 100644 --- a/basics/hello-solana/native/program/Cargo.toml +++ b/basics/hello-solana/native/program/Cargo.toml @@ -17,9 +17,9 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" diff --git a/basics/pda-rent-payer/anchor/README.md b/basics/pda-rent-payer/anchor/README.md index 022a62e51..dacfabc0c 100644 --- a/basics/pda-rent-payer/anchor/README.md +++ b/basics/pda-rent-payer/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/basics/pda-rent-payer/anchor/programs/anchor-program-example/Cargo.toml b/basics/pda-rent-payer/anchor/programs/anchor-program-example/Cargo.toml index 0f331645a..331c38b1d 100644 --- a/basics/pda-rent-payer/anchor/programs/anchor-program-example/Cargo.toml +++ b/basics/pda-rent-payer/anchor/programs/anchor-program-example/Cargo.toml @@ -22,10 +22,10 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } +wincode = { version = "0.6", features = ["derive"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -42,8 +42,14 @@ wincode = { version = "0.5", features = ["derive"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/basics/pda-rent-payer/anchor/programs/anchor-program-example/tests/test_pda_rent_payer.rs b/basics/pda-rent-payer/anchor/programs/anchor-program-example/tests/test_pda_rent_payer.rs index 357672709..3af7f07d3 100644 --- a/basics/pda-rent-payer/anchor/programs/anchor-program-example/tests/test_pda_rent_payer.rs +++ b/basics/pda-rent-payer/anchor/programs/anchor-program-example/tests/test_pda_rent_payer.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{create_wallet, send_transaction_from_instructions}, }; @@ -38,7 +38,7 @@ fn test_init_rent_vault() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![init_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![init_ix], &[&payer], &payer.pubkey(), None) .unwrap(); // Verify the rent vault has the correct balance @@ -73,7 +73,7 @@ fn test_create_new_account_from_rent_vault() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![init_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![init_ix], &[&payer], &payer.pubkey(), None) .unwrap(); svm.expire_blockhash(); @@ -95,6 +95,7 @@ fn test_create_new_account_from_rent_vault() { vec![create_ix], &[&payer, &new_account], &payer.pubkey(), + None, ) .unwrap(); diff --git a/basics/processing-instructions/anchor/README.md b/basics/processing-instructions/anchor/README.md index 645f60503..e9e7f4965 100644 --- a/basics/processing-instructions/anchor/README.md +++ b/basics/processing-instructions/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/basics/processing-instructions/anchor/programs/processing-instructions/Cargo.toml b/basics/processing-instructions/anchor/programs/processing-instructions/Cargo.toml index e95846e35..ce397b3e5 100644 --- a/basics/processing-instructions/anchor/programs/processing-instructions/Cargo.toml +++ b/basics/processing-instructions/anchor/programs/processing-instructions/Cargo.toml @@ -22,10 +22,10 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } +wincode = { version = "0.6", features = ["derive"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -42,8 +42,14 @@ wincode = { version = "0.5", features = ["derive"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/basics/processing-instructions/anchor/programs/processing-instructions/tests/test_processing_instructions.rs b/basics/processing-instructions/anchor/programs/processing-instructions/tests/test_processing_instructions.rs index 541771b1b..337180ab9 100644 --- a/basics/processing-instructions/anchor/programs/processing-instructions/tests/test_processing_instructions.rs +++ b/basics/processing-instructions/anchor/programs/processing-instructions/tests/test_processing_instructions.rs @@ -1,6 +1,6 @@ use { anchor_lang::{solana_program::instruction::Instruction, InstructionData, ToAccountMetas}, - anchor_v2_testing::{LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Signer}, solana_kite::{create_wallet, send_transaction_from_instructions}, }; @@ -28,7 +28,7 @@ fn test_go_to_park() { .data(), processing_instructions::accounts::ParkAccountConstraints {}.to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![ix_short], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![ix_short], &[&payer], &payer.pubkey(), None) .unwrap(); svm.expire_blockhash(); @@ -43,6 +43,6 @@ fn test_go_to_park() { .data(), processing_instructions::accounts::ParkAccountConstraints {}.to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![ix_tall], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![ix_tall], &[&payer], &payer.pubkey(), None) .unwrap(); } diff --git a/basics/processing-instructions/native/program/Cargo.toml b/basics/processing-instructions/native/program/Cargo.toml index fa18be459..767eaaad8 100644 --- a/basics/processing-instructions/native/program/Cargo.toml +++ b/basics/processing-instructions/native/program/Cargo.toml @@ -19,9 +19,9 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" solana-native-token = "3.0.0" diff --git a/basics/processing-instructions/pinocchio/program/Cargo.toml b/basics/processing-instructions/pinocchio/program/Cargo.toml index 92d714da8..4b97687de 100644 --- a/basics/processing-instructions/pinocchio/program/Cargo.toml +++ b/basics/processing-instructions/pinocchio/program/Cargo.toml @@ -18,9 +18,9 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" solana-native-token = "3.0.0" diff --git a/basics/program-derived-addresses/anchor/README.md b/basics/program-derived-addresses/anchor/README.md index 77d8eb011..0416cc847 100644 --- a/basics/program-derived-addresses/anchor/README.md +++ b/basics/program-derived-addresses/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/basics/program-derived-addresses/anchor/programs/anchor-program-example/Cargo.toml b/basics/program-derived-addresses/anchor/programs/anchor-program-example/Cargo.toml index f823437eb..ef81052a3 100644 --- a/basics/program-derived-addresses/anchor/programs/anchor-program-example/Cargo.toml +++ b/basics/program-derived-addresses/anchor/programs/anchor-program-example/Cargo.toml @@ -22,10 +22,10 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } +wincode = { version = "0.6", features = ["derive"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -42,9 +42,15 @@ wincode = { version = "0.5", features = ["derive"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" borsh = "1.6.1" -solana-kite = "0.4.0" +solana-kite = "0.7.0" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/basics/program-derived-addresses/anchor/programs/anchor-program-example/tests/test_program_derived_addresses.rs b/basics/program-derived-addresses/anchor/programs/anchor-program-example/tests/test_program_derived_addresses.rs index 67637369f..02a1895f7 100644 --- a/basics/program-derived-addresses/anchor/programs/anchor-program-example/tests/test_program_derived_addresses.rs +++ b/basics/program-derived-addresses/anchor/programs/anchor-program-example/tests/test_program_derived_addresses.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Signer}, borsh::BorshDeserialize, solana_kite::{create_wallet, send_transaction_from_instructions}, }; @@ -47,7 +47,7 @@ fn test_create_and_increment_page_visits() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![create_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![create_ix], &[&payer], &payer.pubkey(), None) .unwrap(); // Verify initial state (page_visits = 0) @@ -67,8 +67,14 @@ fn test_create_and_increment_page_visits() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![increment_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![increment_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); // Verify page_visits = 1 let account = svm.get_account(&page_visits_pda).expect("PDA should exist"); @@ -90,8 +96,14 @@ fn test_create_and_increment_page_visits() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![increment_ix2], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![increment_ix2], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); // Verify page_visits = 2 let account = svm.get_account(&page_visits_pda).expect("PDA should exist"); diff --git a/basics/program-derived-addresses/native/program/Cargo.toml b/basics/program-derived-addresses/native/program/Cargo.toml index 5b8c0b2c4..db5081923 100644 --- a/basics/program-derived-addresses/native/program/Cargo.toml +++ b/basics/program-derived-addresses/native/program/Cargo.toml @@ -20,10 +20,10 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" solana-native-token = "3.0.0" solana-rent = "4.1.0" diff --git a/basics/program-derived-addresses/pinocchio/program/Cargo.toml b/basics/program-derived-addresses/pinocchio/program/Cargo.toml index bc7ebe0bc..9c59eb832 100644 --- a/basics/program-derived-addresses/pinocchio/program/Cargo.toml +++ b/basics/program-derived-addresses/pinocchio/program/Cargo.toml @@ -19,11 +19,11 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" solana-native-token = "3.0.0" solana-rent = "4.1.0" solana-system-interface.workspace = true diff --git a/basics/pyth/anchor/README.md b/basics/pyth/anchor/README.md index 6961fec61..c14269bfc 100644 --- a/basics/pyth/anchor/README.md +++ b/basics/pyth/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). @@ -13,7 +13,7 @@ See also: [Pyth overview](../README.md) and the [repository catalog](../../../RE > [!NOTE] > **This example vendors the `PriceUpdateV2` account type rather than importing `pyth-solana-receiver-sdk`.** > -> The SDK's current release (2.0.0, checked August 2026) builds against `anchor-lang` 1.0.2, and this repository is on 2.0.0-rc.1, whose account wrappers are a different set of types. Importing the SDK's `PriceUpdateV2` would pull a second `anchor-lang` into the graph. +> The SDK's current release (2.0.0, checked August 2026) builds against `anchor-lang` 1.0.2, and this repository is on 2.0.0-rc.2, whose account wrappers are a different set of types. Importing the SDK's `PriceUpdateV2` would pull a second `anchor-lang` into the graph. > > `programs/pythexample/src/lib.rs` mirrors the onchain layout instead: same fields in the same order, same 8-byte discriminator, owned by the Pyth Receiver program, so accounts written by Pyth deserialize unchanged. Import the SDK type once a release targeting `anchor-lang` 2.x ships. diff --git a/basics/pyth/anchor/programs/pythexample/Cargo.toml b/basics/pyth/anchor/programs/pythexample/Cargo.toml index c4ca98719..a61ca9ca5 100644 --- a/basics/pyth/anchor/programs/pythexample/Cargo.toml +++ b/basics/pyth/anchor/programs/pythexample/Cargo.toml @@ -23,14 +23,10 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6, which splits `Address`'s wincode impls across two -# incompatible trait versions. 2.6.1 is the last release on the 0.5 line. -solana-address = ">=2.6, <2.7" +wincode = { version = "0.6", features = ["derive"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -47,18 +43,24 @@ solana-address = ">=2.6, <2.7" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" # Self-dependency with no-entrypoint: host test builds otherwise export a # #[no_mangle] `entrypoint` symbol from this crate AND from spl-token (via # solana-kite), and the linker rejects the duplicate. The SBF build # (cargo build-sbf) ignores dev-dependencies, so the deployed program keeps # its entrypoint. pythexample = { path = ".", features = ["no-entrypoint"] } -solana-account = "3.0.0" +solana-account = "4.3" solana-clock = "3.0.1" borsh = "1.6.1" sha2 = "0.10" -solana-kite = "0.4.0" +solana-kite = "0.7.0" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/basics/pyth/anchor/programs/pythexample/src/lib.rs b/basics/pyth/anchor/programs/pythexample/src/lib.rs index 1c663bb77..15b96395b 100644 --- a/basics/pyth/anchor/programs/pythexample/src/lib.rs +++ b/basics/pyth/anchor/programs/pythexample/src/lib.rs @@ -59,7 +59,7 @@ pub struct ReadPriceAccountConstraints { // Pyth `PriceUpdateV2` account, vendored from `pyth-solana-receiver-sdk`. // // The SDK's current release (2.0.0, checked August 2026) builds against -// `anchor-lang` 1.0.2, and this repository is on 2.0.0-rc.1, whose account +// `anchor-lang` 1.0.2, and this repository is on 2.0.0-rc.2, whose account // wrappers are a different set of types. Importing the SDK's `PriceUpdateV2` // would pull a second `anchor-lang` into the graph. // @@ -69,7 +69,7 @@ pub struct ReadPriceAccountConstraints { // release targeting `anchor-lang` 2.x ships. // --------------------------------------------------------------------------- -#[derive(Clone, Debug, PartialEq, Eq, wincode::SchemaRead, wincode::SchemaWrite)] +#[derive(Clone, Debug, PartialEq, Eq, IdlType, wincode::SchemaRead, wincode::SchemaWrite)] pub enum VerificationLevel { /// Partially verified: only `num_signatures` of the Pyth guardian set's /// signatures were checked, fewer than its quorum of three of five. @@ -78,7 +78,7 @@ pub enum VerificationLevel { Full, } -#[derive(Clone, Debug, PartialEq, Eq, wincode::SchemaRead, wincode::SchemaWrite)] +#[derive(Clone, Debug, PartialEq, Eq, IdlType, wincode::SchemaRead, wincode::SchemaWrite)] pub struct PriceFeedMessage { pub feed_id: [u8; 32], pub price: i64, @@ -90,7 +90,7 @@ pub struct PriceFeedMessage { pub ema_conf: u64, } -#[derive(Clone, Debug, PartialEq, Eq, wincode::SchemaRead, wincode::SchemaWrite)] +#[derive(Clone, Debug, PartialEq, Eq, IdlType, wincode::SchemaRead, wincode::SchemaWrite)] pub struct PriceUpdateV2 { pub write_authority: Address, pub verification_level: VerificationLevel, diff --git a/basics/pyth/anchor/programs/pythexample/tests/test_pyth.rs b/basics/pyth/anchor/programs/pythexample/tests/test_pyth.rs index acd4fb66a..40b4a7bfa 100644 --- a/basics/pyth/anchor/programs/pythexample/tests/test_pyth.rs +++ b/basics/pyth/anchor/programs/pythexample/tests/test_pyth.rs @@ -2,7 +2,7 @@ use { anchor_lang::{ solana_program::instruction::Instruction, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, pythexample::MAXIMUM_PRICE_AGE_SECONDS, // LiteSVM's get_sysvar wants the host-side Clock, not pinocchio's. solana_clock::Clock, @@ -123,8 +123,14 @@ fn test_read_price() { set_clock_to_price_age(&mut svm, MAXIMUM_PRICE_AGE_SECONDS); let instruction = read_price_instruction(price_update_key.pubkey()); - send_transaction_from_instructions(&mut svm, vec![instruction], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![instruction], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); } #[test] @@ -135,8 +141,13 @@ fn test_read_price_rejects_stale_price() { set_clock_to_price_age(&mut svm, MAXIMUM_PRICE_AGE_SECONDS + 1); let instruction = read_price_instruction(price_update_key.pubkey()); - let result = - send_transaction_from_instructions(&mut svm, vec![instruction], &[&payer], &payer.pubkey()); + let result = send_transaction_from_instructions( + &mut svm, + vec![instruction], + &[&payer], + &payer.pubkey(), + None, + ); assert!(result.is_err(), "a stale price update must be rejected"); } @@ -151,8 +162,13 @@ fn test_read_price_rejects_wrong_owner() { set_clock_to_price_age(&mut svm, 0); let instruction = read_price_instruction(price_update_key.pubkey()); - let result = - send_transaction_from_instructions(&mut svm, vec![instruction], &[&payer], &payer.pubkey()); + let result = send_transaction_from_instructions( + &mut svm, + vec![instruction], + &[&payer], + &payer.pubkey(), + None, + ); assert!( result.is_err(), "a price account not owned by the Pyth Receiver must be rejected" diff --git a/basics/realloc/anchor/README.md b/basics/realloc/anchor/README.md index b8e471634..fa2d0a3ee 100644 --- a/basics/realloc/anchor/README.md +++ b/basics/realloc/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/basics/realloc/anchor/programs/anchor-realloc/Cargo.toml b/basics/realloc/anchor/programs/anchor-realloc/Cargo.toml index 01dc83f12..908925c66 100644 --- a/basics/realloc/anchor/programs/anchor-realloc/Cargo.toml +++ b/basics/realloc/anchor/programs/anchor-realloc/Cargo.toml @@ -22,10 +22,10 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } +wincode = { version = "0.6", features = ["derive"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -42,9 +42,15 @@ wincode = { version = "0.5", features = ["derive"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" borsh = "1.6.1" -solana-kite = "0.4.0" +solana-kite = "0.7.0" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/basics/realloc/anchor/programs/anchor-realloc/tests/test_realloc.rs b/basics/realloc/anchor/programs/anchor-realloc/tests/test_realloc.rs index 2ad901bf5..3d08144c6 100644 --- a/basics/realloc/anchor/programs/anchor-realloc/tests/test_realloc.rs +++ b/basics/realloc/anchor/programs/anchor-realloc/tests/test_realloc.rs @@ -2,7 +2,7 @@ use { anchor_lang::{ solana_program::instruction::Instruction, system_program, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, borsh::BorshDeserialize, solana_kite::{create_wallet, send_transaction_from_instructions}, }; @@ -48,6 +48,7 @@ fn test_initialize() { vec![instruction], &[&payer, &message_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -88,6 +89,7 @@ fn test_update_grows() { vec![init_ix], &[&payer, &message_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -106,7 +108,7 @@ fn test_update_grows() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![update_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![update_ix], &[&payer], &payer.pubkey(), None) .unwrap(); let msg_text = fetch_message(&svm, &message_keypair.pubkey()); @@ -145,6 +147,7 @@ fn test_update_shrinks() { vec![init_ix], &[&payer, &message_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -163,7 +166,7 @@ fn test_update_shrinks() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![update_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![update_ix], &[&payer], &payer.pubkey(), None) .unwrap(); let msg_text = fetch_message(&svm, &message_keypair.pubkey()); diff --git a/basics/realloc/native/program/Cargo.toml b/basics/realloc/native/program/Cargo.toml index 637e84541..b08e4b73c 100644 --- a/basics/realloc/native/program/Cargo.toml +++ b/basics/realloc/native/program/Cargo.toml @@ -20,9 +20,9 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" diff --git a/basics/realloc/pinocchio/program/Cargo.toml b/basics/realloc/pinocchio/program/Cargo.toml index 1d1ee718a..7a2df922b 100644 --- a/basics/realloc/pinocchio/program/Cargo.toml +++ b/basics/realloc/pinocchio/program/Cargo.toml @@ -20,10 +20,10 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" solana-system-interface.workspace = true diff --git a/basics/rent/anchor/README.md b/basics/rent/anchor/README.md index 67eabe7b0..dd33fe4f7 100644 --- a/basics/rent/anchor/README.md +++ b/basics/rent/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/basics/rent/anchor/programs/rent-example/Cargo.toml b/basics/rent/anchor/programs/rent-example/Cargo.toml index 3c7b871b6..6d2d5cb04 100644 --- a/basics/rent/anchor/programs/rent-example/Cargo.toml +++ b/basics/rent/anchor/programs/rent-example/Cargo.toml @@ -22,10 +22,10 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } +wincode = { version = "0.6", features = ["derive"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -42,8 +42,14 @@ wincode = { version = "0.5", features = ["derive"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/basics/rent/anchor/programs/rent-example/tests/test_rent.rs b/basics/rent/anchor/programs/rent-example/tests/test_rent.rs index deb13f057..81aae2f8e 100644 --- a/basics/rent/anchor/programs/rent-example/tests/test_rent.rs +++ b/basics/rent/anchor/programs/rent-example/tests/test_rent.rs @@ -2,7 +2,7 @@ use { anchor_lang::{ solana_program::instruction::Instruction, system_program, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{Keypair, Signer}, solana_kite::{create_wallet, send_transaction_from_instructions}, }; @@ -43,6 +43,7 @@ fn test_create_system_account() { vec![instruction], &[&payer, &new_account], &payer.pubkey(), + None, ) .unwrap(); diff --git a/basics/rent/native/program/Cargo.toml b/basics/rent/native/program/Cargo.toml index 2a19b2224..1e6d199ab 100644 --- a/basics/rent/native/program/Cargo.toml +++ b/basics/rent/native/program/Cargo.toml @@ -20,10 +20,10 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" +solana-pubkey = "4.3" solana-rent = "4.1.0" -solana-transaction = "3.0.1" +solana-transaction = "4.2" diff --git a/basics/rent/pinocchio/program/Cargo.toml b/basics/rent/pinocchio/program/Cargo.toml index 45b51e345..141b02bfb 100644 --- a/basics/rent/pinocchio/program/Cargo.toml +++ b/basics/rent/pinocchio/program/Cargo.toml @@ -19,11 +19,11 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" +solana-pubkey = "4.3" solana-rent = "4.1.0" -solana-transaction = "3.0.1" +solana-transaction = "4.2" solana-system-interface .workspace = true diff --git a/basics/repository-layout/anchor/README.md b/basics/repository-layout/anchor/README.md index 7cf34f996..b71da90e3 100644 --- a/basics/repository-layout/anchor/README.md +++ b/basics/repository-layout/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/basics/repository-layout/anchor/programs/carnival/Cargo.toml b/basics/repository-layout/anchor/programs/carnival/Cargo.toml index 295cb1eea..0f4ad9a2c 100644 --- a/basics/repository-layout/anchor/programs/carnival/Cargo.toml +++ b/basics/repository-layout/anchor/programs/carnival/Cargo.toml @@ -22,10 +22,10 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } +wincode = { version = "0.6", features = ["derive"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -42,8 +42,14 @@ wincode = { version = "0.5", features = ["derive"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/basics/repository-layout/anchor/programs/carnival/tests/test_carnival.rs b/basics/repository-layout/anchor/programs/carnival/tests/test_carnival.rs index f62972024..19ffcd977 100644 --- a/basics/repository-layout/anchor/programs/carnival/tests/test_carnival.rs +++ b/basics/repository-layout/anchor/programs/carnival/tests/test_carnival.rs @@ -1,6 +1,6 @@ use { anchor_lang::{solana_program::instruction::Instruction, InstructionData, ToAccountMetas}, - anchor_v2_testing::{LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Signer}, solana_kite::{create_wallet, send_transaction_from_instructions}, }; @@ -88,7 +88,8 @@ fn test_go_on_ride_succeeds() { // Scrambler costs 3 tickets and requires 48" min height; Alice has 15 // tickets and is 56" tall. let ix = go_on_ride_ix(&payer, "Alice", 56, 15, "Scrambler"); - send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey()).unwrap(); + send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey(), None) + .unwrap(); } // Insufficient tickets must produce a real error (NotEnoughTickets), not a @@ -98,7 +99,8 @@ fn test_go_on_ride_rejects_insufficient_tickets() { let (mut svm, payer) = setup(); // Tilt-a-Whirl costs 3 tickets; Bob only has 1. let ix = go_on_ride_ix(&payer, "Bob", 49, 1, "Tilt-a-Whirl"); - let result = send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey()); + let result = + send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey(), None); assert!(result.is_err(), "ride must reject insufficient tickets"); } @@ -109,7 +111,8 @@ fn test_go_on_ride_rejects_too_short() { // Ferris Wheel requires 55" min height; Jimmy is 36" tall but has plenty // of tickets. let ix = go_on_ride_ix(&payer, "Jimmy", 36, 15, "Ferris Wheel"); - let result = send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey()); + let result = + send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey(), None); assert!(result.is_err(), "ride must reject riders below min height"); } @@ -118,7 +121,8 @@ fn test_go_on_ride_rejects_too_short() { fn test_go_on_ride_rejects_unknown_ride() { let (mut svm, payer) = setup(); let ix = go_on_ride_ix(&payer, "Alice", 60, 100, "Quantum Coaster"); - let result = send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey()); + let result = + send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey(), None); assert!(result.is_err(), "unknown ride must be rejected"); } @@ -127,7 +131,8 @@ fn test_play_game_succeeds() { let (mut svm, payer) = setup(); // Ring Toss costs 3 tickets; Alice has 15. let ix = play_game_ix(&payer, "Alice", 15, "Ring Toss"); - send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey()).unwrap(); + send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey(), None) + .unwrap(); } #[test] @@ -135,7 +140,8 @@ fn test_play_game_rejects_insufficient_tickets() { let (mut svm, payer) = setup(); // Ring Toss costs 3 tickets; Mary only has 1. let ix = play_game_ix(&payer, "Mary", 1, "Ring Toss"); - let result = send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey()); + let result = + send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey(), None); assert!(result.is_err(), "game must reject insufficient tickets"); } @@ -144,7 +150,8 @@ fn test_eat_food_succeeds() { let (mut svm, payer) = setup(); // Dough Boy's costs 1 ticket; Bob has 6. let ix = eat_food_ix(&payer, "Bob", 6, "Dough Boy's"); - send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey()).unwrap(); + send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey(), None) + .unwrap(); } #[test] @@ -152,7 +159,8 @@ fn test_eat_food_rejects_insufficient_tickets() { let (mut svm, payer) = setup(); // Larry's Pizza costs 3 tickets; Mary has 1. let ix = eat_food_ix(&payer, "Mary", 1, "Larry's Pizza"); - let result = send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey()); + let result = + send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey(), None); assert!( result.is_err(), "food stand must reject insufficient tickets" diff --git a/basics/repository-layout/native/program/Cargo.toml b/basics/repository-layout/native/program/Cargo.toml index c9df69d94..232bf4574 100644 --- a/basics/repository-layout/native/program/Cargo.toml +++ b/basics/repository-layout/native/program/Cargo.toml @@ -19,9 +19,9 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" diff --git a/basics/repository-layout/pinocchio/program/Cargo.toml b/basics/repository-layout/pinocchio/program/Cargo.toml index 6a2254fbb..f926f1ef7 100644 --- a/basics/repository-layout/pinocchio/program/Cargo.toml +++ b/basics/repository-layout/pinocchio/program/Cargo.toml @@ -18,9 +18,9 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" solana-native-token = "3.0.0" diff --git a/basics/transaction-v1/anchor-v1/README.md b/basics/transaction-v1/anchor-v1/README.md index 477d32e68..f49630c98 100644 --- a/basics/transaction-v1/anchor-v1/README.md +++ b/basics/transaction-v1/anchor-v1/README.md @@ -2,8 +2,8 @@ > [!NOTE] > This example is on Anchor 1.2.1, the current stable Anchor release. Every `anchor` -> command on this page needs the v1 CLI: `avm install 1.2.1 && avm use 1.2.1`. There is -> no Anchor v2 copy yet: Anchor v2's test harness runs on a LiteSVM that predates v1. +> command on this page needs the v1 CLI: `avm install 1.2.1 && avm use 1.2.1`. The +> Anchor v2 version of this example is in [`../anchor`](../anchor/). A Solana transaction v1 example: a program that stores a 3,000 byte document in a single [instruction](https://solana.com/docs/references/terminology#instruction), which only fits inside the v1 [transaction](https://solana.com/docs/references/terminology#transaction) format (4,096 bytes, up from the 1,232 bytes of legacy and v0 transactions). Nothing in the program is specific to v1: an Anchor program reads its accounts and instruction data the same way whichever format carried them, and no Anchor change is needed to be called through v1. The tests are where v1 shows up, because the client builds the transaction. diff --git a/basics/transaction-v1/anchor/.gitignore b/basics/transaction-v1/anchor/.gitignore new file mode 100644 index 000000000..d243ecc13 --- /dev/null +++ b/basics/transaction-v1/anchor/.gitignore @@ -0,0 +1,7 @@ + +.anchor +.DS_Store +target +**/*.rs.bk +node_modules +test-ledger diff --git a/basics/transaction-v1/anchor/.prettierignore b/basics/transaction-v1/anchor/.prettierignore new file mode 100644 index 000000000..c1a0b75f0 --- /dev/null +++ b/basics/transaction-v1/anchor/.prettierignore @@ -0,0 +1,8 @@ + +.anchor +.DS_Store +target +node_modules +dist +build +test-ledger diff --git a/basics/transaction-v1/anchor/Anchor.toml b/basics/transaction-v1/anchor/Anchor.toml new file mode 100644 index 000000000..bc8a85099 --- /dev/null +++ b/basics/transaction-v1/anchor/Anchor.toml @@ -0,0 +1,18 @@ +[toolchain] +# Match the repo package manager (pnpm-lock.yaml at root); avoids Anchor's yarn default. +package_manager = "pnpm" +solana_version = "3.1.8" + +[features] +seeds = false +skip-lint = false + +[programs.localnet] +transaction_v1_anchor_program = "G2RNhZWhh8f3jjY9Z6CQyztFR6PGC5iM8yrbNEjvSuKa" + +[provider] +cluster = "Localnet" +wallet = "~/.config/solana/id.json" + +[scripts] +test = "cargo test" diff --git a/basics/transaction-v1/anchor/CHANGELOG.md b/basics/transaction-v1/anchor/CHANGELOG.md new file mode 100644 index 000000000..c29644afa --- /dev/null +++ b/basics/transaction-v1/anchor/CHANGELOG.md @@ -0,0 +1,9 @@ +# Changelog + +## 2026-10-28 + +Added: the Anchor v2 copy of this example, on Anchor 2.0.0-rc.2. The program +moves to Anchor v2's API (`&mut Context`, `BorshAccount`, `Signer` and +`Program` without lifetimes) and the tests to Anchor v2's LiteSVM harness, whose +`v2.0.0-rc.2` revision runs LiteSVM 0.18. The tests are otherwise the Anchor v1 +copy's. diff --git a/basics/transaction-v1/anchor/Cargo.toml b/basics/transaction-v1/anchor/Cargo.toml new file mode 100644 index 000000000..f39770481 --- /dev/null +++ b/basics/transaction-v1/anchor/Cargo.toml @@ -0,0 +1,14 @@ +[workspace] +members = [ + "programs/*" +] +resolver = "2" + +[profile.release] +overflow-checks = true +lto = "fat" +codegen-units = 1 +[profile.release.build-override] +opt-level = 3 +incremental = false +codegen-units = 1 diff --git a/basics/transaction-v1/anchor/README.md b/basics/transaction-v1/anchor/README.md new file mode 100644 index 000000000..90270966c --- /dev/null +++ b/basics/transaction-v1/anchor/README.md @@ -0,0 +1,56 @@ +# Solana Transaction v1 (Anchor) + +> [!NOTE] +> This is the **Anchor v2** copy of this example. Every `anchor` command on this page +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has +> no prebuilt binary for this pre-release). The Anchor v1 version of this example is in +> [`../anchor-v1`](../anchor-v1/). + +A Solana transaction v1 example: a program that stores a 3,000 byte document in a single [instruction](https://solana.com/docs/references/terminology#instruction), which only fits inside the v1 [transaction](https://solana.com/docs/references/terminology#transaction) format (4,096 bytes, up from the 1,232 bytes of legacy and v0 transactions). Nothing in the program is specific to v1: an Anchor program reads its accounts and instruction data the same way whichever format carried them, and no Anchor change is needed to be called through v1. The tests are where v1 shows up, because the client builds the transaction. + +See also: the [repository catalog](../../../README.md). + +## Major concepts + +**What v1 changes for the transaction.** The size limit rises from 1,232 to 4,096 bytes, which is what makes this example possible. The resource limits that legacy and v0 transactions set with ComputeBudget program instructions (compute unit limit, priority fee, loaded-accounts data size limit, heap size) move into a `TransactionConfig` in the message header, and any ComputeBudget instructions in a v1 transaction are ignored. The priority fee becomes a total in lamports rather than a price per compute unit. Unset config fields mean zero, not "use the default", so every v1 transaction has to set its compute unit limit and its loaded-accounts data size limit explicitly. The signatures move to the end of the wire format, so the first byte is the message version (`0x81` for v1). Address lookup tables are not supported: a transaction that needs them stays on v0. + +**What v1 changes for the program.** Nothing. The 3,000 byte document arrives as the `document: Vec` argument exactly as a 300 byte one would. + +**The document account.** `Document`, a [PDA](https://solana.com/docs/references/terminology#program-derived-account-pda) with seeds `["document", payer]`, one per payer. It is a `#[account(borsh)]` account, held in a `BorshAccount`, because Anchor v2's default zero-copy accounts cannot hold a variable-length `Vec`. There is no `InitSpace`: `Document::required_space` sizes the account to each document (discriminator, borsh length prefix, bytes), and the payer pays that [rent](https://solana.com/docs/references/terminology#rent). + +## Lifecycle + +A payer signs a transaction carrying one `store_document` instruction with the document as its argument. The `StoreDocumentAccountConstraints` `init` constraint creates the PDA sized to the document and the handler rejects an empty document (`DocumentError::EmptyDocument`) before copying it in. + +## Setup + +From this directory (`basics/transaction-v1/anchor/`): + +```bash +anchor build +``` + +Prerequisites: [Agave](https://docs.anza.xyz/) CLI (version in `Anchor.toml` `[toolchain]`; the LiteSVM tests carry their own v1-capable runtime, so the CLI version does not matter to them), [Anchor](https://www.anchor-lang.com/docs) v2. + +The program is also a member of the repository root workspace, which is what `cargo fmt` and `cargo clippy` see. + +## Testing + +Tests run in-process with [LiteSVM](https://www.anchor-lang.com/docs/testing/litesvm). No local validator. + +```bash +anchor test +``` + +This runs `cargo test` as configured in `Anchor.toml`. The tests run on Anchor v2's own harness, `anchor-v2-testing`, pinned to the revision of the `v2.0.0-rc.2` tag. That revision is the first on LiteSVM 0.18, which executes v1 transactions (LiteSVM 0.16.0 was the first release that could). This example builds its transactions by hand. Every other Anchor v2 example sends v1 transactions too, through [solana-kite](https://crates.io/crates/solana-kite) 0.7, which sets the compute unit and loaded-accounts data size limits for them; this one sets each config field itself to show what they do. The suite covers: + +- `stores_a_document_too_large_for_a_legacy_transaction`: a 3,000 byte document in a v1 transaction. The test measures the transaction on the wire (over 1,232 bytes, at most 4,096) and reads the document back from the PDA. +- `a_legacy_transaction_still_works_for_a_small_document`: the same instruction with a 500 byte document, sent as a legacy transaction. The program did not change. +- `the_transaction_config_replaces_compute_budget_instructions`: a v1 transaction with a priority fee in the config. The payer is charged exactly rent plus the base fee plus that priority fee, and the wire format starts with the v1 version byte. +- `unset_config_fields_mean_zero_not_the_default`: an empty config fails before the program runs (zero bytes of account data may be loaded), and a config with only the data size limit fails on the program's first instruction (zero compute units). + +LiteSVM does not enforce either size limit (a validator's packet layer does), which is why the size tests check the serialized transaction themselves. + +## Sending v1 transactions to a real cluster + +The v1 format is live on mainnet beta since epoch 1035 (15 September 2026), and on devnet and testnet, behind the `enable_tx_v1` feature gate (`txv1aq4pp281K9um3tnPgkfX8UqtFT6wcVW3hNezGLL`). Sending one needs Agave 4.2 or later client crates and, on the RPC side, `maxSupportedTransactionVersion: 1` on every `getTransaction`, `getBlock` and `blockSubscribe` call, plus `encoding: "base64"` when sending, since base58 encoding stops at 1,232 bytes. Anchor v2's TypeScript client (`@anchor-lang/core` 2.0.0-rc.2) is built on `@solana/kit` 8, the first release line that can build v1 transactions. A v1 transaction can also be built in Rust, as in the tests here. diff --git a/basics/transaction-v1/anchor/programs/transaction-v1/Cargo.toml b/basics/transaction-v1/anchor/programs/transaction-v1/Cargo.toml new file mode 100644 index 000000000..c249e20c2 --- /dev/null +++ b/basics/transaction-v1/anchor/programs/transaction-v1/Cargo.toml @@ -0,0 +1,76 @@ +[package] +name = "transaction-v1-anchor-program" +version = "0.1.0" +description = "Created with Anchor" +edition = "2021" + +[lib] +crate-type = ["cdylib", "lib"] +name = "transaction_v1_anchor_program" + +[features] +default = [] +cpi = ["no-entrypoint"] +no-entrypoint = [] +no-idl = [] +no-log-ix-name = [] +# Forwards to the harness so `anchor test --profile` can turn tracing on. +profile = ["anchor-v2-testing/profile"] +idl-build = ["anchor-lang/idl-build"] +anchor-debug = [] +custom-heap = [] +custom-panic = [] + +[dependencies] +anchor-lang = "2.0.0-rc.2" +# The `#[program]` macro expands to `wincode` paths for instruction-data +# (de)serialization, so the crate has to be a direct dependency. The tests +# also use it as the SDK's serializer: `wincode::serialize` on a +# `VersionedTransaction` gives the exact bytes that would go over the wire, +# which is how they measure transaction size. +wincode = { version = "0.6", features = ["derive"] } + +[dev-dependencies] +# Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the +# `profile` feature is on, when it also records the SBF register traces that +# `anchor test --profile`, `anchor debugger` and `anchor coverage` read. Tests +# that call `LiteSVM::new()` directly still pass but produce no traces, so +# those three tools see nothing. +# +# It is published only from git: crates.io has no `anchor-v2-testing`. Pinned +# to a revision rather than tracking `anchor-next`, so a CI run cannot change +# behaviour because upstream moved between builds. +# +# Bump the rev deliberately, never automatically: `anchor-next` is where v2 +# development happens, so a later revision can carry breakage as easily as +# fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for +# an ordinary version. +# +# This revision runs on LiteSVM 0.18, which executes v1 transactions: it reads +# the compute unit limit, priority fee, loaded-accounts data size limit and +# heap size from the message's transaction config rather than from +# ComputeBudget instructions. +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +borsh = "1.6.1" +# The other Anchor v2 examples send v1 transactions through solana-kite 0.7. +# This example builds its own, to show each config field. +# +# `solana_message::v1` (the v1 message, `TransactionConfig` and the 4,096 +# byte `MAX_TRANSACTION_SIZE`). The harness re-exports `VersionedMessage` but +# not the `v1` module. +solana-message = "4.5" +solana-native-token = "3.0" +# `PACKET_DATA_SIZE`, the 1,232 byte limit legacy and v0 transactions keep. +solana-packet = "4.2" +# The legacy `Transaction`, which the harness does not re-export. +solana-transaction = "4.2" +solana-transaction-error = "3.4" + +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/basics/transaction-v1/anchor/programs/transaction-v1/Xargo.toml b/basics/transaction-v1/anchor/programs/transaction-v1/Xargo.toml new file mode 100644 index 000000000..475fb71ed --- /dev/null +++ b/basics/transaction-v1/anchor/programs/transaction-v1/Xargo.toml @@ -0,0 +1,2 @@ +[target.bpfel-unknown-unknown.dependencies.std] +features = [] diff --git a/basics/transaction-v1/anchor/programs/transaction-v1/src/instructions/mod.rs b/basics/transaction-v1/anchor/programs/transaction-v1/src/instructions/mod.rs new file mode 100644 index 000000000..89cbfd5e6 --- /dev/null +++ b/basics/transaction-v1/anchor/programs/transaction-v1/src/instructions/mod.rs @@ -0,0 +1,3 @@ +pub mod store; + +pub use store::*; diff --git a/basics/transaction-v1/anchor/programs/transaction-v1/src/instructions/store.rs b/basics/transaction-v1/anchor/programs/transaction-v1/src/instructions/store.rs new file mode 100644 index 000000000..337709a4b --- /dev/null +++ b/basics/transaction-v1/anchor/programs/transaction-v1/src/instructions/store.rs @@ -0,0 +1,37 @@ +// v2's `#[derive(Accounts)]` binds the `#[instruction(...)]` args in more +// than one generated item, and only the one evaluating the constraints below +// reads them, so the binding looks unused to rustc even though `space` uses it. +#![allow(unused_variables)] + +use crate::{state::Document, DocumentError}; +use anchor_lang::prelude::*; + +#[derive(Accounts)] +#[instruction(document: Vec)] +pub struct StoreDocumentAccountConstraints { + #[account(mut)] + pub payer: Signer, + + /// Sized to this document exactly, so the rent matches what was stored. + #[account( + init, + payer = payer, + space = Document::required_space(document.len()), + seeds = [ + Document::SEED_PREFIX, + payer.address().as_ref(), + ], + bump, + )] + pub document_account: BorshAccount, + pub system_program: Program, +} + +pub fn handle_store_document( + context: &mut Context, + document: Vec, +) -> Result<()> { + require!(!document.is_empty(), DocumentError::EmptyDocument); + context.accounts.document_account.data = document; + Ok(()) +} diff --git a/basics/transaction-v1/anchor/programs/transaction-v1/src/lib.rs b/basics/transaction-v1/anchor/programs/transaction-v1/src/lib.rs new file mode 100644 index 000000000..8e2087f92 --- /dev/null +++ b/basics/transaction-v1/anchor/programs/transaction-v1/src/lib.rs @@ -0,0 +1,35 @@ +//! Store a document of arbitrary size in a program-owned account, in one +//! instruction. +//! +//! The program itself has nothing to do with transaction v1: it reads the +//! accounts and instruction data it is given like any other program, and does +//! not know or care which transaction format carried them. What v1 changes is +//! how much a single instruction can carry: a 3,000 byte document is beyond +//! the 1,232 byte limit of a legacy or v0 transaction, so the tests send it +//! in a v1 transaction (up to 4,096 bytes) instead. + +use anchor_lang::prelude::*; +use instructions::*; + +pub mod instructions; +pub mod state; + +declare_id!("G2RNhZWhh8f3jjY9Z6CQyztFR6PGC5iM8yrbNEjvSuKa"); + +#[program] +pub mod transaction_v1_anchor_program { + use super::*; + + pub fn store_document( + context: &mut Context, + document: Vec, + ) -> Result<()> { + store::handle_store_document(context, document) + } +} + +#[error_code] +pub enum DocumentError { + #[msg("A document cannot be empty")] + EmptyDocument, +} diff --git a/basics/transaction-v1/anchor/programs/transaction-v1/src/state/document.rs b/basics/transaction-v1/anchor/programs/transaction-v1/src/state/document.rs new file mode 100644 index 000000000..c50974930 --- /dev/null +++ b/basics/transaction-v1/anchor/programs/transaction-v1/src/state/document.rs @@ -0,0 +1,18 @@ +use anchor_lang::prelude::*; + +// There is deliberately no `InitSpace` here: the account is sized to each +// document rather than to a compile-time maximum. `borsh` keeps the +// variable-length `Vec`, which a zero-copy account cannot hold. +#[account(borsh)] +pub struct Document { + pub data: Vec, +} + +impl Document { + pub const SEED_PREFIX: &'static [u8; 8] = b"document"; + + /// Discriminator, then the borsh length prefix, then the bytes. + pub fn required_space(document_len: usize) -> usize { + Self::DISCRIMINATOR.len() + 4 + document_len + } +} diff --git a/basics/transaction-v1/anchor/programs/transaction-v1/src/state/mod.rs b/basics/transaction-v1/anchor/programs/transaction-v1/src/state/mod.rs new file mode 100644 index 000000000..d0889e2ad --- /dev/null +++ b/basics/transaction-v1/anchor/programs/transaction-v1/src/state/mod.rs @@ -0,0 +1,3 @@ +pub mod document; + +pub use document::*; diff --git a/basics/transaction-v1/anchor/programs/transaction-v1/tests/test_transaction_v1.rs b/basics/transaction-v1/anchor/programs/transaction-v1/tests/test_transaction_v1.rs new file mode 100644 index 000000000..46a51a731 --- /dev/null +++ b/basics/transaction-v1/anchor/programs/transaction-v1/tests/test_transaction_v1.rs @@ -0,0 +1,245 @@ +//! The program is exercised with both transaction formats: legacy for a small +//! document, v1 for one that would never fit in 1,232 bytes. The v1 tests also +//! cover the part of the format that is easy to get wrong: the transaction +//! config that replaces ComputeBudget instructions, whose unset fields mean +//! zero rather than "use the default". + +use { + anchor_lang::{ + prelude::Address, solana_program::instruction::Instruction, system_program, + InstructionData, ToAccountMetas, + }, + anchor_v2_testing::{ + litesvm::LiteSVM, Keypair, Signer, VersionedMessage, VersionedTransaction, + }, + borsh::BorshDeserialize, + solana_message::v1, + solana_native_token::LAMPORTS_PER_SOL, + solana_packet::PACKET_DATA_SIZE, + solana_transaction::Transaction, + solana_transaction_error::TransactionError, + transaction_v1_anchor_program::state::Document, +}; + +/// What LiteSVM charges per signature, and what mainnet has charged since +/// genesis. +const BASE_FEE_LAMPORTS: u64 = 5_000; + +/// Enough for the account creation and the copy. Unlike a legacy transaction, +/// a v1 transaction has no 200,000 CU default to fall back on: leaving the +/// limit unset means zero. +const COMPUTE_UNIT_LIMIT: u32 = 50_000; + +/// The payer, the new account, the system program and the program itself +/// together load well under 64 KiB. Like the compute unit limit, this defaults +/// to zero when unset. +const LOADED_ACCOUNTS_DATA_SIZE_LIMIT: u32 = 64 * 1024; + +/// A v1 transaction's config carries the resource limits that legacy and v0 +/// transactions express with ComputeBudget program instructions. Every test +/// that expects to succeed starts from this one. +fn transaction_config() -> v1::TransactionConfig { + v1::TransactionConfig::empty() + .with_compute_unit_limit(COMPUTE_UNIT_LIMIT) + .with_loaded_accounts_data_size_limit(LOADED_ACCOUNTS_DATA_SIZE_LIMIT) +} + +/// The account as Anchor lays it out: discriminator, then the borsh `Vec`. +#[derive(BorshDeserialize)] +struct DocumentAccount { + _discriminator: [u8; 8], + data: Vec, +} + +fn setup() -> (LiteSVM, Address, Keypair) { + let program_id = transaction_v1_anchor_program::id(); + let mut svm = anchor_v2_testing::svm(); + let program_bytes = include_bytes!("../../../target/deploy/transaction_v1_anchor_program.so"); + svm.add_program(program_id, program_bytes).unwrap(); + + let payer = Keypair::new(); + svm.airdrop(&payer.pubkey(), 10 * LAMPORTS_PER_SOL).unwrap(); + (svm, program_id, payer) +} + +/// The instruction and the PDA it will create. +fn store_document( + program_id: &Address, + payer: &Address, + document: &[u8], +) -> (Instruction, Address) { + let (document_address, _bump) = + Address::find_program_address(&[Document::SEED_PREFIX, payer.as_ref()], program_id); + let instruction = Instruction::new_with_bytes( + *program_id, + &transaction_v1_anchor_program::instruction::StoreDocument { + document: document.to_vec(), + } + .data(), + transaction_v1_anchor_program::accounts::StoreDocumentAccountConstraints { + payer: *payer, + document_account: document_address, + system_program: system_program::ID, + } + .to_account_metas(None), + ); + (instruction, document_address) +} + +/// Compile a v1 message and sign it. `try_compile_with_config` is the v1 +/// counterpart of `Message::new_with_blockhash`; the config rides in the +/// message header, so there is no ComputeBudget instruction to append. +fn build_v1_transaction( + svm: &LiteSVM, + payer: &Keypair, + instructions: &[Instruction], + config: v1::TransactionConfig, +) -> VersionedTransaction { + let message = v1::Message::try_compile_with_config( + &payer.pubkey(), + instructions, + svm.latest_blockhash(), + config, + ) + .unwrap(); + VersionedTransaction::try_new(VersionedMessage::V1(message), &[payer]).unwrap() +} + +/// The bytes that would be sent to an RPC node. +fn wire_size(transaction: &VersionedTransaction) -> usize { + wincode::serialize(transaction).unwrap().len() +} + +/// The largest prime below 256: the byte pattern repeats every 251 bytes, a +/// period no power-of-two offset lines up with. +const SAMPLE_DOCUMENT_PATTERN_LENGTH: usize = 251; + +/// A document with a recognizable pattern, so a partial or shifted copy +/// would not pass the equality check. +fn sample_document(length: usize) -> Vec { + (0..length) + .map(|index| (index % SAMPLE_DOCUMENT_PATTERN_LENGTH) as u8) + .collect() +} + +fn stored_document(svm: &LiteSVM, document_address: &Address) -> Vec { + let account = svm.get_account(document_address).unwrap(); + DocumentAccount::try_from_slice(&account.data).unwrap().data +} + +#[test] +fn stores_a_document_too_large_for_a_legacy_transaction() { + let (mut svm, program_id, payer) = setup(); + let document = sample_document(3_000); + let (instruction, document_address) = store_document(&program_id, &payer.pubkey(), &document); + + let transaction = build_v1_transaction(&svm, &payer, &[instruction], transaction_config()); + + // Over the legacy limit, under the v1 one. LiteSVM does not enforce either + // (a validator's packet layer does), so the test checks the size itself. + let size = wire_size(&transaction); + assert!( + size > PACKET_DATA_SIZE, + "{size} bytes fits a legacy transaction" + ); + assert!( + size <= v1::MAX_TRANSACTION_SIZE, + "{size} bytes is over the v1 limit" + ); + + svm.send_transaction(transaction).unwrap(); + + let account = svm.get_account(&document_address).unwrap(); + assert_eq!(account.owner, program_id); + assert_eq!(account.data.len(), Document::required_space(document.len())); + assert_eq!(stored_document(&svm, &document_address), document); +} + +#[test] +fn a_legacy_transaction_still_works_for_a_small_document() { + let (mut svm, program_id, payer) = setup(); + let document = sample_document(500); + let (instruction, document_address) = store_document(&program_id, &payer.pubkey(), &document); + + // Nothing about the program changed: the same instruction goes through the + // legacy format when it fits. + let transaction = Transaction::new_signed_with_payer( + &[instruction], + Some(&payer.pubkey()), + &[&payer], + svm.latest_blockhash(), + ); + assert!(wire_size(&VersionedTransaction::from(transaction.clone())) <= PACKET_DATA_SIZE); + + svm.send_transaction(transaction).unwrap(); + + assert_eq!(stored_document(&svm, &document_address), document); +} + +#[test] +fn the_transaction_config_replaces_compute_budget_instructions() { + let (mut svm, program_id, payer) = setup(); + let document = sample_document(3_000); + let (instruction, _) = store_document(&program_id, &payer.pubkey(), &document); + let rent = svm.minimum_balance_for_rent_exemption(Document::required_space(document.len())); + + // A v1 priority fee is a total in lamports, not a price per compute unit. + let priority_fee_lamports = 10_000; + let config = transaction_config().with_priority_fee(priority_fee_lamports); + let transaction = build_v1_transaction(&svm, &payer, &[instruction], config); + + // v1 moved the signatures to the end, so the first byte on the wire is the + // message version rather than a signature count. 0x81 means v1. + assert_eq!(wincode::serialize(&transaction).unwrap()[0], v1::V1_PREFIX); + + let balance_before = svm.get_balance(&payer.pubkey()).unwrap(); + let metadata = svm.send_transaction(transaction).unwrap(); + let balance_after = svm.get_balance(&payer.pubkey()).unwrap(); + + assert!(metadata.compute_units_consumed <= u64::from(COMPUTE_UNIT_LIMIT)); + assert_eq!( + balance_before - balance_after, + rent + BASE_FEE_LAMPORTS + priority_fee_lamports + ); +} + +#[test] +fn unset_config_fields_mean_zero_not_the_default() { + let (mut svm, program_id, payer) = setup(); + let document = sample_document(500); + let (instruction, _) = store_document(&program_id, &payer.pubkey(), &document); + + // No loaded-accounts data size limit: the transaction fails before any + // program runs, because zero bytes of account data may be loaded. + let transaction = build_v1_transaction( + &svm, + &payer, + std::slice::from_ref(&instruction), + v1::TransactionConfig::empty(), + ); + let failure = svm.send_transaction(transaction).unwrap_err(); + assert_eq!( + failure.err, + TransactionError::MaxLoadedAccountsDataSizeExceeded + ); + + // Data size limit set, compute unit limit not: the program starts with a + // budget of zero and fails on its first instruction. + let config = v1::TransactionConfig::empty() + .with_loaded_accounts_data_size_limit(LOADED_ACCOUNTS_DATA_SIZE_LIMIT); + let transaction = build_v1_transaction(&svm, &payer, &[instruction], config); + let failure = svm.send_transaction(transaction).unwrap_err(); + assert!(matches!( + failure.err, + TransactionError::InstructionError(0, _) + )); + assert!( + failure + .meta + .logs + .iter() + .any(|log| log.contains("exceeded CUs")), + "{:?}", + failure.meta.logs + ); +} diff --git a/basics/transfer-sol/anchor/README.md b/basics/transfer-sol/anchor/README.md index 085104477..84603d9a8 100644 --- a/basics/transfer-sol/anchor/README.md +++ b/basics/transfer-sol/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/basics/transfer-sol/anchor/programs/transfer-sol/Cargo.toml b/basics/transfer-sol/anchor/programs/transfer-sol/Cargo.toml index 4cd9ee38b..c13bd46e4 100644 --- a/basics/transfer-sol/anchor/programs/transfer-sol/Cargo.toml +++ b/basics/transfer-sol/anchor/programs/transfer-sol/Cargo.toml @@ -22,10 +22,10 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } +wincode = { version = "0.6", features = ["derive"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -42,8 +42,14 @@ wincode = { version = "0.5", features = ["derive"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/basics/transfer-sol/anchor/programs/transfer-sol/tests/test_transfer_sol.rs b/basics/transfer-sol/anchor/programs/transfer-sol/tests/test_transfer_sol.rs index b3c405988..834895d02 100644 --- a/basics/transfer-sol/anchor/programs/transfer-sol/tests/test_transfer_sol.rs +++ b/basics/transfer-sol/anchor/programs/transfer-sol/tests/test_transfer_sol.rs @@ -2,7 +2,7 @@ use { anchor_lang::{ solana_program::instruction::Instruction, system_program, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{Keypair, Signer}, solana_kite::{create_wallet, send_transaction_from_instructions}, }; @@ -32,8 +32,14 @@ fn test_transfer_sol_with_cpi() { .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![instruction], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![instruction], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); let recipient_balance = svm.get_balance(&recipient.pubkey()).unwrap(); assert_eq!(recipient_balance, LAMPORTS_PER_SOL); @@ -61,6 +67,7 @@ fn test_transfer_sol_with_program() { vec![create_account_ix], &[&payer, &payer_account], &payer.pubkey(), + None, ) .unwrap(); @@ -81,8 +88,14 @@ fn test_transfer_sol_with_program() { .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![instruction], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![instruction], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); let recipient_balance = svm.get_balance(&recipient.pubkey()).unwrap(); assert_eq!(recipient_balance, LAMPORTS_PER_SOL); @@ -110,6 +123,7 @@ fn test_transfer_sol_with_program_rejects_insufficient_funds() { vec![create_account_ix], &[&payer, &program_owned_account], &payer.pubkey(), + None, ) .unwrap(); @@ -130,8 +144,13 @@ fn test_transfer_sol_with_program_rejects_insufficient_funds() { .to_account_metas(None), ); - let result = - send_transaction_from_instructions(&mut svm, vec![instruction], &[&payer], &payer.pubkey()); + let result = send_transaction_from_instructions( + &mut svm, + vec![instruction], + &[&payer], + &payer.pubkey(), + None, + ); assert!(result.is_err(), "overdrawing the payer must fail"); // Balances are untouched. diff --git a/basics/transfer-sol/asm/src/lib.rs b/basics/transfer-sol/asm/src/lib.rs index 3a4344bbd..4c990e5bb 100644 --- a/basics/transfer-sol/asm/src/lib.rs +++ b/basics/transfer-sol/asm/src/lib.rs @@ -45,7 +45,7 @@ mod tests { ); let res = svm.send_transaction(tx); - assert!(res.is_ok()); + assert!(res.is_ok(), "{res:?}"); let payer_balance_after = svm.get_balance(&payer.pubkey()).unwrap(); let recipient_balance_after = svm.get_balance(&test_recipient1.pubkey()).unwrap_or(0); diff --git a/basics/transfer-sol/asm/src/transfer-sol-cpi/transfer-sol-cpi.s b/basics/transfer-sol/asm/src/transfer-sol-cpi/transfer-sol-cpi.s index c3df12176..f3f1c6ea0 100644 --- a/basics/transfer-sol/asm/src/transfer-sol-cpi/transfer-sol-cpi.s +++ b/basics/transfer-sol/asm/src/transfer-sol-cpi/transfer-sol-cpi.s @@ -22,10 +22,12 @@ .equ SYSTEM_PROGRAM_LAMPORTS, 0x5110 .equ SYSTEM_PROGRAM_DATA_LEN, 0x5118 .equ SYSTEM_PROGRAM_DATA, 0x5120 -.equ SYSTEM_PROGRAM_RENT_EPOCH, 0x7930 -.equ INSTRUCTION_DATA_LEN, 0x7938 -.equ INSTRUCTION_DATA, 0x7940 +# The system program account's data is its builtin name, whose length the +# runtime chooses, so everything after it (its rent epoch, then the +# instruction data) is found at run time from SYSTEM_PROGRAM_DATA_LEN rather +# than at a fixed offset. +.equ MAX_PERMITTED_DATA_INCREASE, 0x2800 .globl entrypoint @@ -46,10 +48,21 @@ entrypoint: ldxb r2, [r1 + SYSTEM_PROGRAM_HEADER] jne r2, 0xff, error_duplicate_accounts + # Find the instruction data: past the system program account's data, its + # realloc padding and its rent epoch, aligned up to 8 bytes. + mov64 r5, r1 + add64 r5, SYSTEM_PROGRAM_DATA + ldxdw r4, [r1 + SYSTEM_PROGRAM_DATA_LEN] + add64 r5, r4 + add64 r5, MAX_PERMITTED_DATA_INCREASE + add64 r5, 8 # rent_epoch + add64 r5, 7 + and64 r5, -8 # align up to 8 bytes for instruction_data_len + # Check instruction data. - ldxdw r4, [r1 + INSTRUCTION_DATA_LEN] + ldxdw r4, [r5 + 0] # instruction_data_len jne r4, 8, error_invalid_instruction_data - ldxdw r4, [r1 + INSTRUCTION_DATA] + ldxdw r4, [r5 + 8] # instruction_data # Check sender lamports. ldxdw r2, [r1 + SENDER_LAMPORTS] diff --git a/basics/transfer-sol/native/program/Cargo.toml b/basics/transfer-sol/native/program/Cargo.toml index a3ee7632a..83b9b0786 100644 --- a/basics/transfer-sol/native/program/Cargo.toml +++ b/basics/transfer-sol/native/program/Cargo.toml @@ -20,9 +20,9 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" diff --git a/basics/transfer-sol/pinocchio/program/Cargo.toml b/basics/transfer-sol/pinocchio/program/Cargo.toml index d91436515..d729e11cb 100644 --- a/basics/transfer-sol/pinocchio/program/Cargo.toml +++ b/basics/transfer-sol/pinocchio/program/Cargo.toml @@ -18,10 +18,10 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" solana-system-interface.workspace = true diff --git a/compression/cnft-burn/anchor/README.md b/compression/cnft-burn/anchor/README.md index 60d41464f..849935bca 100644 --- a/compression/cnft-burn/anchor/README.md +++ b/compression/cnft-burn/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/compression/cnft-burn/anchor/programs/cnft-burn/Cargo.toml b/compression/cnft-burn/anchor/programs/cnft-burn/Cargo.toml index a7fb2ae0a..b6cdff71e 100644 --- a/compression/cnft-burn/anchor/programs/cnft-burn/Cargo.toml +++ b/compression/cnft-burn/anchor/programs/cnft-burn/Cargo.toml @@ -22,17 +22,13 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = { version = "2.0.0-rc.1", features = ["compat"] } +anchor-lang = { version = "2.0.0-rc.2", features = ["compat"] } # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. +wincode = { version = "0.6", features = ["derive"] } # `borsh` adds the BorshSerialize/BorshDeserialize impls for `Address` that the # vendored Bubblegum types need; pinocchio re-exports this same type. -solana-address = { version = ">=2.6, <2.7", features = ["borsh"] } +solana-address = { version = "2.7", features = ["borsh"] } # mpl-bubblegum and spl-account-compression removed: they depend on solana-program 2.x # which is incompatible with Anchor v2's solana 3.x types. CPI calls are built manually # using raw invoke() with hardcoded program IDs and discriminators. @@ -53,14 +49,20 @@ borsh = { version = "1", features = ["derive"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" solana-instruction = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.0" -solana-account = "3.0.0" +solana-pubkey = "4.3" +solana-transaction = "4.2" +solana-account = "4.3" solana-native-token = "3.0.0" -solana-message = "3.0.0" +solana-message = "4.5" solana-keccak-hasher = "3.0.0" [lints.rust] diff --git a/compression/cnft-burn/anchor/programs/cnft-burn/tests/test_burn.rs b/compression/cnft-burn/anchor/programs/cnft-burn/tests/test_burn.rs index 0b5f74386..d1c24ed68 100644 --- a/compression/cnft-burn/anchor/programs/cnft-burn/tests/test_burn.rs +++ b/compression/cnft-burn/anchor/programs/cnft-burn/tests/test_burn.rs @@ -13,7 +13,7 @@ //! transaction succeeds and a second burn fails (leaf already zeroed). use { - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{Keypair, Signer}, borsh::BorshSerialize, solana_instruction::{account_meta::AccountMeta, Instruction}, solana_keccak_hasher::hashv, @@ -316,6 +316,7 @@ fn test_burn_cnft() { vec![create_acc, create_tree_ix], &[&payer, &merkle_tree], &payer.pubkey(), + None, ) .expect("create_tree_config should succeed"); @@ -360,7 +361,7 @@ fn test_burn_cnft() { d }, }; - send_transaction_from_instructions(&mut svm, vec![mint_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![mint_ix], &[&payer], &payer.pubkey(), None) .expect("mint_v1 should succeed"); // Recompute data_hash and creator_hash exactly as Bubblegum does. @@ -415,6 +416,7 @@ fn test_burn_cnft() { vec![burn_ix], &[&leaf_owner], &leaf_owner.pubkey(), + None, ) .expect("burn_cnft should succeed"); @@ -430,6 +432,7 @@ fn test_burn_cnft() { vec![burn_ix2], &[&leaf_owner], &leaf_owner.pubkey(), + None, ); assert!( second.is_err(), diff --git a/compression/cnft-vault/anchor/README.md b/compression/cnft-vault/anchor/README.md index ea7ac9c0e..994df3db8 100644 --- a/compression/cnft-vault/anchor/README.md +++ b/compression/cnft-vault/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/compression/cnft-vault/anchor/programs/cnft-vault/Cargo.toml b/compression/cnft-vault/anchor/programs/cnft-vault/Cargo.toml index 8fc7f764c..be428271b 100644 --- a/compression/cnft-vault/anchor/programs/cnft-vault/Cargo.toml +++ b/compression/cnft-vault/anchor/programs/cnft-vault/Cargo.toml @@ -22,17 +22,13 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. +wincode = { version = "0.6", features = ["derive"] } # `borsh` adds the BorshSerialize/BorshDeserialize impls for `Address` that the # vendored Bubblegum types need; pinocchio re-exports this same type. -solana-address = { version = ">=2.6, <2.7", features = ["borsh"] } +solana-address = { version = "2.7", features = ["borsh"] } # mpl-bubblegum and spl-account-compression removed: they depend on solana-program 2.x # which is incompatible with Anchor v2's solana 3.x types. CPI calls are built manually # using raw invoke_signed() with hardcoded program IDs and discriminators. @@ -56,12 +52,18 @@ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" solana-instruction = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.0" -solana-account = "3.0.0" +solana-pubkey = "4.3" +solana-transaction = "4.2" +solana-account = "4.3" solana-native-token = "3.0.0" -solana-message = "3.0.0" +solana-message = "4.5" solana-keccak-hasher = "3.0.0" diff --git a/compression/cnft-vault/anchor/programs/cnft-vault/tests/test_vault.rs b/compression/cnft-vault/anchor/programs/cnft-vault/tests/test_vault.rs index 3fe9a543e..cb7f5bbcb 100644 --- a/compression/cnft-vault/anchor/programs/cnft-vault/tests/test_vault.rs +++ b/compression/cnft-vault/anchor/programs/cnft-vault/tests/test_vault.rs @@ -26,7 +26,7 @@ //! of panicking inside `split_at` use { - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, borsh::BorshSerialize, cnft_vault::error::VaultError, solana_instruction::{account_meta::AccountMeta, Instruction}, @@ -336,6 +336,7 @@ fn setup_vault() -> VaultTestContext { vec![initialize_ix], &[&authority_keypair], &authority_keypair.pubkey(), + None, ) .expect("initialize_vault should succeed"); @@ -398,6 +399,7 @@ fn create_tree_with_vault_cnft(context: &mut VaultTestContext) -> TreeWithVaultC vec![create_acc, create_tree_ix], &[&payer, &merkle_tree], &payer.pubkey(), + None, ) .expect("create_tree_config should succeed"); @@ -443,8 +445,14 @@ fn create_tree_with_vault_cnft(context: &mut VaultTestContext) -> TreeWithVaultC d }, }; - send_transaction_from_instructions(&mut context.svm, vec![mint_ix], &[&payer], &payer.pubkey()) - .expect("mint_v1 should succeed"); + send_transaction_from_instructions( + &mut context.svm, + vec![mint_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .expect("mint_v1 should succeed"); // Recompute data_hash and creator_hash exactly as Bubblegum does. let data_hash = hash_metadata(&metadata); @@ -592,6 +600,7 @@ fn test_withdraw_cnft_by_authority() { vec![withdraw_ix.clone()], &[&authority], &authority.pubkey(), + None, ) .expect("withdraw_cnft signed by the vault authority should succeed"); @@ -603,6 +612,7 @@ fn test_withdraw_cnft_by_authority() { vec![withdraw_ix], &[&authority], &authority.pubkey(), + None, ); assert!( second.is_err(), @@ -629,6 +639,7 @@ fn test_withdraw_cnft_rejected_for_non_authority() { vec![withdraw_ix], &[&attacker], &attacker.pubkey(), + None, ); assert_custom_error(result, VaultError::InvalidWithdrawAuthority); } @@ -656,6 +667,7 @@ fn test_withdraw_two_cnfts_by_authority() { vec![withdraw_ix], &[&authority], &authority.pubkey(), + None, ) .expect("withdraw_two_cnfts signed by the vault authority should succeed"); @@ -668,6 +680,7 @@ fn test_withdraw_two_cnfts_by_authority() { vec![replay1], &[&authority], &authority.pubkey(), + None, ); assert!( replay.is_err(), @@ -704,6 +717,7 @@ fn test_withdraw_two_cnfts_rejects_out_of_range_proof_length() { vec![withdraw_ix], &[&authority], &authority.pubkey(), + None, ); assert_custom_error(result, VaultError::ProofLengthMismatch); } @@ -733,6 +747,7 @@ fn test_withdraw_two_cnfts_rejects_inconsistent_proof_lengths() { vec![withdraw_ix], &[&authority], &authority.pubkey(), + None, ); assert_custom_error(result, VaultError::ProofLengthMismatch); } diff --git a/compression/cutils/anchor/README.md b/compression/cutils/anchor/README.md index 073b8d5c2..45da2c697 100644 --- a/compression/cutils/anchor/README.md +++ b/compression/cutils/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/compression/cutils/anchor/programs/cutils/Cargo.toml b/compression/cutils/anchor/programs/cutils/Cargo.toml index 277fead35..217683409 100644 --- a/compression/cutils/anchor/programs/cutils/Cargo.toml +++ b/compression/cutils/anchor/programs/cutils/Cargo.toml @@ -22,17 +22,13 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. +wincode = { version = "0.6", features = ["derive"] } # `borsh` adds the BorshSerialize/BorshDeserialize impls for `Address` that the # vendored Bubblegum types need; pinocchio re-exports this same type. -solana-address = { version = ">=2.6, <2.7", features = ["borsh"] } +solana-address = { version = "2.7", features = ["borsh"] } # mpl-bubblegum and spl-account-compression removed: they depend on solana-program 2.x # which is incompatible with Anchor v2's solana 3.x types. CPI calls are built manually # using raw invoke() with hardcoded program IDs and discriminators. Bubblegum types @@ -58,12 +54,18 @@ unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" solana-instruction = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.0" -solana-account = "3.0.0" +solana-pubkey = "4.3" +solana-transaction = "4.2" +solana-account = "4.3" solana-native-token = "3.0.0" -solana-message = "3.0.0" +solana-message = "4.5" solana-keccak-hasher = "3.0.0" diff --git a/compression/cutils/anchor/programs/cutils/tests/test_cutils.rs b/compression/cutils/anchor/programs/cutils/tests/test_cutils.rs index 84c2e2bcb..fa14c9277 100644 --- a/compression/cutils/anchor/programs/cutils/tests/test_cutils.rs +++ b/compression/cutils/anchor/programs/cutils/tests/test_cutils.rs @@ -26,7 +26,7 @@ //! fail. use { - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, borsh::BorshSerialize, solana_instruction::{account_meta::AccountMeta, Instruction}, solana_keccak_hasher::hashv, @@ -392,6 +392,7 @@ fn create_collection_nft( ], &[payer, &mint, &token_account, authority], &payer.pubkey(), + None, ) .expect("collection mint setup should succeed"); @@ -454,6 +455,7 @@ fn create_collection_nft( vec![create_metadata, create_master_edition], &[payer, authority], &payer.pubkey(), + None, ) .expect("collection metadata + master edition should succeed"); @@ -546,6 +548,7 @@ fn test_cutils_mint_and_verify() { vec![create_acc, create_tree_ix], &[&payer, &merkle_tree], &payer.pubkey(), + None, ) .expect("create_tree_config should succeed"); @@ -592,7 +595,7 @@ fn test_cutils_mint_and_verify() { }, }; - send_transaction_from_instructions(&mut svm, vec![mint_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![mint_ix], &[&payer], &payer.pubkey(), None) .expect("cutils mint should succeed"); // ---- Recompute the stored leaf's data_hash / creator_hash --------------- @@ -696,6 +699,7 @@ fn test_cutils_mint_and_verify() { vec![build_verify(data_hash)], &[&leaf_owner], &leaf_owner.pubkey(), + None, ) .expect("cutils verify should succeed for the minted leaf"); @@ -707,6 +711,7 @@ fn test_cutils_mint_and_verify() { vec![build_verify(bad)], &[&leaf_owner], &leaf_owner.pubkey(), + None, ); assert!( bad_result.is_err(), diff --git a/docs/anchor-v2-migration.md b/docs/anchor-v2-migration.md index 6b4f59bd6..d2056a5e9 100644 --- a/docs/anchor-v2-migration.md +++ b/docs/anchor-v2-migration.md @@ -1,4 +1,4 @@ -# Porting an Anchor program from v1 to v2.0.0-rc.1 +# Porting an Anchor program from v1 to v2.0.0-rc.2 Anchor v2 is a ground-up rewrite, not a version bump. The crate is `no_std` and built on pinocchio, the account model is static-scoped, borsh is replaced by @@ -11,14 +11,14 @@ it is the only rule here that the compiler will not catch for you. Every difference below has a worked example in this repository. Each Anchor example keeps both versions side by side: `/anchor-v1/` is the program on 1.2.1 and -`/anchor/` is the same program on 2.0.0-rc.1, so diffing the two directories shows +`/anchor/` is the same program on 2.0.0-rc.2, so diffing the two directories shows any rule here applied to real code. Both are built and tested in CI, by the Anchor v1 and Anchor v2 workflows respectively. ## Manifest Changes Every Crate Needs -- `anchor-lang` and `anchor-spl` both move from `1.2.1` to `2.0.0-rc.1`. -- `wincode = { version = "0.5", features = ["derive"] }` is new. +- `anchor-lang` and `anchor-spl` both move from `1.2.1` to `2.0.0-rc.2`. +- `wincode = { version = "0.6", features = ["derive"] }` is new. - `features = ["init-if-needed"]` goes away. There is no such feature, and the constraint is always available. - `"anchor-spl/idl-build"` comes out of the `idl-build` feature list, because @@ -29,19 +29,6 @@ Anchor v2 workflows respectively. Every program crate needs `wincode` as a **direct** dependency: the `#[program]` macro expands to `wincode` paths for instruction-data (de)serialization. -Programs that put an `Address` in serialized state also need: - -```toml -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls belong -# to the version the account derives are not using, and every `SchemaRead` / -# `SchemaWrite` bound fails. 2.6.1 is the last release on the 0.5 line. -solana-address = ">=2.6, <2.7" -``` - -Note the range: a bare `<2.7` lets cargo satisfy the requirement by reusing an -older 1.x already in the graph, which does not fix anything. - ## Renamed Accessors and Handler Signatures - `Context` becomes `&mut Context`, and the user `'info` lifetime is gone: @@ -443,6 +430,9 @@ answer is usually one of the first four rather than moving it to borsh. - `anchor test --profile`: per-test register-trace flamegraphs under `target/anchor-v2-profile/`. - `anchor-v2-testing`: wraps LiteSVM with optional register-trace capture. + It is published only from git, so the examples pin it to the revision the + `v2.0.0-rc.2` tag points at. It no longer re-exports `LiteSVM` at its root: + import `anchor_v2_testing::litesvm::LiteSVM`. ## Hand-Built CPIs Take Handles, Not Account Infos @@ -541,8 +531,9 @@ driving `cargo-build-sbf` has to do the same. ## Toolchain Versions the Port Depends On -CI installs the CLI with `avm install 2.0.0-rc.1`; it is a pre-release, so it -has to be named explicitly rather than resolved as latest. A v2 CLI cannot build +CI installs the CLI with `cargo install anchor-cli --version 2.0.0-rc.2 --locked`; +it is a pre-release, so it has to be named explicitly rather than resolved as +latest, and avm has no prebuilt binary for it. A v2 CLI cannot build v1 programs, so that pin can only move once every example is ported. `anchor idl build` compiles the test targets too, so the `.so` has to exist diff --git a/finance/betting-market/anchor/README.md b/finance/betting-market/anchor/README.md index 320b05ce2..75ac16e5f 100644 --- a/finance/betting-market/anchor/README.md +++ b/finance/betting-market/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/finance/betting-market/anchor/programs/betting-market/Cargo.toml b/finance/betting-market/anchor/programs/betting-market/Cargo.toml index 256d3ffc1..5c92067ef 100644 --- a/finance/betting-market/anchor/programs/betting-market/Cargo.toml +++ b/finance/betting-market/anchor/programs/betting-market/Cargo.toml @@ -23,16 +23,11 @@ profile = ["anchor-v2-testing/profile"] [dependencies] # init-if-needed: place_bet creates the Bet account only on a bettor's first bet on an outcome. -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -49,14 +44,20 @@ anchor-spl = "2.0.0-rc.1" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" # no-entrypoint: solana-kite pulls these SPL program crates into the host test # build, and their `entrypoint` symbols collide with this program's own # entrypoint at link time. Feature unification turns their entrypoints off # across the test build; the dependencies exist only for that. spl-token = { version = "9.0.0", features = ["no-entrypoint"] } spl-associated-token-account = { version = "8.0.0", features = ["no-entrypoint"] } -solana-kite = "0.4.0" +solana-kite = "0.7.0" borsh = "1.6.1" # LiteSVM's `get_sysvar` / `set_sysvar` want the host-side Clock type; the # tests move `unix_timestamp` across the betting close time. diff --git a/finance/betting-market/anchor/programs/betting-market/tests/test_betting_market.rs b/finance/betting-market/anchor/programs/betting-market/tests/test_betting_market.rs index 0f9d9d1dc..34a4f6886 100644 --- a/finance/betting-market/anchor/programs/betting-market/tests/test_betting_market.rs +++ b/finance/betting-market/anchor/programs/betting-market/tests/test_betting_market.rs @@ -3,7 +3,7 @@ use { solana_program::{instruction::Instruction, system_instruction}, system_program, AccountDeserialize, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, // `Event` through `state`: the prelude's `Event` trait shadows the glob // re-export at the crate root. betting_market::{ @@ -92,11 +92,12 @@ fn setup() -> Market { warp_to(&mut svm, START_TIME); let admin = create_wallet(&mut svm, 100_000_000_000).unwrap(); - let mint = create_token_mint(&mut svm, &admin, DECIMALS, None).unwrap(); + let mint = create_token_mint(&mut svm, &admin, DECIMALS, None, None).unwrap(); let fee_recipient = create_wallet(&mut svm, 10_000_000_000).unwrap(); let fee_recipient_ata = - create_associated_token_account(&mut svm, &fee_recipient.pubkey(), &mint, &admin).unwrap(); + create_associated_token_account(&mut svm, &fee_recipient.pubkey(), &mint, &admin, None) + .unwrap(); Market { svm, @@ -142,10 +143,18 @@ fn create_bettor(market: &mut Market, amount: u64) -> (Keypair, Address) { &bettor.pubkey(), &market.mint, &market.admin, + None, + ) + .unwrap(); + mint_tokens_to_token_account( + &mut market.svm, + &market.mint, + &ata, + amount, + &market.admin, + None, ) .unwrap(); - mint_tokens_to_token_account(&mut market.svm, &market.mint, &ata, amount, &market.admin) - .unwrap(); (bettor, ata) } @@ -451,6 +460,7 @@ fn transaction_fee(market: &mut Market) -> u64 { vec![system_instruction::transfer(&admin, &admin, 0)], &[&market.admin], &admin, + None, ) .unwrap(); before - get_sol_balance(&market.svm, &admin) @@ -482,6 +492,7 @@ fn close_outcomes_and_event(market: &mut Market, event_id: u64, outcome_count: u vec![close_outcome_ix(admin, event_id, index)], &[&market.admin], &admin, + None, ) .unwrap(); assert!( @@ -511,6 +522,7 @@ fn close_outcomes_and_event(market: &mut Market, event_id: u64, outcome_count: u )], &[&market.admin], &admin, + None, ) .unwrap(); assert!(!account_is_open(market, &event)); @@ -543,6 +555,7 @@ fn init_config(market: &mut Market) { vec![initialize_config_ix(admin, mint, fee_recipient)], &[&market.admin], &admin, + None, ) .unwrap(); } @@ -572,6 +585,7 @@ fn test_full_lifecycle() { ], &[&market.admin], &admin, + None, ) .unwrap(); @@ -587,6 +601,7 @@ fn test_full_lifecycle() { )], &[&alice], &alice.pubkey(), + None, ) .unwrap(); send_transaction_from_instructions( @@ -601,6 +616,7 @@ fn test_full_lifecycle() { )], &[&bob], &bob.pubkey(), + None, ) .unwrap(); send_transaction_from_instructions( @@ -615,6 +631,7 @@ fn test_full_lifecycle() { )], &[&carol], &carol.pubkey(), + None, ) .unwrap(); @@ -648,6 +665,7 @@ fn test_full_lifecycle() { )], &[&market.admin], &admin, + None, ) .unwrap(); assert_eq!( @@ -667,6 +685,7 @@ fn test_full_lifecycle() { )], &[&alice], &alice.pubkey(), + None, ) .unwrap(); send_transaction_from_instructions( @@ -680,6 +699,7 @@ fn test_full_lifecycle() { )], &[&bob], &bob.pubkey(), + None, ) .unwrap(); @@ -717,6 +737,7 @@ fn test_full_lifecycle() { )], &[&carol], &carol.pubkey(), + None, ); assert_fails_with(carol_claim, BettingError::NothingToClaim); @@ -728,6 +749,7 @@ fn test_full_lifecycle() { vec![close_losing_bet_ix(&carol.pubkey(), event_id, 1)], &[&carol], &carol.pubkey(), + None, ) .unwrap(); assert!(!account_is_open(&market, &carol_bet)); @@ -752,6 +774,7 @@ fn test_only_admin_can_initialize_event() { )], &[&mallory], &mallory.pubkey(), + None, ); assert_fails_with(result, BettingError::Unauthorized); @@ -765,6 +788,7 @@ fn test_only_admin_can_initialize_event() { ], &[&market.admin], &admin, + None, ) .unwrap(); let unauthorized_outcome = send_transaction_from_instructions( @@ -772,6 +796,7 @@ fn test_only_admin_can_initialize_event() { vec![add_outcome_ix(mallory.pubkey(), event_id, 2, "Late entry")], &[&mallory], &mallory.pubkey(), + None, ); assert_fails_with(unauthorized_outcome, BettingError::Unauthorized); let unauthorized_open = send_transaction_from_instructions( @@ -779,6 +804,7 @@ fn test_only_admin_can_initialize_event() { vec![open_betting_ix(mallory.pubkey(), event_id)], &[&mallory], &mallory.pubkey(), + None, ); assert_fails_with(unauthorized_open, BettingError::Unauthorized); } @@ -807,6 +833,7 @@ fn test_only_admin_can_settle_or_cancel_event() { vec![cancel_event_ix(mallory.pubkey(), event_id)], &[&mallory], &mallory.pubkey(), + None, ); assert_fails_with(unauthorized_cancel, BettingError::Unauthorized); @@ -824,6 +851,7 @@ fn test_only_admin_can_settle_or_cancel_event() { )], &[&mallory], &mallory.pubkey(), + None, ); assert_fails_with(unauthorized_settle, BettingError::Unauthorized); assert!(read_event(&market, event_id).status == EventStatus::Open); @@ -859,6 +887,7 @@ fn test_cannot_bet_after_settle() { ], &[&market.admin], &admin, + None, ) .unwrap(); send_transaction_from_instructions( @@ -873,6 +902,7 @@ fn test_cannot_bet_after_settle() { )], &[&alice], &alice.pubkey(), + None, ) .unwrap(); // Betting has closed, so the event can be settled. @@ -889,6 +919,7 @@ fn test_cannot_bet_after_settle() { )], &[&market.admin], &admin, + None, ) .unwrap(); @@ -904,6 +935,7 @@ fn test_cannot_bet_after_settle() { )], &[&bob], &bob.pubkey(), + None, ); assert_fails_with(late_bet, BettingError::EventNotOpen); } @@ -930,6 +962,7 @@ fn test_double_claim_fails() { ], &[&market.admin], &admin, + None, ) .unwrap(); send_transaction_from_instructions( @@ -944,6 +977,7 @@ fn test_double_claim_fails() { )], &[&alice], &alice.pubkey(), + None, ) .unwrap(); send_transaction_from_instructions( @@ -958,6 +992,7 @@ fn test_double_claim_fails() { )], &[&carol], &carol.pubkey(), + None, ) .unwrap(); // Betting has closed, so the event can be settled. @@ -974,6 +1009,7 @@ fn test_double_claim_fails() { )], &[&market.admin], &admin, + None, ) .unwrap(); @@ -988,6 +1024,7 @@ fn test_double_claim_fails() { )], &[&alice], &alice.pubkey(), + None, ) .unwrap(); // A fresh blockhash so the second claim is a distinct transaction. @@ -1003,6 +1040,7 @@ fn test_double_claim_fails() { )], &[&alice], &alice.pubkey(), + None, ); // The first claim closed the Bet account (`close = bettor`), so the second // transaction passes an address with no lamports and no data. Anchor @@ -1033,6 +1071,7 @@ fn test_settle_outcome_without_bets_fails() { ], &[&market.admin], &admin, + None, ) .unwrap(); // Everyone bets Horse A; Horse B has no bets. @@ -1048,6 +1087,7 @@ fn test_settle_outcome_without_bets_fails() { )], &[&alice], &alice.pubkey(), + None, ) .unwrap(); @@ -1065,6 +1105,7 @@ fn test_settle_outcome_without_bets_fails() { )], &[&market.admin], &admin, + None, ); assert_fails_with(result, BettingError::OutcomeHasNoBets); } @@ -1089,6 +1130,7 @@ fn test_cancel_and_refund() { ], &[&market.admin], &admin, + None, ) .unwrap(); send_transaction_from_instructions( @@ -1103,6 +1145,7 @@ fn test_cancel_and_refund() { )], &[&alice], &alice.pubkey(), + None, ) .unwrap(); send_transaction_from_instructions( @@ -1117,6 +1160,7 @@ fn test_cancel_and_refund() { )], &[&carol], &carol.pubkey(), + None, ) .unwrap(); @@ -1125,6 +1169,7 @@ fn test_cancel_and_refund() { vec![cancel_event_ix(admin, event_id)], &[&market.admin], &admin, + None, ) .unwrap(); @@ -1142,6 +1187,7 @@ fn test_cancel_and_refund() { )], &[&alice], &alice.pubkey(), + None, ) .unwrap(); @@ -1154,6 +1200,7 @@ fn test_cancel_and_refund() { vec![close_outcome_ix(admin, event_id, 0)], &[&market.admin], &admin, + None, ); assert_fails_with(outcome_still_in_use, BettingError::BetsStillOpen); assert_eq!(read_event(&market, event_id).open_bets, 1); @@ -1169,6 +1216,7 @@ fn test_cancel_and_refund() { )], &[&carol], &carol.pubkey(), + None, ) .unwrap(); @@ -1217,6 +1265,7 @@ fn test_close_losing_bet_only_after_settle_and_only_for_losers() { ], &[&market.admin], &admin, + None, ) .unwrap(); send_transaction_from_instructions( @@ -1231,6 +1280,7 @@ fn test_close_losing_bet_only_after_settle_and_only_for_losers() { )], &[&alice], &alice.pubkey(), + None, ) .unwrap(); send_transaction_from_instructions( @@ -1245,6 +1295,7 @@ fn test_close_losing_bet_only_after_settle_and_only_for_losers() { )], &[&carol], &carol.pubkey(), + None, ) .unwrap(); @@ -1254,6 +1305,7 @@ fn test_close_losing_bet_only_after_settle_and_only_for_losers() { vec![close_losing_bet_ix(&carol.pubkey(), event_id, 1)], &[&carol], &carol.pubkey(), + None, ); assert_fails_with(premature_close, BettingError::EventNotSettled); @@ -1271,6 +1323,7 @@ fn test_close_losing_bet_only_after_settle_and_only_for_losers() { )], &[&market.admin], &admin, + None, ) .unwrap(); @@ -1280,6 +1333,7 @@ fn test_close_losing_bet_only_after_settle_and_only_for_losers() { vec![close_losing_bet_ix(&alice.pubkey(), event_id, 0)], &[&alice], &alice.pubkey(), + None, ); assert_fails_with(winner_close, BettingError::BetWon); let alice_bet = bet_pda(&outcome_pda(&event_pda(event_id), 0), &alice.pubkey()); @@ -1293,6 +1347,7 @@ fn test_close_losing_bet_only_after_settle_and_only_for_losers() { vec![close_losing_bet_ix(&carol.pubkey(), event_id, 1)], &[&carol], &carol.pubkey(), + None, ) .unwrap(); let carol_bet = bet_pda(&outcome_pda(&event_pda(event_id), 1), &carol.pubkey()); @@ -1325,6 +1380,7 @@ fn test_no_cap_on_open_bets_per_wallet() { )], &[&market.admin], &admin, + None, ) .unwrap(); for index in 0..OUTCOME_COUNT { @@ -1338,6 +1394,7 @@ fn test_no_cap_on_open_bets_per_wallet() { )], &[&market.admin], &admin, + None, ) .unwrap(); } @@ -1346,6 +1403,7 @@ fn test_no_cap_on_open_bets_per_wallet() { vec![open_betting_ix(admin, wide_event_id)], &[&market.admin], &admin, + None, ) .unwrap(); send_transaction_from_instructions( @@ -1358,6 +1416,7 @@ fn test_no_cap_on_open_bets_per_wallet() { ], &[&market.admin], &admin, + None, ) .unwrap(); @@ -1374,6 +1433,7 @@ fn test_no_cap_on_open_bets_per_wallet() { )], &[&alice], &alice.pubkey(), + None, ) .unwrap(); } @@ -1389,6 +1449,7 @@ fn test_no_cap_on_open_bets_per_wallet() { )], &[&alice], &alice.pubkey(), + None, ) .unwrap(); @@ -1430,6 +1491,7 @@ fn test_outcomes_lock_when_betting_opens() { ], &[&market.admin], &admin, + None, ) .unwrap(); @@ -1446,6 +1508,7 @@ fn test_outcomes_lock_when_betting_opens() { )], &[&alice], &alice.pubkey(), + None, ); assert_fails_with(early_bet, BettingError::EventNotOpen); @@ -1458,6 +1521,7 @@ fn test_outcomes_lock_when_betting_opens() { ], &[&market.admin], &admin, + None, ) .unwrap(); @@ -1467,6 +1531,7 @@ fn test_outcomes_lock_when_betting_opens() { vec![add_outcome_ix(admin, event_id, 2, "Late entry")], &[&market.admin], &admin, + None, ); assert_fails_with(late_outcome, BettingError::EventNotDraft); @@ -1476,6 +1541,7 @@ fn test_outcomes_lock_when_betting_opens() { vec![open_betting_ix(admin, event_id)], &[&market.admin], &admin, + None, ); assert_fails_with(reopen, BettingError::EventNotDraft); } @@ -1496,6 +1562,7 @@ fn test_open_betting_needs_two_outcomes() { ], &[&market.admin], &admin, + None, ) .unwrap(); @@ -1504,6 +1571,7 @@ fn test_open_betting_needs_two_outcomes() { vec![open_betting_ix(admin, event_id)], &[&market.admin], &admin, + None, ); assert_fails_with(result, BettingError::NotEnoughOutcomes); @@ -1513,6 +1581,7 @@ fn test_open_betting_needs_two_outcomes() { vec![add_outcome_ix(admin, event_id, 1, "A second horse")], &[&market.admin], &admin, + None, ) .unwrap(); let mallory = create_wallet(&mut market.svm, 10_000_000_000).unwrap(); @@ -1521,6 +1590,7 @@ fn test_open_betting_needs_two_outcomes() { vec![open_betting_ix(mallory.pubkey(), event_id)], &[&mallory], &mallory.pubkey(), + None, ); assert_fails_with(unauthorized, BettingError::Unauthorized); } @@ -1550,6 +1620,7 @@ fn test_betting_closes_at_close_time() { ], &[&market.admin], &admin, + None, ) .unwrap(); @@ -1567,6 +1638,7 @@ fn test_betting_closes_at_close_time() { )], &[&alice], &alice.pubkey(), + None, ) .unwrap(); @@ -1583,6 +1655,7 @@ fn test_betting_closes_at_close_time() { )], &[&market.admin], &admin, + None, ); assert_fails_with(early_settle, BettingError::BettingStillOpen); @@ -1600,6 +1673,7 @@ fn test_betting_closes_at_close_time() { )], &[&carol], &carol.pubkey(), + None, ); assert_fails_with(late_bet, BettingError::BettingClosed); @@ -1615,6 +1689,7 @@ fn test_betting_closes_at_close_time() { )], &[&market.admin], &admin, + None, ) .unwrap(); } @@ -1637,6 +1712,7 @@ fn test_close_time_must_be_in_the_future() { )], &[&market.admin], &admin, + None, ); assert_fails_with(result, BettingError::CloseTimeInPast); } @@ -1656,6 +1732,7 @@ fn open_yes_no_market(market: &mut Market, event_id: u64, description: &str) { ], &[&market.admin], &admin, + None, ) .unwrap(); } @@ -1681,6 +1758,7 @@ fn place_bet( )], &[bettor], &bettor.pubkey(), + None, ) .unwrap(); } @@ -1704,6 +1782,7 @@ fn settle(market: &mut Market, event_id: u64, winning_outcome_index: u8) { )], &[&market.admin], &admin, + None, ) .unwrap(); } @@ -1752,6 +1831,7 @@ fn test_close_event_pays_dust_to_fee_recipient_and_returns_rent() { vec![close_losing_bet_ix(&carol.pubkey(), event_id, 1)], &[&carol], &carol.pubkey(), + None, ) .unwrap(); assert_eq!(read_event(&market, event_id).open_bets, 2); @@ -1767,6 +1847,7 @@ fn test_close_event_pays_dust_to_fee_recipient_and_returns_rent() { )], &[winner], &winner.pubkey(), + None, ) .unwrap(); } @@ -1796,6 +1877,7 @@ fn test_close_event_pays_dust_to_fee_recipient_and_returns_rent() { )], &[&market.admin], &admin, + None, ); assert_fails_with(outcomes_still_open, BettingError::OutcomesStillOpen); @@ -1841,6 +1923,7 @@ fn test_close_event_refused_while_a_bet_is_open() { )], &[&alice], &alice.pubkey(), + None, ) .unwrap(); assert_eq!(read_event(&market, event_id).open_bets, 1); @@ -1856,6 +1939,7 @@ fn test_close_event_refused_while_a_bet_is_open() { )], &[&market.admin], &admin, + None, ); assert_fails_with(event_close, BettingError::BetsStillOpen); let outcome_close = send_transaction_from_instructions( @@ -1863,6 +1947,7 @@ fn test_close_event_refused_while_a_bet_is_open() { vec![close_outcome_ix(admin, event_id, 1)], &[&market.admin], &admin, + None, ); assert_fails_with(outcome_close, BettingError::BetsStillOpen); @@ -1872,6 +1957,7 @@ fn test_close_event_refused_while_a_bet_is_open() { vec![close_losing_bet_ix(&carol.pubkey(), event_id, 1)], &[&carol], &carol.pubkey(), + None, ) .unwrap(); close_outcomes_and_event(&mut market, event_id, 2); @@ -1898,6 +1984,7 @@ fn test_close_event_refused_while_event_is_open() { ], &[&market.admin], &admin, + None, ) .unwrap(); @@ -1913,6 +2000,7 @@ fn test_close_event_refused_while_event_is_open() { )], &[&market.admin], &admin, + None, ); assert_fails_with(draft_close, BettingError::EventNotFinished); let draft_outcome_close = send_transaction_from_instructions( @@ -1920,6 +2008,7 @@ fn test_close_event_refused_while_event_is_open() { vec![close_outcome_ix(admin, event_id, 0)], &[&market.admin], &admin, + None, ); assert_fails_with(draft_outcome_close, BettingError::EventNotFinished); @@ -1930,6 +2019,7 @@ fn test_close_event_refused_while_event_is_open() { vec![open_betting_ix(admin, event_id)], &[&market.admin], &admin, + None, ) .unwrap(); market.svm.expire_blockhash(); @@ -1944,6 +2034,7 @@ fn test_close_event_refused_while_event_is_open() { )], &[&market.admin], &admin, + None, ); assert_fails_with(open_close, BettingError::EventNotFinished); @@ -1953,6 +2044,7 @@ fn test_close_event_refused_while_event_is_open() { vec![cancel_event_ix(admin, event_id)], &[&market.admin], &admin, + None, ) .unwrap(); let vault_balance_at_close = close_outcomes_and_event(&mut market, event_id, 2); @@ -1985,6 +2077,7 @@ fn test_only_admin_can_close_outcomes_and_event() { )], &[&alice], &alice.pubkey(), + None, ) .unwrap(); send_transaction_from_instructions( @@ -1992,6 +2085,7 @@ fn test_only_admin_can_close_outcomes_and_event() { vec![close_losing_bet_ix(&carol.pubkey(), event_id, 1)], &[&carol], &carol.pubkey(), + None, ) .unwrap(); @@ -2003,6 +2097,7 @@ fn test_only_admin_can_close_outcomes_and_event() { vec![close_outcome_ix(mallory.pubkey(), event_id, 0)], &[&mallory], &mallory.pubkey(), + None, ); assert_fails_with(outcome_close, BettingError::Unauthorized); let event_close = send_transaction_from_instructions( @@ -2016,6 +2111,7 @@ fn test_only_admin_can_close_outcomes_and_event() { )], &[&mallory], &mallory.pubkey(), + None, ); assert_fails_with(event_close, BettingError::Unauthorized); let event = event_pda(event_id); diff --git a/finance/escrow/anchor/README.md b/finance/escrow/anchor/README.md index 3e7184ba5..0f3d632d5 100644 --- a/finance/escrow/anchor/README.md +++ b/finance/escrow/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/finance/escrow/anchor/programs/escrow/Cargo.toml b/finance/escrow/anchor/programs/escrow/Cargo.toml index 9503b3a5a..c1c09d0ae 100644 --- a/finance/escrow/anchor/programs/escrow/Cargo.toml +++ b/finance/escrow/anchor/programs/escrow/Cargo.toml @@ -22,16 +22,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -48,8 +43,14 @@ anchor-spl = "2.0.0-rc.1" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/finance/escrow/anchor/programs/escrow/tests/test_escrow.rs b/finance/escrow/anchor/programs/escrow/tests/test_escrow.rs index e3e8c656a..b8e8eb4fc 100644 --- a/finance/escrow/anchor/programs/escrow/tests/test_escrow.rs +++ b/finance/escrow/anchor/programs/escrow/tests/test_escrow.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, ErrorCode, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{ create_associated_token_account, create_token_mint, create_wallet, get_token_account_balance, mint_tokens_to_token_account, @@ -84,23 +84,24 @@ fn full_setup() -> EscrowSetup { // Token A is USDC and token B is TSLAx; the payer is the mint authority // of both. - let mint_a = create_token_mint(&mut svm, &payer, USDC_DECIMALS, None).unwrap(); - let mint_b = create_token_mint(&mut svm, &payer, TSLAX_DECIMALS, None).unwrap(); + let mint_a = create_token_mint(&mut svm, &payer, USDC_DECIMALS, None, None).unwrap(); + let mint_b = create_token_mint(&mut svm, &payer, TSLAX_DECIMALS, None, None).unwrap(); // Create ATAs let alice_ata_a = - create_associated_token_account(&mut svm, &alice.pubkey(), &mint_a, &payer).unwrap(); + create_associated_token_account(&mut svm, &alice.pubkey(), &mint_a, &payer, None).unwrap(); let alice_ata_b = - create_associated_token_account(&mut svm, &alice.pubkey(), &mint_b, &payer).unwrap(); + create_associated_token_account(&mut svm, &alice.pubkey(), &mint_b, &payer, None).unwrap(); let bob_ata_a = - create_associated_token_account(&mut svm, &bob.pubkey(), &mint_a, &payer).unwrap(); + create_associated_token_account(&mut svm, &bob.pubkey(), &mint_a, &payer, None).unwrap(); let bob_ata_b = - create_associated_token_account(&mut svm, &bob.pubkey(), &mint_b, &payer).unwrap(); + create_associated_token_account(&mut svm, &bob.pubkey(), &mint_b, &payer, None).unwrap(); // Both hold 1,000 USDC, and Bob holds the TSLAx. - mint_tokens_to_token_account(&mut svm, &mint_a, &alice_ata_a, ALICE_USDC, &payer).unwrap(); - mint_tokens_to_token_account(&mut svm, &mint_a, &bob_ata_a, BOB_USDC, &payer).unwrap(); - mint_tokens_to_token_account(&mut svm, &mint_b, &bob_ata_b, BOB_TSLAX, &payer).unwrap(); + mint_tokens_to_token_account(&mut svm, &mint_a, &alice_ata_a, ALICE_USDC, &payer, None) + .unwrap(); + mint_tokens_to_token_account(&mut svm, &mint_a, &bob_ata_a, BOB_USDC, &payer, None).unwrap(); + mint_tokens_to_token_account(&mut svm, &mint_b, &bob_ata_b, BOB_TSLAX, &payer, None).unwrap(); EscrowSetup { svm, @@ -166,6 +167,7 @@ fn test_make_offer() { vec![make_offer_ix], &[&es.payer, &es.alice], &es.payer.pubkey(), + None, ) .unwrap(); @@ -240,6 +242,7 @@ fn test_take_offer() { vec![make_offer_ix], &[&es.payer, &es.alice], &es.payer.pubkey(), + None, ) .unwrap(); @@ -279,6 +282,7 @@ fn test_take_offer() { vec![take_offer_ix], &[&es.payer, &es.bob], &es.payer.pubkey(), + None, ) .unwrap(); @@ -380,6 +384,7 @@ fn test_cancel_offer() { vec![make_offer_ix], &[&es.payer, &es.alice], &es.payer.pubkey(), + None, ) .unwrap(); @@ -409,6 +414,7 @@ fn test_cancel_offer() { vec![cancel_offer_ix], &[&es.payer, &es.alice], &es.payer.pubkey(), + None, ) .unwrap(); @@ -480,6 +486,7 @@ fn test_cancel_offer_rejects_non_maker() { vec![make_offer_ix], &[&es.payer, &es.alice], &es.payer.pubkey(), + None, ) .unwrap(); @@ -506,6 +513,7 @@ fn test_cancel_offer_rejects_non_maker() { vec![cancel_offer_ix], &[&es.payer, &es.bob], &es.payer.pubkey(), + None, ); assert_fails_with_anchor_error(result, ErrorCode::ConstraintAddress); } @@ -587,6 +595,7 @@ fn try_make_offer( vec![make_offer_ix], &[&es.payer, &es.alice], &es.payer.pubkey(), + None, ) } @@ -717,6 +726,7 @@ fn cancel_offer(es: &mut EscrowSetup, offer_id: u64) { vec![cancel_offer_ix], &[&es.payer, &es.alice], &es.payer.pubkey(), + None, ) .unwrap(); } @@ -779,6 +789,7 @@ fn assert_switched_offer_refused(switched_a_offered: u64, switched_b_wanted: u64 vec![take_offer_ix], &[&es.payer, &es.bob], &es.payer.pubkey(), + None, ); assert_fails_with(result, escrow::error::EscrowError::OfferTermsChanged); diff --git a/finance/escrow/native/Cargo.lock b/finance/escrow/native/Cargo.lock index 1ebb7fcca..795d32c58 100644 --- a/finance/escrow/native/Cargo.lock +++ b/finance/escrow/native/Cargo.lock @@ -38,88 +38,48 @@ dependencies = [ "zeroize", ] -[[package]] -name = "agave-bls12-381" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "210b1ef312273aa81ccb4c52687d96e3cf07621f3619a7998be20eb9741b08e3" -dependencies = [ - "blst", - "blstrs", - "bytemuck", - "bytemuck_derive", - "group", - "pairing", -] - [[package]] name = "agave-feature-set" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde74a2d1f2f99a3ea59938d1533c7973c344e47d24c1b645ee81e958c54226a" +checksum = "70940a29886a32d5c86192905a8df13d6b46f5b7f87baffac66e62b63fef5043" dependencies = [ "ahash", "solana-epoch-schedule", - "solana-hash 4.2.0", + "solana-hash", "solana-keypair", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sha256-hasher", "solana-svm-feature-set", ] [[package]] name = "agave-reserved-account-keys" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "798e559c514af005950ea81586a3856f9297ecb80a7359057c19bf6717f5f537" +checksum = "70e51a2c2a18b4dad3381f2e2df639d56fb58dbad50f3473367fcdbf029e7f95" dependencies = [ "agave-feature-set", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sdk-ids", ] [[package]] -name = "agave-syscalls" -version = "4.0.0" +name = "agave-transaction-view" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84debd4abe0cbab5a6aac2ee50e3969ef0e0961f7dff7e8f96bda0be7998bca2" +checksum = "83adf0eb2a269e96090deb451df68e72ed03bc3005bd8222dd82bdf33f8fbd08" dependencies = [ - "agave-bls12-381", - "bincode", - "libsecp256k1", - "num-traits", - "solana-account", - "solana-account-info", - "solana-big-mod-exp", - "solana-blake3-hasher", - "solana-bn254", - "solana-clock", - "solana-cpi", - "solana-curve25519", - "solana-hash 4.2.0", - "solana-instruction", - "solana-keccak-hasher", - "solana-loader-v3-interface", - "solana-poseidon", - "solana-program-entrypoint", - "solana-program-runtime", - "solana-pubkey 4.1.0", - "solana-sbpf", + "bytes", + "solana-hash", + "solana-message", + "solana-packet", + "solana-pubkey 4.3.0", "solana-sdk-ids", - "solana-secp256k1-recover", - "solana-sha256-hasher", - "solana-stable-layout", - "solana-stake-interface", - "solana-svm-callback", - "solana-svm-feature-set", - "solana-svm-log-collector", - "solana-svm-measure", - "solana-svm-timings", - "solana-svm-type-overrides", - "solana-sysvar 3.1.1", - "solana-sysvar-id", - "solana-transaction-context", - "thiserror 2.0.18", + "solana-short-vec", + "solana-signature", + "solana-svm-transaction", + "solana-transaction", ] [[package]] @@ -204,7 +164,7 @@ dependencies = [ "fnv", "hashbrown 0.15.5", "itertools 0.13.0", - "num-bigint 0.4.6", + "num-bigint", "num-integer", "num-traits", "zeroize", @@ -223,7 +183,7 @@ dependencies = [ "derivative", "digest 0.10.7", "itertools 0.10.5", - "num-bigint 0.4.6", + "num-bigint", "num-traits", "paste", "rustc_version", @@ -244,7 +204,7 @@ dependencies = [ "digest 0.10.7", "educe", "itertools 0.13.0", - "num-bigint 0.4.6", + "num-bigint", "num-traits", "paste", "zeroize", @@ -276,7 +236,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" dependencies = [ - "num-bigint 0.4.6", + "num-bigint", "num-traits", "proc-macro2", "quote", @@ -289,7 +249,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" dependencies = [ - "num-bigint 0.4.6", + "num-bigint", "num-traits", "proc-macro2", "quote", @@ -333,7 +293,7 @@ dependencies = [ "ark-serialize-derive 0.4.2", "ark-std 0.4.0", "digest 0.10.7", - "num-bigint 0.4.6", + "num-bigint", ] [[package]] @@ -346,7 +306,7 @@ dependencies = [ "ark-std 0.5.0", "arrayvec", "digest 0.10.7", - "num-bigint 0.4.6", + "num-bigint", ] [[package]] @@ -417,15 +377,9 @@ checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - -[[package]] -name = "base64" -version = "0.12.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" +checksum = "fd307490d624467aa6f74b0eabb77633d1f758a7b25f12bceb0b22e08d9726f6" [[package]] name = "base64" @@ -528,8 +482,8 @@ checksum = "7a8a8ed6fefbeef4a8c7b460e4110e12c5e22a5b7cf32621aae6ad650c4dcf29" dependencies = [ "blst", "byte-slice-cast", - "ff", - "group", + "ff 0.13.1", + "group 0.13.0", "pairing", "rand_core 0.6.4", "serde", @@ -587,9 +541,9 @@ checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" [[package]] name = "bytemuck" -version = "1.25.0" +version = "1.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8efb64bd706a16a1bdde310ae86b351e4d21550d98d056f22f8a7f7a2183fec" +checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" dependencies = [ "bytemuck_derive", ] @@ -613,9 +567,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae3f5d315924270530207e2a68396c3cc547f6dca3fbdca317cfb1a51edb593" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "cc" @@ -685,12 +639,24 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const-oid" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" + [[package]] name = "constant_time_eq" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" +[[package]] +name = "cpubits" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15b85f9c39137c3a891689859392b1bd49812121d0d61c9caf00d46ed5ce06ae" + [[package]] name = "cpufeatures" version = "0.2.17" @@ -717,12 +683,16 @@ checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "crypto-bigint" -version = "0.5.5" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +checksum = "9c035cb64cba03dad2fb921f3e218785e8cf9a41790da5eb3a1400f62fa2be11" dependencies = [ - "generic-array", - "rand_core 0.6.4", + "cpubits", + "ctutils", + "getrandom 0.4.3", + "hybrid-array", + "num-traits", + "rand_core 0.10.1", "subtle", "zeroize", ] @@ -744,7 +714,9 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453" dependencies = [ + "getrandom 0.4.3", "hybrid-array", + "rand_core 0.10.1", ] [[package]] @@ -758,11 +730,12 @@ dependencies = [ [[package]] name = "ctutils" -version = "0.4.2" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5515a3834141de9eafb9717ad39eea8247b5674e6066c404e8c4b365d2a29e" +checksum = "fe3e9d21d39e6f39ff46e03d5b621424f88ee23d8a1672c6bfc9ccc7f2da4f6a" dependencies = [ "cmov", + "subtle", ] [[package]] @@ -834,7 +807,17 @@ version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" dependencies = [ - "const-oid", + "const-oid 0.9.6", + "zeroize", +] + +[[package]] +name = "der" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a996a108feb8b427a6e12fcf6af4aa83409b79d72c15337d7741368131ee004" +dependencies = [ + "const-oid 0.10.2", "zeroize", ] @@ -871,7 +854,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", - "const-oid", "crypto-common 0.1.7", "subtle", ] @@ -883,6 +865,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" dependencies = [ "block-buffer 0.12.1", + "const-oid 0.10.2", "crypto-common 0.2.2", "ctutils", ] @@ -895,16 +878,17 @@ checksum = "abe71d579d1812060163dff96056261deb5bf6729b100fa2e36a68b9649ba3d3" [[package]] name = "ecdsa" -version = "0.16.9" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +checksum = "c0681a4fc24c767085329728d8dfba959af91228aa4610cca4f8ce317ba46ae0" dependencies = [ - "der", - "digest 0.10.7", + "der 0.8.3", + "digest 0.11.3", "elliptic-curve", "rfc6979", - "signature", - "spki", + "signature 3.0.0", + "spki 0.8.1", + "zeroize", ] [[package]] @@ -913,8 +897,8 @@ version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ - "pkcs8", - "signature", + "pkcs8 0.10.2", + "signature 2.2.0", ] [[package]] @@ -952,18 +936,19 @@ checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" [[package]] name = "elliptic-curve" -version = "0.13.8" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +checksum = "900f37e7e18d74a2347389af6cd69e3a30d5cc9e697f40004865679aa75e9c7c" dependencies = [ "base16ct", "crypto-bigint", - "digest 0.10.7", - "ff", - "generic-array", - "group", - "pkcs8", - "rand_core 0.6.4", + "crypto-common 0.2.2", + "digest 0.11.3", + "ff 0.14.0", + "group 0.14.0", + "hybrid-array", + "pkcs8 0.11.0", + "rand_core 0.10.1", "sec1", "subtle", "zeroize", @@ -1021,11 +1006,11 @@ version = "0.1.0" dependencies = [ "borsh", "litesvm", - "solana-instruction", + "solana-instruction 3.5.1", "solana-keypair", "solana-native-token", "solana-program", - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-system-interface 2.0.0", "solana-transaction", "spl-associated-token-account-interface", @@ -1050,6 +1035,16 @@ dependencies = [ "subtle", ] +[[package]] +name = "ff" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f686ab92a9fb0eaf188f6c6c87b89490baa6fdb0db4544ba4dc47f7942489f" +dependencies = [ + "rand_core 0.10.1", + "subtle", +] + [[package]] name = "fiat-crypto" version = "0.2.9" @@ -1092,6 +1087,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "funty" version = "2.0.0" @@ -1106,41 +1107,41 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", - "zeroize", ] [[package]] name = "getrandom" -version = "0.1.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ "cfg-if", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi", ] [[package]] name = "getrandom" -version = "0.2.17" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", "libc", - "wasi 0.11.1+wasi-snapshot-preview1", + "r-efi 5.3.0", + "wasip2", ] [[package]] name = "getrandom" -version = "0.3.4" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" dependencies = [ "cfg-if", "libc", - "r-efi", - "wasip2", + "r-efi 6.0.0", + "rand_core 0.10.1", ] [[package]] @@ -1155,13 +1156,24 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff", + "ff 0.13.1", "rand 0.8.6", "rand_core 0.6.4", "rand_xorshift", "subtle", ] +[[package]] +name = "group" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fd1a1c7a5206c5b7a3f5a0d7ccd3ff85d0c8f5133d62a02680255b0004af5f4" +dependencies = [ + "ff 0.14.0", + "rand_core 0.10.1", + "subtle", +] + [[package]] name = "hash32" version = "0.3.1" @@ -1187,6 +1199,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ "allocator-api2", + "equivalent", + "foldhash", ] [[package]] @@ -1201,6 +1215,15 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac 0.12.1", +] + [[package]] name = "hmac" version = "0.12.1" @@ -1210,13 +1233,24 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "hmac" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6303bc9732ae41b04cb554b844a762b4115a61bfaa81e3e83050991eeb56863f" +dependencies = [ + "digest 0.11.3", +] + [[package]] name = "hybrid-array" version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "818356c5132c1fede50f837ca96afbe78ff42413047f4abb886217845e1b6c8c" dependencies = [ + "subtle", "typenum", + "zeroize", ] [[package]] @@ -1271,6 +1305,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b4baf93f58d4425749ca49a51c50ebab072c5df6994d08fed93541c331481dc" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.18" @@ -1279,16 +1322,17 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "k256" -version = "0.13.4" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +checksum = "93f50113171a713f4a4231ef82eb26703607139b35dcb56241f0ceab2ae1f7d8" dependencies = [ - "cfg-if", + "cpubits", "ecdsa", "elliptic-curve", - "once_cell", - "sha2 0.10.9", - "signature", + "primeorder", + "sha2 0.11.1", + "signature 3.0.0", + "wnaf", ] [[package]] @@ -1314,26 +1358,26 @@ checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] name = "libsecp256k1" -version = "0.6.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" +checksum = "e79019718125edc905a079a70cfa5f3820bc76139fc91d6f9abc27ea2a887139" dependencies = [ "arrayref", - "base64 0.12.3", + "base64", "digest 0.9.0", "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand 0.7.3", + "rand 0.8.6", "serde", "sha2 0.9.9", ] [[package]] name = "libsecp256k1-core" -version = "0.2.2" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" dependencies = [ "crunchy", "digest 0.9.0", @@ -1342,18 +1386,18 @@ dependencies = [ [[package]] name = "libsecp256k1-gen-ecmult" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" dependencies = [ "libsecp256k1-core", ] [[package]] name = "libsecp256k1-gen-genmult" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" dependencies = [ "libsecp256k1-core", ] @@ -1366,7 +1410,7 @@ checksum = "3c9a85a9752c549ceb7578064b4ed891179d20acd85f27318573b64d2d7ee7ee" dependencies = [ "ark-bn254 0.4.0", "ark-ff 0.4.2", - "num-bigint 0.4.6", + "num-bigint", "thiserror 1.0.69", ] @@ -1378,47 +1422,43 @@ checksum = "47a1ccadd0bb5a32c196da536fd72c59183de24a055f6bf0513bf845fefab862" dependencies = [ "ark-bn254 0.5.0", "ark-ff 0.5.0", - "num-bigint 0.4.6", + "num-bigint", "thiserror 1.0.69", ] [[package]] name = "litesvm" -version = "0.13.1" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1e00083aad2a7aa9d6900454604f7776da40be57304e5119f09222a1e9b105a" +checksum = "b8fe187ac113cebaa49af5dce82dfd1084177e5434d78815f409a6a22676b294" dependencies = [ "agave-feature-set", "agave-reserved-account-keys", - "agave-syscalls", "ansi_term", - "bincode", "indexmap", - "itertools 0.14.0", + "itertools 0.15.0", "log", - "serde", "solana-account", - "solana-address 2.6.1", + "solana-address 2.7.0", "solana-address-lookup-table-interface", - "solana-bpf-loader-program", "solana-builtins", - "solana-clock", + "solana-clock 3.2.1", "solana-compute-budget", "solana-compute-budget-instruction", "solana-epoch-rewards", "solana-epoch-schedule", "solana-feature-gate-interface", "solana-fee", + "solana-fee-calculator", "solana-fee-structure", - "solana-hash 4.2.0", - "solana-instruction", + "solana-hash", + "solana-instruction 3.5.1", "solana-instruction-error", - "solana-instructions-sysvar", + "solana-instructions-sysvar 4.0.0", "solana-keypair", "solana-last-restart-slot", - "solana-loader-v3-interface", + "solana-loader-v3-interface 8.1.1", "solana-loader-v4-interface", - "solana-loader-v4-program", "solana-message", "solana-native-token", "solana-nonce", @@ -1426,26 +1466,29 @@ dependencies = [ "solana-precompile-error", "solana-program-error", "solana-program-runtime", - "solana-rent 3.1.0", + "solana-rent", + "solana-runtime-transaction", "solana-sdk-ids", "solana-sha256-hasher", "solana-signature", "solana-signer", "solana-slot-hashes", "solana-slot-history", - "solana-stake-interface", + "solana-stake-history", "solana-svm-callback", "solana-svm-log-collector", "solana-svm-timings", "solana-svm-transaction", - "solana-system-interface 3.1.0", + "solana-syscalls", + "solana-system-interface 3.3.0", "solana-system-program", - "solana-sysvar 3.1.1", + "solana-sysvar", "solana-sysvar-id", "solana-transaction", "solana-transaction-context", "solana-transaction-error", - "thiserror 2.0.18", + "thiserror 2.0.21", + "wincode", ] [[package]] @@ -1490,31 +1533,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "num" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8536030f9fea7127f841b45bb6243b27255787fb4eb83958aa1ef9d2fdc0c36" -dependencies = [ - "num-bigint 0.2.6", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - [[package]] name = "num-bigint" version = "0.4.6" @@ -1525,16 +1543,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-complex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b19411a9719e753aff12e5187b74d60d3dc449ec3f4dc21e3989c3f554bc95" -dependencies = [ - "autocfg", - "num-traits", -] - [[package]] name = "num-derive" version = "0.4.2" @@ -1555,29 +1563,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "num-iter" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c000134b5dbf44adc5cb772486d335293351644b801551abe8f75c84cfa4aef" -dependencies = [ - "autocfg", - "num-bigint 0.2.6", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1637,7 +1622,7 @@ version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81fec4625e73cf41ef4bb6846cafa6d44736525f442ba45e407c4a000a13996f" dependencies = [ - "group", + "group 0.13.0", ] [[package]] @@ -1691,22 +1676,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] -name = "percentage" -version = "0.1.0" +name = "pkcs8" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd23b938276f14057220b707937bcb42fa76dda7560e57a2da30cb52d557937" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "num", + "der 0.7.10", + "spki 0.7.3", ] [[package]] name = "pkcs8" -version = "0.10.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +checksum = "451913da69c775a56034ea8d9003d27ee8948e12443eae7c038ba100a4f21cb7" dependencies = [ - "der", - "spki", + "der 0.8.3", + "spki 0.8.1", ] [[package]] @@ -1730,6 +1716,33 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "primefield" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c555a6e4eb7d4e158fcb028c835c3b8642206ddc279b5c6b202ef9a8bdb592f4" +dependencies = [ + "crypto-bigint", + "crypto-common 0.2.2", + "ff 0.14.0", + "rand_core 0.10.1", + "subtle", + "zeroize", +] + +[[package]] +name = "primeorder" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c9f42978c78a00e3d68f69fc03e57a234debae69da4020a4fb588fcdcd07b06" +dependencies = [ + "elliptic-curve", + "once_cell", + "primefield", + "serdect", + "wnaf", +] + [[package]] name = "proc-macro-crate" version = "3.5.0" @@ -1784,23 +1797,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" [[package]] -name = "radium" -version = "0.7.0" +name = "r-efi" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" [[package]] -name = "rand" -version = "0.7.3" +name = "radium" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom 0.1.16", - "libc", - "rand_chacha 0.2.2", - "rand_core 0.5.1", - "rand_hc", -] +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] name = "rand" @@ -1824,13 +1830,13 @@ dependencies = [ ] [[package]] -name = "rand_chacha" -version = "0.2.2" +name = "rand" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af" dependencies = [ - "ppv-lite86", - "rand_core 0.5.1", + "getrandom 0.4.3", + "rand_core 0.10.1", ] [[package]] @@ -1853,15 +1859,6 @@ dependencies = [ "rand_core 0.9.5", ] -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom 0.1.16", -] - [[package]] name = "rand_core" version = "0.6.4" @@ -1881,13 +1878,10 @@ dependencies = [ ] [[package]] -name = "rand_hc" -version = "0.2.0" +name = "rand_core" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core 0.5.1", -] +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" [[package]] name = "rand_xorshift" @@ -1909,12 +1903,12 @@ dependencies = [ [[package]] name = "rfc6979" -version = "0.4.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +checksum = "b4a459cddafb3fe76b31fd8f1108007566c40301feb64dc7b54656eb7388172b" dependencies = [ - "hmac", - "subtle", + "crypto-bigint", + "hmac 0.13.0", ] [[package]] @@ -1946,14 +1940,14 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sec1" -version = "0.7.3" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +checksum = "d56d437c2f19203ce5f7122e507831de96f3d2d4d3be5af44a0b0a09d8a80e4d" dependencies = [ "base16ct", - "der", - "generic-array", - "pkcs8", + "ctutils", + "der 0.8.3", + "hybrid-array", "subtle", "zeroize", ] @@ -1966,23 +1960,14 @@ checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" [[package]] name = "serde" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" dependencies = [ "serde_core", "serde_derive", ] -[[package]] -name = "serde-big-array" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11fc7cc2c76d73e0f27ee52abbd64eec84d46f370c88371120433196934e4b7f" -dependencies = [ - "serde", -] - [[package]] name = "serde_bytes" version = "0.11.19" @@ -1995,22 +1980,22 @@ dependencies = [ [[package]] name = "serde_core" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.228" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 3.0.9", ] [[package]] @@ -2048,6 +2033,16 @@ dependencies = [ "syn 2.0.118", ] +[[package]] +name = "serdect" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66cf8fedced2fcf12406bcb34223dffb92eaf34908ede12fed414c82b7f00b3e" +dependencies = [ + "base16ct", + "serde", +] + [[package]] name = "sha2" version = "0.9.9" @@ -2072,6 +2067,17 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha2" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47d7069beb7d6ac7b9acd1039986e73443f24234f41074da099d6f994ac9ad19" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "digest 0.11.3", +] + [[package]] name = "sha2-const-stable" version = "0.1.0" @@ -2100,10 +2106,19 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ - "digest 0.10.7", "rand_core 0.6.4", ] +[[package]] +name = "signature" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d567dcbaf0049cb8ac2608a76cd95ff9e4412e1899d389ee400918ca7537f5" +dependencies = [ + "digest 0.11.3", + "rand_core 0.10.1", +] + [[package]] name = "smallvec" version = "1.15.2" @@ -2112,20 +2127,21 @@ checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" [[package]] name = "solana-account" -version = "3.4.0" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efc0ed36decb689413b9da5d57f2be49eea5bebb3cf7897015167b0c4336e731" +checksum = "981155967c57428348ca75b2296e079688d09bf16c5751502eaa49f65da83cb1" dependencies = [ "bincode", "serde", "serde_bytes", "serde_derive", "solana-account-info", - "solana-clock", + "solana-clock 3.2.1", "solana-instruction-error", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sdk-ids", - "solana-sysvar 3.1.1", + "solana-sysvar", + "wincode", ] [[package]] @@ -2136,7 +2152,7 @@ checksum = "a9cf16495d9eb53e3d04e72366a33bb1c20c24e78c171d8b8f5978357b63ae95" dependencies = [ "bincode", "serde_core", - "solana-address 2.6.1", + "solana-address 2.7.0", "solana-program-error", "solana-program-memory", ] @@ -2147,14 +2163,14 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2ecac8e1b7f74c2baa9e774c42817e3e75b20787134b76cc4d45e8a604488f5" dependencies = [ - "solana-address 2.6.1", + "solana-address 2.7.0", ] [[package]] name = "solana-address" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c93e262f671bf402e1040e4a7e40b05d81da5956c7681948c975a0997517bb" +checksum = "01332a01c0a3098404d55a724c8d9a92aed4a50fe40a7dd0c7a51e29274c14de" dependencies = [ "borsh", "bytemuck", @@ -2162,31 +2178,32 @@ dependencies = [ "curve25519-dalek", "five8", "five8_const", + "rand 0.9.4", "serde", "serde_derive", "sha2-const-stable", "solana-atomic-u64", - "solana-define-syscall 5.1.0", + "solana-define-syscall 5.3.0", "solana-program-error", "solana-sanitize", "solana-sha256-hasher", - "wincode 0.5.5", + "wincode", ] [[package]] name = "solana-address-lookup-table-interface" -version = "3.0.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e8df0b083c10ce32490410f3795016b1b5d9b4d094658c0a5e496753645b7cd" +checksum = "8dedafa11d25554279235dd0539d378adc144183eca65072a302c9592cc6a591" dependencies = [ "bincode", "bytemuck", "serde", "serde_derive", - "solana-clock", - "solana-instruction", + "solana-clock 3.2.1", + "solana-instruction 3.5.1", "solana-instruction-error", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sdk-ids", "solana-slot-hashes", ] @@ -2206,11 +2223,21 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30c80fb6d791b3925d5ec4bf23a7c169ef5090c013059ec3ed7d0b2c04efa085" dependencies = [ - "num-bigint 0.4.6", + "num-bigint", "num-traits", "solana-define-syscall 3.0.0", ] +[[package]] +name = "solana-big-mod-exp" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05789c4afc39164132db9dcc117218d412ca1f1271d2c629fc6f554c19e5a44" +dependencies = [ + "num-bigint", + "solana-define-syscall 5.3.0", +] + [[package]] name = "solana-bincode" version = "3.1.0" @@ -2230,27 +2257,42 @@ checksum = "7116e1d942a2432ca3f514625104757ab8a56233787e95144c93950029e31176" dependencies = [ "blake3", "solana-define-syscall 4.0.1", - "solana-hash 4.2.0", + "solana-hash", ] [[package]] name = "solana-bls-signatures" -version = "3.2.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3d8a6e1a009bddbdbfe13ee6ff206c16afa9f8fae7d04612d779ac2254ad5f" +checksum = "3f7e9dbeff4dab3484175666a367171b60fe514b707d6de1ab3b741f0168e735" dependencies = [ - "base64 0.22.1", + "base64", "blst", "blstrs", "cfg_eval", - "ff", - "group", + "ff 0.13.1", + "group 0.13.0", "pairing", "rand 0.8.6", "serde", "serde_json", "serde_with", - "thiserror 2.0.18", + "thiserror 2.0.21", + "wincode", + "zeroize", +] + +[[package]] +name = "solana-bls12-381-syscall" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94e8256fda0542709fd1320a96d81c3c66e10ac5f680cca9b991d7d3b0e3fe86" +dependencies = [ + "blst", + "blstrs", + "bytemuck", + "bytemuck_derive", + "pairing", ] [[package]] @@ -2264,8 +2306,8 @@ dependencies = [ "ark-ff 0.5.0", "ark-serialize 0.5.0", "bytemuck", - "solana-define-syscall 5.1.0", - "thiserror 2.0.18", + "solana-define-syscall 5.3.0", + "thiserror 2.0.21", ] [[package]] @@ -2279,46 +2321,43 @@ dependencies = [ [[package]] name = "solana-bpf-loader-program" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219bfba64973ac9e64aa181f03fd56ac319e2d50d8a23d16c54bbd7fa9807a47" +checksum = "bcb78ed7a639359ebc07d0a765d33e9b61e81dbc6790399e1ef68e2869305890" dependencies = [ - "agave-syscalls", "bincode", "qualifier_attr", "solana-account", "solana-bincode", - "solana-clock", - "solana-instruction", - "solana-loader-v3-interface", - "solana-loader-v4-interface", + "solana-clock 3.2.1", + "solana-instruction 3.5.1", + "solana-loader-v3-interface 7.0.0", "solana-packet", - "solana-program-entrypoint", "solana-program-runtime", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sbpf", "solana-sdk-ids", "solana-svm-feature-set", "solana-svm-log-collector", "solana-svm-measure", "solana-svm-type-overrides", - "solana-system-interface 3.1.0", + "solana-syscalls", + "solana-system-interface 3.3.0", "solana-transaction-context", ] [[package]] name = "solana-builtins" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dda9d147935c741533496edf72c5b712885d4793a0bca13a21bd75d8f5dc30e9" +checksum = "9eee096dc70609ccdd247ca587f57f466bba39cfc348dcee70bc457aa5ed6b44" dependencies = [ "agave-feature-set", "solana-bpf-loader-program", "solana-compute-budget-program", - "solana-hash 4.2.0", - "solana-loader-v4-program", + "solana-hash", "solana-program-runtime", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sdk-ids", "solana-system-program", "solana-vote-program", @@ -2328,27 +2367,30 @@ dependencies = [ [[package]] name = "solana-builtins-default-costs" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3167997e8ac0fe100c4ed54503568d22204aeda56f4d3549e0c09a700b609aa8" +checksum = "fb5e6761778ff426e7310795c63f42679199f1dc0ee34a616b63cdd481c5b31c" dependencies = [ "agave-feature-set", "ahash", - "log", - "solana-bpf-loader-program", - "solana-compute-budget-program", - "solana-loader-v4-program", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sdk-ids", - "solana-system-program", - "solana-vote-program", ] [[package]] name = "solana-clock" -version = "3.1.1" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f536b035433918d204397c2989d3c75f0d57af6948c3235599cfe909038af43" +dependencies = [ + "solana-clock 4.0.0", +] + +[[package]] +name = "solana-clock" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0acdace90d96e2c9e70d681465b4fe888b6bcf27c354ae9774e9f8a3b72923d" +checksum = "178fc0c31655aa16190cc112919dcdf279437e14b2f2f9790fe1ec29157ff20c" dependencies = [ "serde", "serde_derive", @@ -2356,13 +2398,14 @@ dependencies = [ "solana-sdk-ids", "solana-sdk-macro", "solana-sysvar-id", + "wincode", ] [[package]] name = "solana-compute-budget" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b591fbaed6d9ab4cba6a5a82eb5df208072ced2e5b74c59e9d309ff87af0615f" +checksum = "48ab34f04fa0a5de43c630a1afb415f093066acbf0882ee5f19bf18362a03e52" dependencies = [ "solana-fee-structure", "solana-program-runtime", @@ -2370,41 +2413,38 @@ dependencies = [ [[package]] name = "solana-compute-budget-instruction" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006d9b6a34f9d7b719100653317990ed55e572107702104c054133b40f587306" +checksum = "df4efee43d4ccbd4017cfaf690d6339010a3ebf8913186b4fc36545a88959416" dependencies = [ "agave-feature-set", - "log", "solana-borsh", "solana-builtins-default-costs", "solana-compute-budget", "solana-compute-budget-interface", - "solana-instruction", - "solana-packet", - "solana-pubkey 4.1.0", + "solana-instruction 3.5.1", + "solana-pubkey 4.3.0", "solana-sdk-ids", "solana-svm-transaction", "solana-transaction-error", - "thiserror 2.0.18", ] [[package]] name = "solana-compute-budget-interface" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8292c436b269ad23cecc8b24f7da3ab07ca111661e25e00ce0e1d22771951ab9" +checksum = "0139c131989ae133c23b31c04ecf03949c198a335e5dc028ddd54bb5c9fe6ee8" dependencies = [ "borsh", - "solana-instruction", + "solana-instruction 3.5.1", "solana-sdk-ids", ] [[package]] name = "solana-compute-budget-program" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a22bcf5088ebe5cb2aa548580d0a466de813032b425707a7745a2a63a7764cdc" +checksum = "6bcbb61fa41b917b59850feb8f7f588317611898af10611fe6977207511d1177" dependencies = [ "solana-program-runtime", ] @@ -2417,9 +2457,9 @@ checksum = "4dea26709d867aada85d0d3617db0944215c8bb28d3745b912de7db13a23280c" dependencies = [ "solana-account-info", "solana-define-syscall 4.0.1", - "solana-instruction", + "solana-instruction 3.5.1", "solana-program-error", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-stable-layout", ] @@ -2432,9 +2472,9 @@ dependencies = [ "bytemuck", "bytemuck_derive", "curve25519-dalek", - "solana-define-syscall 5.1.0", + "solana-define-syscall 5.3.0", "subtle", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -2451,9 +2491,9 @@ checksum = "57e5b1c0bc1d4a4d10c88a4100499d954c09d3fecfae4912c1a074dff68b1738" [[package]] name = "solana-define-syscall" -version = "5.1.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e14a4f604117f379840956a8fc8695e4c84f5b0ebed192f31f60d9b85d581d" +checksum = "e4d02bb1453b6f9e1e705383a44b98a8722669b44adcdfe3643183987fdad72e" [[package]] name = "solana-derivation-path" @@ -2466,31 +2506,56 @@ dependencies = [ "uriparse", ] +[[package]] +name = "solana-ed25519" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff4c7caf3fe3d70815869a5838ee45b4d2b009eaacea1790ef3cd9b3c89edbbd" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "curve25519-dalek-derive", + "digest 0.11.3", + "ed25519", + "hashbrown 0.15.5", + "rand 0.10.3", + "rand_core 0.10.1", + "rustc_version", + "sha2 0.11.1", + "subtle", + "zeroize", +] + [[package]] name = "solana-epoch-rewards" -version = "3.0.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5e7b0ba210593ba8ddd39d6d234d81795d1671cebf3026baa10d5dc23ac42f0" +checksum = "0788d74ee15778deecaa15ed1a1e37727ba954f86cbc35225450a1f2b5012969" dependencies = [ "serde", "serde_derive", - "solana-hash 4.2.0", + "solana-get-sysvar", + "solana-hash", "solana-sdk-ids", "solana-sdk-macro", "solana-sysvar-id", + "wincode", ] [[package]] name = "solana-epoch-schedule" -version = "3.0.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e5481e72cc4d52c169db73e4c0cd16de8bc943078aac587ec4817a75cc6388f" +checksum = "a1633cfd10cde127f2caf8f12021b4f8e9a425e7e4eea4326e428c422376d6fd" dependencies = [ "serde", "serde_derive", + "solana-get-sysvar", + "solana-program-error", "solana-sdk-ids", "solana-sdk-macro", "solana-sysvar-id", + "wincode", ] [[package]] @@ -2499,8 +2564,8 @@ version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "027e6d0b9e7daac5b2ac7c3f9ca1b727861121d9ef05084cf435ff736051e7c2" dependencies = [ - "solana-define-syscall 5.1.0", - "solana-pubkey 4.1.0", + "solana-define-syscall 5.3.0", + "solana-pubkey 4.3.0", ] [[package]] @@ -2511,61 +2576,61 @@ checksum = "0eb265ff95e28eceda117e2e3d2d2a611ecbbfe911dfeeeecd1521814540ffab" dependencies = [ "serde", "serde_derive", - "solana-hash 4.2.0", - "solana-instruction", + "solana-hash", + "solana-instruction 3.5.1", "solana-nonce", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sdk-ids", - "solana-system-interface 3.1.0", - "thiserror 2.0.18", + "solana-system-interface 3.3.0", + "thiserror 2.0.21", ] [[package]] name = "solana-feature-gate-interface" -version = "3.1.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75ca9b5cbb6f500f7fd73db5bd95640f71a83f04d6121a0e59a43b202dca2731" +checksum = "bd7545e02f91da1d6996f32b18f7796aa01e0682f8f3a7434b82cd1a10448add" dependencies = [ "bincode", "serde", "serde_derive", "solana-account", "solana-account-info", - "solana-instruction", + "solana-instruction 3.5.1", "solana-program-error", - "solana-pubkey 4.1.0", - "solana-rent 4.3.0", + "solana-pubkey 4.3.0", + "solana-rent", "solana-sdk-ids", - "solana-system-interface 3.1.0", + "solana-system-interface 3.3.0", ] [[package]] name = "solana-fee" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e506f6ec94e5733b0f2114b43bd8a2abac33a0256e19c65e1d119de008981339" +checksum = "aef1955027445b05366d9c550507f45cafb2310949a3ffdd41a72d70aa94c940" dependencies = [ - "agave-feature-set", "solana-fee-structure", "solana-svm-transaction", ] [[package]] name = "solana-fee-calculator" -version = "3.2.2" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef67f01cc6a0c72e99a08d0d484683f995de4c80e9568728fa77d1537f9b7e09" +checksum = "d4bf4f4afb4704212ef1d994ee65bef7293441721639dfd16f0e60996f37be51" dependencies = [ "log", "serde", "serde_derive", + "wincode", ] [[package]] name = "solana-fee-structure" -version = "3.0.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e2abdb1223eea8ec64136f39cb1ffcf257e00f915c957c35c0dd9e3f4e700b0" +checksum = "3591f4827715ebb49c290b829f707ec1747a152973436f27699897f752a31cd6" [[package]] name = "solana-get-sysvar" @@ -2573,25 +2638,16 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef3bc859fc036ed490146793557386cbfae614ebba4adc704c37d94350824ed4" dependencies = [ - "solana-address 2.6.1", - "solana-define-syscall 5.1.0", + "solana-address 2.7.0", + "solana-define-syscall 5.3.0", "solana-program-error", ] [[package]] name = "solana-hash" -version = "3.1.0" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "337c246447142f660f778cf6cb582beba8e28deb05b3b24bfb9ffd7c562e5f41" -dependencies = [ - "solana-hash 4.2.0", -] - -[[package]] -name = "solana-hash" -version = "4.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8064ea1d591ec791be95245058ca40f4f5345d390c200069d0f79bbf55bfae55" +checksum = "0df9b01495ed31100aca97a7f5862d5e19ab1636d60d1a9f02391408dd9dec84" dependencies = [ "borsh", "bytemuck", @@ -2599,35 +2655,48 @@ dependencies = [ "five8", "serde", "serde_derive", - "solana-atomic-u64", "solana-sanitize", - "wincode 0.4.9", + "wincode", ] +[[package]] +name = "solana-hash-512" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee9c987913768643be3f4fc5f8ec667e8ec19e59e6d131688ade8d1430dafe9" + [[package]] name = "solana-instruction" -version = "3.2.0" +version = "3.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6a6d22d0a6fdf345be294bb9afdcd40c296cdc095e64e7ceaa3bb3c2f608c1c" +checksum = "6d8f113d1312870e2d8698033e9d153d3329c520e1065f05145a55a889e21c91" +dependencies = [ + "solana-instruction 4.0.0", + "solana-instruction-error", +] + +[[package]] +name = "solana-instruction" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ea8442b67a58dd54d5497bfc6cd3106b00f9fe6f6877d33c271c3ec4672eedc" dependencies = [ "bincode", "borsh", "serde", "serde_derive", - "solana-define-syscall 5.1.0", - "solana-instruction-error", - "solana-pubkey 4.1.0", + "solana-define-syscall 5.3.0", + "solana-pubkey 4.3.0", + "wincode", ] [[package]] name = "solana-instruction-error" -version = "2.2.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d3d048edaaeef5a3dc8c01853e585539a74417e4c2d43a9e2c161270045b838" +checksum = "e8e7db78c122d02189619490b1fef04a2a042c389662920617c0e6381fdf8fdd" dependencies = [ "num-traits", - "serde", - "serde_derive", "solana-program-error", ] @@ -2639,7 +2708,7 @@ checksum = "7ddf67876c541aa1e21ee1acae35c95c6fbc61119814bfef70579317a5e26955" dependencies = [ "bitflags", "solana-account-info", - "solana-instruction", + "solana-instruction 3.5.1", "solana-instruction-error", "solana-program-error", "solana-pubkey 3.0.0", @@ -2649,6 +2718,23 @@ dependencies = [ "solana-sysvar-id", ] +[[package]] +name = "solana-instructions-sysvar" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e38363a181313d607f7a118df2b401bb27b477a0104b09283cbf504f5f0f00cc" +dependencies = [ + "bitflags", + "solana-account-info", + "solana-instruction 3.5.1", + "solana-instruction-error", + "solana-program-error", + "solana-sanitize", + "solana-sdk-ids", + "solana-serialize-utils", + "solana-sysvar-id", +] + [[package]] name = "solana-keccak-hasher" version = "3.1.0" @@ -2657,7 +2743,7 @@ checksum = "ed1c0d16d6fdeba12291a1f068cdf0d479d9bff1141bf44afd7aa9d485f65ef8" dependencies = [ "sha3", "solana-define-syscall 4.0.1", - "solana-hash 4.2.0", + "solana-hash", ] [[package]] @@ -2670,7 +2756,7 @@ dependencies = [ "five8", "five8_core", "rand 0.9.4", - "solana-address 2.6.1", + "solana-address 2.7.0", "solana-seed-phrase", "solana-signature", "solana-signer", @@ -2678,9 +2764,9 @@ dependencies = [ [[package]] name = "solana-last-restart-slot" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22474b83d3c7c318e1c3a725784fc2d1d03b728e36369e58ce48769a61ed85e" +checksum = "5099e736c3c06c451b307a60637d69eb65b3144143ebeed899e2fd1134f4fc35" dependencies = [ "serde", "serde_derive", @@ -2688,79 +2774,62 @@ dependencies = [ "solana-sdk-ids", "solana-sdk-macro", "solana-sysvar-id", + "wincode", ] [[package]] name = "solana-loader-v3-interface" -version = "6.1.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee44c9b1328c5c712c68966fb8de07b47f3e7bac006e74ddd1bb053d3e46e5d" +checksum = "68029ab11d9c891d4ce23ada75745e40f983c5674af366f447b672569634231b" dependencies = [ "serde", "serde_bytes", "serde_derive", - "solana-instruction", - "solana-pubkey 3.0.0", + "solana-instruction 3.5.1", + "solana-pubkey 4.3.0", "solana-sdk-ids", ] [[package]] -name = "solana-loader-v4-interface" -version = "3.1.0" +name = "solana-loader-v3-interface" +version = "8.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c948b33ff81fa89699911b207059e493defdba9647eaf18f23abdf3674e0fb" +checksum = "46255f7494fa739cb0c65ad43aaa12f49d1ed884d8632f0437b9c91ce48a936a" dependencies = [ - "serde", - "serde_bytes", - "serde_derive", - "solana-instruction", - "solana-pubkey 3.0.0", + "solana-instruction 3.5.1", + "solana-pubkey 4.3.0", "solana-sdk-ids", - "solana-system-interface 2.0.0", + "solana-system-interface 3.3.0", + "wincode", ] [[package]] -name = "solana-loader-v4-program" -version = "4.0.0" +name = "solana-loader-v4-interface" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b5191cd34f04e4ec9fd5f2ac8a431ba9ffd6c827511fd35f2cae0256a0c6b12" +checksum = "e4c948b33ff81fa89699911b207059e493defdba9647eaf18f23abdf3674e0fb" dependencies = [ - "log", - "solana-account", - "solana-bincode", - "solana-bpf-loader-program", - "solana-instruction", - "solana-loader-v3-interface", - "solana-loader-v4-interface", - "solana-packet", - "solana-program-runtime", - "solana-pubkey 4.1.0", - "solana-sbpf", + "solana-instruction 3.5.1", + "solana-pubkey 3.0.0", "solana-sdk-ids", - "solana-svm-log-collector", - "solana-svm-measure", - "solana-svm-type-overrides", - "solana-transaction-context", ] [[package]] name = "solana-message" -version = "3.1.0" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0448b1fd891c5f46491e5dc7d9986385ba3c852c340db2911dd29faa01d2b08d" +checksum = "ef4b58f6d685adebefc945f28cf051cf3c11e295233e6dd3adfc0a71c3c6fb76" dependencies = [ - "bincode", "blake3", - "lazy_static", - "serde", - "serde_derive", - "solana-address 2.6.1", - "solana-hash 4.2.0", - "solana-instruction", + "solana-address 2.7.0", + "solana-hash", + "solana-instruction 3.5.1", "solana-sanitize", "solana-sdk-ids", "solana-short-vec", "solana-transaction-error", + "wincode", ] [[package]] @@ -2769,7 +2838,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726b7cbbc6be6f1c6f29146ac824343b9415133eee8cce156452ad1db93f8008" dependencies = [ - "solana-define-syscall 5.1.0", + "solana-define-syscall 5.3.0", ] [[package]] @@ -2780,38 +2849,45 @@ checksum = "ae8dd4c280dca9d046139eb5b7a5ac9ad10403fbd64964c7d7571214950d758f" [[package]] name = "solana-nonce" -version = "3.1.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc469152a63284ef959b80c59cda015262a021da55d3b8fe42171d89c4b64f8" +checksum = "1f13b7ec92de6dd4ef713ed763d22585efa0042cd244bce81997e52077885c47" dependencies = [ "serde", "serde_derive", "solana-fee-calculator", - "solana-hash 4.2.0", - "solana-pubkey 4.1.0", + "solana-hash", + "solana-pubkey 4.3.0", "solana-sha256-hasher", + "wincode", ] [[package]] name = "solana-nonce-account" -version = "3.0.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "805fd25b29e5a1a0e6c3dd6320c9da80f275fbe4ff6e392617c303a2085c435e" +checksum = "337cf70e23d7e33d61e5020106ae9894fe10434b3de943e8bc57eb5d7207c1bf" dependencies = [ "solana-account", - "solana-hash 3.1.0", + "solana-hash", "solana-nonce", "solana-sdk-ids", ] +[[package]] +name = "solana-nullable" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "889194d8c5faec648f2f6fadddb60566249921ebb074e2707e7095458d5864e2" + [[package]] name = "solana-packet" -version = "4.1.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad62e1045c2347a0c0e219a6ceb0abfe904be622920996bfcac8d116fabe3c7" +checksum = "0d52aa155d0a8f35de2ded492c1711dfc74795b12de45f199834ccc20da3177b" dependencies = [ "bitflags", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", ] [[package]] @@ -2825,7 +2901,7 @@ dependencies = [ "light-poseidon 0.2.0", "light-poseidon 0.4.0", "solana-define-syscall 4.0.1", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -2845,21 +2921,21 @@ checksum = "778f08fb0eaf52c9a3bef2978247f7fab0ccfddc44cfddb936d5ad9f98ede886" dependencies = [ "memoffset", "solana-account-info", - "solana-big-mod-exp", + "solana-big-mod-exp 3.0.0", "solana-blake3-hasher", "solana-borsh", - "solana-clock", + "solana-clock 3.2.1", "solana-cpi", - "solana-define-syscall 5.1.0", + "solana-define-syscall 5.3.0", "solana-epoch-rewards", "solana-epoch-schedule", "solana-epoch-stake", "solana-example-mocks", "solana-fee-calculator", - "solana-hash 4.2.0", - "solana-instruction", + "solana-hash", + "solana-instruction 3.5.1", "solana-instruction-error", - "solana-instructions-sysvar", + "solana-instructions-sysvar 3.0.0", "solana-keccak-hasher", "solana-last-restart-slot", "solana-msg", @@ -2869,8 +2945,8 @@ dependencies = [ "solana-program-memory", "solana-program-option", "solana-program-pack", - "solana-pubkey 4.1.0", - "solana-rent 4.3.0", + "solana-pubkey 4.3.0", + "solana-rent", "solana-sdk-ids", "solana-secp256k1-recover", "solana-serde-varint", @@ -2880,7 +2956,7 @@ dependencies = [ "solana-slot-hashes", "solana-slot-history", "solana-stable-layout", - "solana-sysvar 4.0.0", + "solana-sysvar", "solana-sysvar-id", ] @@ -2893,7 +2969,7 @@ dependencies = [ "solana-account-info", "solana-define-syscall 4.0.1", "solana-program-error", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", ] [[package]] @@ -2933,36 +3009,35 @@ dependencies = [ [[package]] name = "solana-program-runtime" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6c7f89c89d5ff25f64a41c8cb00478b1d62f941f14a7dd8537c9e50bb2acc92" +checksum = "88c8bc45f8c07f5eb88dd0621e1ec4541accfaa33c0bdf03de40082e88ee5f49" dependencies = [ - "base64 0.22.1", + "base64", "bincode", "cfg-if", "itertools 0.14.0", "log", - "percentage", "rand 0.9.4", "serde", "solana-account", "solana-account-info", - "solana-clock", + "solana-clock 3.2.1", "solana-epoch-rewards", "solana-epoch-schedule", "solana-fee-structure", - "solana-hash 4.2.0", - "solana-instruction", + "solana-hash", + "solana-instruction 3.5.1", "solana-last-restart-slot", - "solana-loader-v3-interface", + "solana-loader-v3-interface 7.0.0", "solana-program-entrypoint", - "solana-pubkey 4.1.0", - "solana-rent 3.1.0", + "solana-pubkey 4.3.0", + "solana-rent", "solana-sbpf", "solana-sdk-ids", "solana-slot-hashes", "solana-stable-layout", - "solana-stake-interface", + "solana-stake-history", "solana-svm-callback", "solana-svm-feature-set", "solana-svm-log-collector", @@ -2970,11 +3045,12 @@ dependencies = [ "solana-svm-timings", "solana-svm-transaction", "solana-svm-type-overrides", - "solana-system-interface 3.1.0", - "solana-sysvar 3.1.1", + "solana-system-interface 3.3.0", + "solana-sysvar", "solana-sysvar-id", "solana-transaction-context", - "thiserror 2.0.18", + "thiserror 2.0.21", + "wincode", ] [[package]] @@ -2988,38 +3064,50 @@ dependencies = [ [[package]] name = "solana-pubkey" -version = "4.1.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b06bd918d60111ee1f97de817113e2040ca0cedb740099ee8d646233f6b906c" +checksum = "10f71b7a414de2ced1071f015834e9be581592d013432adbd06d02e4af11eba9" dependencies = [ - "solana-address 2.6.1", + "rand 0.9.4", + "solana-address 2.7.0", ] [[package]] name = "solana-rent" -version = "3.1.0" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e860d5499a705369778647e97d760f7670adfb6fc8419dd3d568deccd46d5487" +checksum = "dc016b348926395ba01f8288cdf5da25fc30f5a0806028b32d5e5b3147b10bf9" dependencies = [ "serde", "serde_derive", + "solana-get-sysvar", "solana-sdk-ids", "solana-sdk-macro", "solana-sysvar-id", + "wincode", ] [[package]] -name = "solana-rent" -version = "4.3.0" +name = "solana-runtime-transaction" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39f0d780bf8e8a1fe8b5b5fce1acad6b209485b86dec246e7523d5e4a8b7c7fc" +checksum = "17fa8d6894320fdd524d83a5570b75d9db40bb215c354972281a4d5eeb5292f0" dependencies = [ - "serde", - "serde_derive", - "solana-get-sysvar", + "agave-feature-set", + "agave-transaction-view", + "solana-compute-budget", + "solana-compute-budget-instruction", + "solana-hash", + "solana-message", + "solana-program-entrypoint", + "solana-pubkey 4.3.0", "solana-sdk-ids", - "solana-sdk-macro", - "solana-sysvar-id", + "solana-signature", + "solana-svm-transaction", + "solana-transaction", + "solana-transaction-context", + "solana-transaction-error", + "wincode", ] [[package]] @@ -3030,9 +3118,9 @@ checksum = "dcf09694a0fc14e5ffb18f9b7b7c0f15ecb6eac5b5610bf76a1853459d19daf9" [[package]] name = "solana-sbpf" -version = "0.14.4" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733b3657a0fab205102b799dbe17f85d3972cf984232c1b0b108fa6ba438e382" +checksum = "ccbbc7c304b4b3bf26b91b39431013d3305312d0d025cf0a82db94b88996035b" dependencies = [ "byteorder", "combine", @@ -3041,7 +3129,7 @@ dependencies = [ "log", "rand 0.8.6", "rustc-demangle", - "thiserror 2.0.18", + "thiserror 2.0.21", "winapi", ] @@ -3051,7 +3139,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "def234c1956ff616d46c9dd953f251fa7096ddbaa6d52b165218de97882b7280" dependencies = [ - "solana-address 2.6.1", + "solana-address 2.7.0", ] [[package]] @@ -3068,13 +3156,13 @@ dependencies = [ [[package]] name = "solana-secp256k1-recover" -version = "3.2.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a1ad3ed7846631c88c71c5d2f21a2ecb6b61da333d9be173b6b061b35609ae" +checksum = "99f00f973301968be9f05f4af951974a28848b6513fb16edf77c8af20e681914" dependencies = [ "k256", - "solana-define-syscall 5.1.0", - "thiserror 2.0.18", + "solana-define-syscall 5.3.0", + "thiserror 2.0.21", ] [[package]] @@ -3092,7 +3180,7 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc905b200a95f2ea9146e43f2a7181e3aeb55de6bc12afb36462d00a3c7310de" dependencies = [ - "hmac", + "hmac 0.12.1", "pbkdf2", "sha2 0.10.9", ] @@ -3108,12 +3196,12 @@ dependencies = [ [[package]] name = "solana-serialize-utils" -version = "3.1.1" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d7cc401931d178472358e6b78dc72d031dc08f752d7410f0e8bd259dd6f02fa" +checksum = "761357b0853c9623bf12c1d2314b3d6160a85b087b84c45224fb85766d22616b" dependencies = [ "solana-instruction-error", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sanitize", ] @@ -3125,62 +3213,74 @@ checksum = "db7dc3011ea4c0334aaaa7e7128cb390ecf546b28d412e9bf2064680f57f588f" dependencies = [ "sha2 0.10.9", "solana-define-syscall 4.0.1", - "solana-hash 4.2.0", + "solana-hash", +] + +[[package]] +name = "solana-sha512-hasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11e10e103ab5bd52af341e7bc2f4123a2f4e66bb7ba4e6ca40f1e00cd6314e02" +dependencies = [ + "sha2 0.10.9", + "solana-define-syscall 5.3.0", + "solana-hash-512", ] [[package]] name = "solana-short-vec" -version = "3.2.2" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d8250a4495aad49ad20556a607da53bdcb20de78da10b65afbf918b7f1de647" +checksum = "c75782529cc4521114c1ecd71c7e2cdebd41a6fe9844b5d088fd36ef08c57c36" dependencies = [ "serde_core", + "wincode", ] [[package]] name = "solana-signature" -version = "3.3.0" +version = "3.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "132a93134f1262aa832f1849b83bec6c9945669b866da18661a427943b9e801e" +checksum = "fe45ce95700ac8045e422344b88e273843d70185873cc1cc880ba06dd9fa9002" dependencies = [ - "ed25519-dalek", "five8", "serde", - "serde-big-array", - "serde_derive", + "solana-ed25519", "solana-sanitize", - "wincode 0.4.9", + "wincode", ] [[package]] name = "solana-signer" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bfea97951fee8bae0d6038f39a5efcb6230ecdfe33425ac75196d1a1e3e3235" +checksum = "520bd6021163ee517f4bdc7ae03ded904f97e11320001ba0b3355f45eb14f558" dependencies = [ - "solana-pubkey 3.0.0", + "solana-pubkey 4.3.0", "solana-signature", "solana-transaction-error", ] [[package]] name = "solana-slot-hashes" -version = "3.0.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2585f70191623887329dfb5078da3a00e15e3980ea67f42c2e10b07028419f43" +checksum = "007d6bc909599eea325c9d09f7ff16ef6166c134876ff47a6a122d693d058dad" dependencies = [ "serde", "serde_derive", - "solana-hash 4.2.0", + "solana-get-sysvar", + "solana-hash", "solana-sdk-ids", "solana-sysvar-id", + "wincode", ] [[package]] name = "solana-slot-history" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40427c04d3e808493cb5e3d1a97cef84d7c15cb6f89b15c5684d0d4027105600" +checksum = "4560fde841a6f2001aedc33b74fe99840ee3d56a71fe9b98ee332303b8597900" dependencies = [ "bv", "serde", @@ -3188,6 +3288,7 @@ dependencies = [ "solana-get-sysvar", "solana-sdk-ids", "solana-sysvar-id", + "wincode", ] [[package]] @@ -3196,82 +3297,78 @@ version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9f6a291ba063a37780af29e7db14bdd3dc447584d8ba5b3fc4b88e2bbc982fa" dependencies = [ - "solana-instruction", - "solana-pubkey 4.1.0", + "solana-instruction 3.5.1", + "solana-pubkey 4.3.0", ] [[package]] -name = "solana-stake-interface" -version = "2.0.2" +name = "solana-stake-history" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9bc26191b533f9a6e5a14cca05174119819ced680a80febff2f5051a713f0db" +checksum = "c814b4e2570f8c343eb1d4f968ff981bdf518afc3643d070d8e5a28158e85a4b" dependencies = [ - "num-traits", "serde", "serde_derive", - "solana-clock", - "solana-cpi", - "solana-instruction", - "solana-program-error", - "solana-pubkey 3.0.0", - "solana-system-interface 2.0.0", - "solana-sysvar 3.1.1", + "solana-clock 3.2.1", + "solana-get-sysvar", + "solana-sdk-ids", "solana-sysvar-id", + "wincode", ] [[package]] name = "solana-svm-callback" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4006b0da7e50cba514ced6b47bcf8f9591552458200e361fd4bdef4068cb2fed" +checksum = "73c7516287cbd47f2990f82cf5d5afd3fc7cf3c56a1397d1397d238ce6042415" dependencies = [ "solana-account", - "solana-clock", + "solana-clock 3.2.1", "solana-precompile-error", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", ] [[package]] name = "solana-svm-feature-set" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24ea15c0d91403375e3d017cc09780cf138b629abba4ccaaa7cf66b1afea1059" +checksum = "aeecab4b2418f9f1cc5e99515a7f21402a4b6b88365dfeff0e6be4d9b9fd80f3" [[package]] name = "solana-svm-log-collector" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb7d3ccd3a51b85807ff16b2f513069e8b55e220b280774a3e9b899bcb81987" +checksum = "895fc9ebc48bf6645088fe364c6306d00dd9f5f516023dc04eacb24a114a3201" dependencies = [ "log", ] [[package]] name = "solana-svm-measure" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d70c9972c1f03cb2bbc64d23dc2079419a66d89b49d6b44f79206530551ddc8c" +checksum = "18b970d100026b090ef55793cae5e06dc737c0cada20adfbcede1fcdb836d0e6" [[package]] name = "solana-svm-timings" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20f3d66aa88c9001a076362108f7967d6a00d121ba38428e56928935566ed5bd" +checksum = "ac391bfdb859591b46242cfda0ed278006735373394f6955fe9b014db4f1deb3" dependencies = [ "eager", "enum-iterator", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", ] [[package]] name = "solana-svm-transaction" -version = "4.0.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "067861db805d135a6fbe489bf2b74d701f270df8d03afd3257f7d51a2ff3467e" +checksum = "0afde938e0d3f06e87853e6e189396d67256e3b600675d867a47d066f8cebadb" dependencies = [ - "solana-hash 4.2.0", + "solana-hash", "solana-message", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sdk-ids", "solana-signature", "solana-transaction", @@ -3279,13 +3376,56 @@ dependencies = [ [[package]] name = "solana-svm-type-overrides" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e41661ebf0edcc296b15251c08fee0ad2da3257e6ab86cea2a0a8f6fba642c6" +checksum = "cb43b01b9df0ef785b3e952b36d384da522c2eb5df511f45c2c84d054f6438fa" dependencies = [ "rand 0.9.4", ] +[[package]] +name = "solana-syscalls" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2335d6f994a1ff4c6b65eadcfef0cb011bc5165b69affbcef28fd1e9d6cb39c2" +dependencies = [ + "bincode", + "libsecp256k1", + "num-traits", + "solana-account", + "solana-account-info", + "solana-big-mod-exp 4.0.0", + "solana-blake3-hasher", + "solana-bls12-381-syscall", + "solana-bn254", + "solana-clock 3.2.1", + "solana-cpi", + "solana-curve25519", + "solana-define-syscall 5.3.0", + "solana-hash", + "solana-hash-512", + "solana-instruction 3.5.1", + "solana-keccak-hasher", + "solana-poseidon", + "solana-program-entrypoint", + "solana-program-runtime", + "solana-pubkey 4.3.0", + "solana-sbpf", + "solana-sdk-ids", + "solana-secp256k1-recover", + "solana-sha256-hasher", + "solana-sha512-hasher", + "solana-stable-layout", + "solana-stake-history", + "solana-svm-feature-set", + "solana-svm-log-collector", + "solana-svm-type-overrides", + "solana-sysvar-id", + "solana-transaction-context", + "thiserror 2.0.21", + "wincode", +] + [[package]] name = "solana-system-interface" version = "2.0.0" @@ -3295,7 +3435,7 @@ dependencies = [ "num-traits", "serde", "serde_derive", - "solana-instruction", + "solana-instruction 3.5.1", "solana-msg", "solana-program-error", "solana-pubkey 3.0.0", @@ -3303,84 +3443,51 @@ dependencies = [ [[package]] name = "solana-system-interface" -version = "3.1.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a95a6f2e23ed861d6444ad4a6d6896c418d7d101b960787e65a8e33157cee81b" +checksum = "2e2d5311d0584af231c6c2b0503ba1c3aa50118ead4f503ab215ccbdd1ffac57" dependencies = [ "num-traits", "serde", "serde_derive", - "solana-address 2.6.1", - "solana-instruction", + "solana-address 2.7.0", + "solana-instruction 3.5.1", "solana-msg", "solana-program-error", + "wincode", ] [[package]] name = "solana-system-program" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "450479004fee3396c88cc4aa2f9b2b8db9c77be42ee7c1c53e6fac9eaec5fd51" +checksum = "5c93fc4ebe7aa9ec71ebea68c8cad95cff8ef332e8353a35a536a9e2e3774c93" dependencies = [ "bincode", "log", - "serde", "solana-account", "solana-bincode", "solana-fee-calculator", - "solana-instruction", + "solana-instruction 3.5.1", "solana-nonce", "solana-nonce-account", "solana-packet", "solana-program-runtime", - "solana-pubkey 4.1.0", + "solana-pubkey 4.3.0", "solana-sdk-ids", "solana-svm-log-collector", - "solana-svm-type-overrides", - "solana-system-interface 3.1.0", - "solana-sysvar 3.1.1", + "solana-system-interface 3.3.0", + "solana-sysvar", "solana-transaction-context", ] [[package]] name = "solana-sysvar" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6690d3dd88f15c21edff68eb391ef8800df7a1f5cec84ee3e8d1abf05affdf74" -dependencies = [ - "base64 0.22.1", - "bincode", - "lazy_static", - "serde", - "serde_derive", - "solana-account-info", - "solana-clock", - "solana-define-syscall 4.0.1", - "solana-epoch-rewards", - "solana-epoch-schedule", - "solana-fee-calculator", - "solana-hash 4.2.0", - "solana-instruction", - "solana-last-restart-slot", - "solana-program-entrypoint", - "solana-program-error", - "solana-program-memory", - "solana-pubkey 4.1.0", - "solana-rent 3.1.0", - "solana-sdk-ids", - "solana-sdk-macro", - "solana-slot-hashes", - "solana-slot-history", - "solana-sysvar-id", -] - -[[package]] -name = "solana-sysvar" -version = "4.0.0" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1632b69b4f72489db5949a10e8308c229dfa003f99ecaa7477b376807c7b81f4" +checksum = "0214d668b0aab7a64b49e43b7947307985fca4e03d3ef880cd8ee43f52f13a34" dependencies = [ - "base64 0.22.1", + "base64", "bincode", "bytemuck", "bytemuck_derive", @@ -3388,24 +3495,27 @@ dependencies = [ "serde", "serde_derive", "solana-account-info", - "solana-clock", - "solana-define-syscall 5.1.0", + "solana-clock 3.2.1", + "solana-define-syscall 5.3.0", "solana-epoch-rewards", "solana-epoch-schedule", "solana-fee-calculator", - "solana-hash 4.2.0", - "solana-instruction", + "solana-get-sysvar", + "solana-hash", + "solana-instruction 3.5.1", "solana-last-restart-slot", "solana-program-entrypoint", "solana-program-error", "solana-program-memory", - "solana-pubkey 4.1.0", - "solana-rent 4.3.0", + "solana-pubkey 4.3.0", + "solana-rent", "solana-sdk-ids", "solana-sdk-macro", "solana-slot-hashes", "solana-slot-history", + "solana-stake-history", "solana-sysvar-id", + "wincode", ] [[package]] @@ -3414,22 +3524,19 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17358d1e9a13e5b9c2264d301102126cf11a47fd394cdf3dec174fe7bc96e1de" dependencies = [ - "solana-address 2.6.1", + "solana-address 2.7.0", "solana-sdk-ids", ] [[package]] name = "solana-transaction" -version = "3.1.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96697cff5075a028265324255efed226099f6d761ca67342b230d09f72cc48d2" +checksum = "444a979f617ef7ed4e01aa228800df52d0af55f533e1840e8d48d468e607885f" dependencies = [ - "bincode", - "serde", - "serde_derive", - "solana-address 2.6.1", - "solana-hash 4.2.0", - "solana-instruction", + "solana-address 2.7.0", + "solana-hash", + "solana-instruction 3.5.1", "solana-instruction-error", "solana-message", "solana-sanitize", @@ -3438,42 +3545,42 @@ dependencies = [ "solana-signature", "solana-signer", "solana-transaction-error", + "wincode", ] [[package]] name = "solana-transaction-context" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecefe8b30e334e2891ca82da35becd9a3f4c16021d9ca782e2a82adf31084fa3" +checksum = "90ba8f4584068bd24a2ccb2a41a737f7e5c8ee752dc8dee2a7b1d0ee3e34d55b" dependencies = [ "bincode", "serde", "solana-account", - "solana-instruction", - "solana-instructions-sysvar", - "solana-pubkey 4.1.0", - "solana-rent 3.1.0", + "solana-instruction 3.5.1", + "solana-instructions-sysvar 4.0.0", + "solana-pubkey 4.3.0", + "solana-rent", "solana-sbpf", "solana-sdk-ids", + "wincode", ] [[package]] name = "solana-transaction-error" -version = "3.1.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8396904805b0b385b9de115a652fe80fd01e5b98ce0513f4fcd8184ada9bb792" +checksum = "8a37cf28c58b03878d38c38411f0414d3a99a9e3b7e5ebb0f83f3317b2796d18" dependencies = [ - "serde", - "serde_derive", "solana-instruction-error", "solana-sanitize", ] [[package]] name = "solana-vote-interface" -version = "5.1.1" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d444ce30b6b4f9c281ba06061ea96638d063b53c2171b1e41ba02ebff79ed28f" +checksum = "c372a70d5c9738590f9762eb8bf01f7a794fdf0170ee5c1624df9a05e09603bc" dependencies = [ "bincode", "cfg_eval", @@ -3482,109 +3589,140 @@ dependencies = [ "serde", "serde_derive", "serde_with", - "solana-clock", - "solana-hash 4.2.0", - "solana-instruction", + "solana-clock 3.2.1", + "solana-hash", + "solana-instruction 3.5.1", "solana-instruction-error", - "solana-pubkey 4.1.0", - "solana-rent 4.3.0", + "solana-pubkey 4.3.0", + "solana-rent", "solana-sdk-ids", "solana-serde-varint", "solana-serialize-utils", "solana-short-vec", - "solana-system-interface 3.1.0", + "solana-system-interface 3.3.0", + "solana-wincode-varint", + "wincode", ] [[package]] name = "solana-vote-program" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4537fd6efe65f53ccd28d54d2ad43275b024834a4a8ca4dfa4babfa01e6d11ab" +checksum = "c08fc6f2691224d49e5c4bb98652bac1a7ed97f1f25e0c6092908d2cd543fd2b" dependencies = [ "agave-feature-set", "bincode", "log", - "num-derive", - "num-traits", - "serde", "solana-account", "solana-bincode", "solana-bls-signatures", - "solana-clock", + "solana-clock 3.2.1", "solana-epoch-schedule", - "solana-hash 4.2.0", - "solana-instruction", - "solana-keypair", + "solana-hash", + "solana-instruction 3.5.1", "solana-packet", "solana-program-runtime", - "solana-pubkey 4.1.0", - "solana-rent 3.1.0", + "solana-pubkey 4.3.0", + "solana-rent", "solana-sdk-ids", - "solana-signer", "solana-slot-hashes", - "solana-system-interface 3.1.0", - "solana-transaction", + "solana-system-interface 3.3.0", "solana-transaction-context", "solana-vote-interface", - "thiserror 2.0.18", + "wincode", ] [[package]] -name = "solana-zk-elgamal-proof-program" -version = "4.0.0" +name = "solana-wincode-varint" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdf97ec816e8c6d45b5f05e21381bcc4b856cb3c89b69e465ee20972368b4c31" +checksum = "d15737770cec70afc784649526db191289e2b7ca988a878ed2d171f2cdd60b66" +dependencies = [ + "wincode", +] + +[[package]] +name = "solana-zk-elgamal-proof-interface" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8da7f01db2148a1dc16261ff1dc6f3930a1e255a33cece4f1b56658694f27f7" dependencies = [ - "agave-feature-set", "bytemuck", + "bytemuck_derive", "num-derive", "num-traits", - "solana-instruction", + "solana-address 2.7.0", + "solana-instruction 3.5.1", + "solana-sdk-ids", + "solana-zk-sdk-pod", +] + +[[package]] +name = "solana-zk-elgamal-proof-program" +version = "4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9ac53798348994c909d9913944a01d5c2e37881f4a28538da6ef057247a6885" +dependencies = [ + "bytemuck", + "solana-instruction 3.5.1", "solana-program-runtime", "solana-sdk-ids", "solana-svm-log-collector", + "solana-zk-elgamal-proof-interface", "solana-zk-sdk", ] [[package]] name = "solana-zk-sdk" -version = "5.0.1" +version = "7.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09670ff59f60e6ddc2209c2e4353992a9b9f01d4e244f3e9d67bd5146e33d388" +checksum = "96cd8535d2f40d43a1d47af2849e1c86706a597a2ad84207441f51a50f09d8fd" dependencies = [ "aes-gcm-siv", - "base64 0.22.1", + "base64", "bincode", "bytemuck", - "bytemuck_derive", "curve25519-dalek", + "hkdf", "itertools 0.14.0", "merlin", - "num-derive", - "num-traits", "rand 0.8.6", "serde", "serde_derive", "serde_json", + "sha2 0.10.9", "sha3", - "solana-address 2.6.1", + "solana-address 2.7.0", "solana-derivation-path", - "solana-instruction", - "solana-sdk-ids", "solana-seed-derivable", "solana-seed-phrase", "solana-signature", "solana-signer", + "solana-zk-elgamal-proof-interface", + "solana-zk-sdk-pod", "subtle", - "thiserror 2.0.18", + "thiserror 2.0.21", "zeroize", ] +[[package]] +name = "solana-zk-sdk-pod" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a800583b7a4cea3e851686af162cc6e4712eef97fa91dfa9aca2459b95c84777" +dependencies = [ + "base64", + "bytemuck", + "bytemuck_derive", + "solana-nullable", + "thiserror 2.0.21", +] + [[package]] name = "solana-zk-token-proof-program" -version = "4.0.0" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f08a8be7008cec95d74c0ded5ae10b6869bd06bd9761c800e7e098bd45097e6" +checksum = "363190b5aedad14b5bc57b1095b06b0fd5e2a73923bc7708c422e727b9b1fdce" dependencies = [ "solana-program-runtime", ] @@ -3596,7 +3734,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der", + "der 0.7.10", +] + +[[package]] +name = "spki" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef958a98b9d5da290cfc78946e9f3e61e1e62a18db0d92cac0b83cc161491a9" +dependencies = [ + "base64ct", + "der 0.8.3", ] [[package]] @@ -3605,7 +3753,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6433917b60441d68d99a17e121d9db0ea15a9a69c0e5afa34649cf5ba12612f" dependencies = [ - "solana-instruction", + "solana-instruction 3.5.1", "solana-pubkey 3.0.0", ] @@ -3620,13 +3768,13 @@ dependencies = [ "num-derive", "num-traits", "num_enum", - "solana-instruction", + "solana-instruction 3.5.1", "solana-program-error", "solana-program-option", "solana-program-pack", "solana-pubkey 3.0.0", "solana-sdk-ids", - "thiserror 2.0.18", + "thiserror 2.0.21", ] [[package]] @@ -3663,6 +3811,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "3.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "tap" version = "1.0.1" @@ -3680,11 +3839,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.18" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" +checksum = "09e52cb86a36cede5cb101bf8908837b3e4c6e5e59fe7fd85c23fb56200d189e" dependencies = [ - "thiserror-impl 2.0.18", + "thiserror-impl 2.0.21", ] [[package]] @@ -3700,13 +3859,13 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.18" +version = "2.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" +checksum = "fe5197923287db20a58125f0bc85c062f7f2c892de97b18c356f9efb14b28524" dependencies = [ "proc-macro2", "quote", - "syn 2.0.118", + "syn 3.0.9", ] [[package]] @@ -3816,12 +3975,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - [[package]] name = "wasi" version = "0.11.1+wasi-snapshot-preview1" @@ -3861,35 +4014,23 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "wincode" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "657690780ce23e6f66576a782ffd88eb353512381817029cc1d7a99154bb6d1f" -dependencies = [ - "pastey", - "proc-macro2", - "quote", - "thiserror 2.0.18", - "wincode-derive", -] - -[[package]] -name = "wincode" -version = "0.5.5" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d967db7705dc29120bb6e8ce5b5a2e27734ed5976d1c904e95bd238d1c3c5a" +checksum = "063b5affe63fb4e584a33101d8808f01f2348b4f533db6223bf27263a0fdb9e9" dependencies = [ + "bv", "pastey", "proc-macro2", "quote", - "thiserror 2.0.18", + "thiserror 2.0.21", "wincode-derive", ] [[package]] name = "wincode-derive" -version = "0.4.6" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15ab90b719560d0fda79c74550ad1c948d17b118765942838055ebaf34d67071" +checksum = "11d582d9fc9d813264407a9e16bfa16846ccf15ef032f9bbcd700741bdc00255" dependencies = [ "darling", "proc-macro2", @@ -3918,6 +4059,18 @@ version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" +[[package]] +name = "wnaf" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "795ca18b3fdb5e62bf982199278341ddcf7ebf7d32e25e212ad05d496e95f6fa" +dependencies = [ + "ff 0.14.0", + "group 0.14.0", + "hybrid-array", + "primefield", +] + [[package]] name = "wyz" version = "0.5.1" diff --git a/finance/escrow/native/program/Cargo.toml b/finance/escrow/native/program/Cargo.toml index 679c4dae8..79b8554b6 100644 --- a/finance/escrow/native/program/Cargo.toml +++ b/finance/escrow/native/program/Cargo.toml @@ -22,9 +22,9 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" diff --git a/finance/fundraiser/anchor/README.md b/finance/fundraiser/anchor/README.md index 72521ad1a..d2d0aefb6 100644 --- a/finance/fundraiser/anchor/README.md +++ b/finance/fundraiser/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/finance/fundraiser/anchor/programs/fundraiser/Cargo.toml b/finance/fundraiser/anchor/programs/fundraiser/Cargo.toml index d040a712c..a81d9d6ad 100644 --- a/finance/fundraiser/anchor/programs/fundraiser/Cargo.toml +++ b/finance/fundraiser/anchor/programs/fundraiser/Cargo.toml @@ -22,16 +22,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = { version = "2.0.0-rc.1", features = ["compat"] } +anchor-lang = { version = "2.0.0-rc.2", features = ["compat"] } # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -48,9 +43,15 @@ anchor-spl = "2.0.0-rc.1" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" solana-clock = "3.0.1" -solana-kite = "0.4.0" +solana-kite = "0.7.0" borsh = "1.6.1" # solana-kite depends on these SPL program crates without "no-entrypoint", # so the host test binary would link their `entrypoint` symbols alongside diff --git a/finance/fundraiser/anchor/programs/fundraiser/tests/test_fundraiser.rs b/finance/fundraiser/anchor/programs/fundraiser/tests/test_fundraiser.rs index 154c67935..0362e6e7c 100644 --- a/finance/fundraiser/anchor/programs/fundraiser/tests/test_fundraiser.rs +++ b/finance/fundraiser/anchor/programs/fundraiser/tests/test_fundraiser.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, borsh::BorshDeserialize, fundraiser::{FundraiserError, SECONDS_TO_DAYS}, // LiteSVM's get_sysvar wants the host-side Clock, not pinocchio's. @@ -111,7 +111,7 @@ fn full_setup() -> FundraiserSetup { let maker = create_wallet(&mut svm, 10_000_000_000).unwrap(); // The payer is the mint authority. - let mint = create_token_mint(&mut svm, &payer, MINT_DECIMALS, None).unwrap(); + let mint = create_token_mint(&mut svm, &payer, MINT_DECIMALS, None, None).unwrap(); let (fundraiser_pda, _bump) = Address::find_program_address(&[b"fundraiser", maker.pubkey().as_ref()], &program_id); @@ -150,6 +150,7 @@ fn initialize_fundraiser(setup: &mut FundraiserSetup, amount: u64, duration: u16 vec![initialize_instruction], &[&setup.maker], &setup.maker.pubkey(), + None, ) .unwrap(); } @@ -164,6 +165,7 @@ fn create_funded_contributor(setup: &mut FundraiserSetup) -> (Keypair, Address, &contributor.pubkey(), &setup.mint, &setup.payer, + None, ) .unwrap(); @@ -173,6 +175,7 @@ fn create_funded_contributor(setup: &mut FundraiserSetup) -> (Keypair, Address, &contributor_ata, CONTRIBUTOR_STARTING_BALANCE, &setup.payer, + None, ) .unwrap(); @@ -317,6 +320,7 @@ fn contribute( vec![contribute_instruction], &[&contributor.keypair], &contributor.keypair.pubkey(), + None, ) .map(|_| ()) .map_err(|error| format!("{error:?}")) @@ -360,6 +364,7 @@ fn refund( vec![refund_instruction], &[fee_payer], &fee_payer.pubkey(), + None, ) .map(|_| ()) .map_err(|error| format!("{error:?}")) @@ -375,6 +380,7 @@ fn claim(setup: &mut FundraiserSetup) -> Result { vec![check_instruction], &[&maker], &maker.pubkey(), + None, ) .map(|_| maker_ata) .map_err(|error| format!("{error:?}")) @@ -397,6 +403,7 @@ fn close_contribution( vec![close_instruction], &[fee_payer], &fee_payer.pubkey(), + None, ) .map(|_| ()) .map_err(|error| format!("{error:?}")) @@ -412,6 +419,7 @@ fn close_fundraiser(setup: &mut FundraiserSetup) -> Result<(), String> { vec![close_instruction], &[&maker], &maker.pubkey(), + None, ) .map(|_| ()) .map_err(|error| format!("{error:?}")) @@ -516,6 +524,7 @@ fn test_initialize_below_minimum_target_fails() { vec![initialize_instruction], &[&setup.maker], &setup.maker.pubkey(), + None, ) .map_err(|error| format!("{error:?}")); assert_error(result, FundraiserError::InvalidAmount); @@ -763,6 +772,7 @@ fn test_second_claim_fails() { &setup.vault, ONE_TOKEN, &setup.payer, + None, ) .unwrap(); setup.svm.expire_blockhash(); @@ -807,6 +817,7 @@ fn test_check_contributions_ignores_direct_vault_donations() { &setup.vault, AMOUNT_TO_RAISE, &setup.payer, + None, ) .unwrap(); @@ -1036,6 +1047,7 @@ fn test_reinitialize_with_open_contributions_fails() { vec![initialize_instruction], &[&setup.maker], &setup.maker.pubkey(), + None, ) .map_err(|error| format!("{error:?}")); // `init` asks the System Program to allocate the fundraiser's address, @@ -1140,6 +1152,7 @@ fn test_close_fundraiser_sweeps_direct_donations_to_maker() { &setup.vault, donation, &setup.payer, + None, ) .unwrap(); diff --git a/finance/lending/anchor/README.md b/finance/lending/anchor/README.md index 66c0e524b..eeb122348 100644 --- a/finance/lending/anchor/README.md +++ b/finance/lending/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). @@ -299,7 +299,7 @@ on its own. ## Setup -- Rust and the Solana toolchain (`cargo-build-sbf`), Anchor 2.0.0-rc.1, Solana 3.1.8. +- Rust and the Solana toolchain (`cargo-build-sbf`), Anchor 2.0.0-rc.2, Solana 3.1.8. - This program has no client/JavaScript code; tests are Rust + LiteSVM. ## Testing diff --git a/finance/lending/anchor/programs/lending/Cargo.toml b/finance/lending/anchor/programs/lending/Cargo.toml index b8a58b966..a3380ab52 100644 --- a/finance/lending/anchor/programs/lending/Cargo.toml +++ b/finance/lending/anchor/programs/lending/Cargo.toml @@ -23,19 +23,14 @@ profile = ["anchor-v2-testing/profile"] [dependencies] # init-if-needed: the obligation share vault and the test price feed are created lazily. -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" +wincode = { version = "0.6", features = ["derive"] } # pinocchio ships only Clock and Rent, so LastRestartSlot is read through # pinocchio's own `get_sysvar` wrapper (see src/last_restart.rs). pinocchio = "0.11" -anchor-spl = "2.0.0-rc.1" +anchor-spl = "2.0.0-rc.2" [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -52,14 +47,20 @@ anchor-spl = "2.0.0-rc.1" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" # Test-side only: LiteSVM's get_sysvar/set_sysvar want the host-side sysvar # types, not the pinocchio ones anchor-lang exposes on-chain. solana-sysvar = "3" solana-clock = "3" -solana-pubkey = "3" +solana-pubkey = "4.3" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/finance/lending/anchor/programs/lending/tests/common/mod.rs b/finance/lending/anchor/programs/lending/tests/common/mod.rs index 0c1824bc5..cf498ce07 100644 --- a/finance/lending/anchor/programs/lending/tests/common/mod.rs +++ b/finance/lending/anchor/programs/lending/tests/common/mod.rs @@ -14,7 +14,7 @@ use anchor_lang::{ system_program, AccountDeserialize, InstructionData, ToAccountMetas, }; use anchor_spl::token::ID as TOKEN_PROGRAM_ID; -use anchor_v2_testing::{Keypair, LiteSVM, Signer}; +use anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}; use solana_kite::{ create_associated_token_account, create_token_mint, create_wallet, get_sol_balance, get_token_account_balance, mint_tokens_to_token_account, send_transaction_from_instructions, @@ -82,7 +82,7 @@ fn send( signers: &[&Keypair], payer: &Address, ) -> Result<(), String> { - send_transaction_from_instructions(svm, instructions, signers, payer) + send_transaction_from_instructions(svm, instructions, signers, payer, None) .map_err(|thrown| format!("{thrown:?}")) } @@ -131,7 +131,7 @@ impl Env { svm.add_program(lending::id(), program_bytes).unwrap(); let owner = create_wallet(&mut svm, 1_000_000_000_000).unwrap(); - let quote_mint = create_token_mint(&mut svm, &owner, 6, None).unwrap(); + let quote_mint = create_token_mint(&mut svm, &owner, 6, None, None).unwrap(); // The market is seeded by its market_id index alone (no owner). Market 0. let market_id: u64 = 0; let market = pda(&[LENDING_MARKET_SEED, &market_id.to_le_bytes()]); @@ -160,7 +160,7 @@ impl Env { /// exercise cross-market isolation. pub fn init_market_for(&mut self, market_owner: &Keypair) -> Address { let env_owner = self.owner.insecure_clone(); - let quote_mint = create_token_mint(&mut self.svm, &env_owner, 6, None).unwrap(); + let quote_mint = create_token_mint(&mut self.svm, &env_owner, 6, None, None).unwrap(); // A distinct id from the env's market 0, since the id is the market's // global identifier (the owner is not part of the seed). let market_id: u64 = 1; @@ -212,7 +212,7 @@ impl Env { config: ReserveConfig, ) -> Result { let env_owner = self.owner.insecure_clone(); - let mint = create_token_mint(&mut self.svm, &env_owner, decimals, None).unwrap(); + let mint = create_token_mint(&mut self.svm, &env_owner, decimals, None, None).unwrap(); self.set_price_for( market_owner, market, @@ -414,10 +414,18 @@ impl Env { pub fn fund(&mut self, user: &Keypair, mint: Address, amount: u64) -> Address { let owner = self.owner.insecure_clone(); let token_account = - create_associated_token_account(&mut self.svm, &user.pubkey(), &mint, user).unwrap(); - if amount > 0 { - mint_tokens_to_token_account(&mut self.svm, &mint, &token_account, amount, &owner) + create_associated_token_account(&mut self.svm, &user.pubkey(), &mint, user, None) .unwrap(); + if amount > 0 { + mint_tokens_to_token_account( + &mut self.svm, + &mint, + &token_account, + amount, + &owner, + None, + ) + .unwrap(); } token_account } @@ -449,6 +457,7 @@ impl Env { &user.pubkey(), &handle.share_mint, user, + None, ) .unwrap(); } @@ -849,6 +858,7 @@ impl Env { &liquidator.pubkey(), &collateral.share_mint, liquidator, + None, ) .unwrap(); } @@ -921,8 +931,14 @@ impl Env { let owner = self.owner.insecure_clone(); let owner_liquidity = ata(&owner.pubkey(), &handle.mint); if self.svm.get_account(&owner_liquidity).is_none() { - create_associated_token_account(&mut self.svm, &owner.pubkey(), &handle.mint, &owner) - .unwrap(); + create_associated_token_account( + &mut self.svm, + &owner.pubkey(), + &handle.mint, + &owner, + None, + ) + .unwrap(); } let refresh = self.refresh_reserve_ix(handle); let collect = Instruction { diff --git a/finance/lending/anchor/programs/lending/tests/test_deposit_redeem.rs b/finance/lending/anchor/programs/lending/tests/test_deposit_redeem.rs index 63e28b0b4..32232b7cd 100644 --- a/finance/lending/anchor/programs/lending/tests/test_deposit_redeem.rs +++ b/finance/lending/anchor/programs/lending/tests/test_deposit_redeem.rs @@ -57,6 +57,7 @@ fn raw_token_donation_does_not_inflate_exchange_rate() { &usdc.liquidity_vault, amount, &owner, + None, ) .unwrap(); diff --git a/finance/lending/anchor/programs/lending/tests/test_security.rs b/finance/lending/anchor/programs/lending/tests/test_security.rs index 58bd3ebea..bf4cd0dcd 100644 --- a/finance/lending/anchor/programs/lending/tests/test_security.rs +++ b/finance/lending/anchor/programs/lending/tests/test_security.rs @@ -70,6 +70,7 @@ fn non_owner_cannot_write_market_price_feed() { vec![instruction], &[&attacker], &attacker.pubkey(), + None, ); // `SetPrice` binds the signer with `address = lending_market.owner`, so // the refusal is Anchor's constraint error, not one of the program's; diff --git a/finance/lending/quasar/Cargo.toml b/finance/lending/quasar/Cargo.toml index afa4f9caf..ca4b63312 100644 --- a/finance/lending/quasar/Cargo.toml +++ b/finance/lending/quasar/Cargo.toml @@ -53,7 +53,7 @@ quasar-test = { git = "https://github.com/blueshift-gg/quasar", rev = "be60fca" # scenarios drive the low-level QuasarSvm harness directly through # `svm.sysvars`. Same crates.io version quasar-test itself depends on, so the # two harnesses share types. -quasar-svm = "=0.1.0" +quasar-svm = "0.1.0" # For decoding/constructing raw SPL accounts in the low-level clock-warp # scenarios; matches quasar-svm 0.1.0's own spl-token major. spl-token = { version = "9", default-features = false, features = ["no-entrypoint"] } diff --git a/finance/managed-fund/anchor/README.md b/finance/managed-fund/anchor/README.md index 2f8b161ba..baba50a20 100644 --- a/finance/managed-fund/anchor/README.md +++ b/finance/managed-fund/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/finance/managed-fund/anchor/app/README.md b/finance/managed-fund/anchor/app/README.md index 1e6a51b27..1ca972b1c 100644 --- a/finance/managed-fund/anchor/app/README.md +++ b/finance/managed-fund/anchor/app/README.md @@ -68,7 +68,7 @@ client mirrors it call-for-call. ## Where the IDL comes from `src/idl/managed_fund.json` is generated from the program source with -`anchor idl build` (Anchor 2.0.0-rc.1, the version CI installs) and committed. If you change +`anchor idl build` (Anchor 2.0.0-rc.2, the version CI installs) and committed. If you change the program, regenerate it: ```sh diff --git a/finance/managed-fund/anchor/app/src/idl/managed_fund.json b/finance/managed-fund/anchor/app/src/idl/managed_fund.json index accc8b0f4..92095e7ed 100644 --- a/finance/managed-fund/anchor/app/src/idl/managed_fund.json +++ b/finance/managed-fund/anchor/app/src/idl/managed_fund.json @@ -20,20 +20,7 @@ }, { "name": "fund", - "writable": true, - "pda": { - "seeds": [ - { - "kind": "const", - "value": [102, 117, 110, 100] - }, - { - "kind": "account", - "path": "fund.index", - "account": "Fund" - } - ] - } + "writable": true }, { "name": "registry", @@ -72,30 +59,7 @@ { "name": "vault_asset", "docs": ["Fund-owned vault for this asset."], - "writable": true, - "pda": { - "seeds": [ - { - "kind": "account", - "path": "fund" - }, - { - "kind": "account", - "path": "token_program" - }, - { - "kind": "account", - "path": "asset_mint" - } - ], - "program": { - "kind": "const", - "value": [ - 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, - 132, 4, 142, 123, 216, 219, 233, 248, 89 - ] - } - } + "writable": true }, { "name": "associated_token_program", @@ -183,24 +147,12 @@ "accounts": [ { "name": "manager", + "docs": ["CHECK: manager is stored in fund; we only read their pubkey for derivation"], "relations": ["fund"] }, { "name": "fund", - "writable": true, - "pda": { - "seeds": [ - { - "kind": "const", - "value": [102, 117, 110, 100] - }, - { - "kind": "account", - "path": "fund.index", - "account": "Fund" - } - ] - } + "writable": true }, { "name": "share_mint", @@ -221,30 +173,7 @@ { "name": "manager_share_account", "docs": ["Manager's share token account - receives fee shares"], - "writable": true, - "pda": { - "seeds": [ - { - "kind": "account", - "path": "manager" - }, - { - "kind": "account", - "path": "token_program" - }, - { - "kind": "account", - "path": "share_mint" - } - ], - "program": { - "kind": "const", - "value": [ - 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, - 132, 4, 142, 123, 216, 219, 233, 248, 89 - ] - } - } + "writable": true }, { "name": "payer", @@ -276,20 +205,7 @@ }, { "name": "fund", - "writable": true, - "pda": { - "seeds": [ - { - "kind": "const", - "value": [102, 117, 110, 100] - }, - { - "kind": "account", - "path": "fund.index", - "account": "Fund" - } - ] - } + "writable": true }, { "name": "share_mint", @@ -313,96 +229,32 @@ }, { "name": "depositor_usdc_account", - "writable": true, - "pda": { - "seeds": [ - { - "kind": "account", - "path": "depositor" - }, - { - "kind": "account", - "path": "token_program" - }, - { - "kind": "account", - "path": "usdc_mint" - } - ], - "program": { - "kind": "const", - "value": [ - 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, - 132, 4, 142, 123, 216, 219, 233, 248, 89 - ] - } - } + "writable": true }, { "name": "depositor_share_account", - "writable": true, - "pda": { - "seeds": [ - { - "kind": "account", - "path": "depositor" - }, - { - "kind": "account", - "path": "token_program" - }, - { - "kind": "account", - "path": "share_mint" - } - ], - "program": { - "kind": "const", - "value": [ - 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, - 132, 4, 142, 123, 216, 219, 233, 248, 89 - ] - } - } + "writable": true }, { "name": "vault_usdc", - "writable": true, - "pda": { - "seeds": [ - { - "kind": "account", - "path": "fund" - }, - { - "kind": "account", - "path": "token_program" - }, - { - "kind": "account", - "path": "usdc_mint" - } - ], - "program": { - "kind": "const", - "value": [ - 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, - 132, 4, 142, 123, 216, 219, 233, 248, 89 - ] - } - } + "writable": true }, { "name": "router_config", + "docs": [ + "CHECK: Router config PDA from the mock-swap-router program; it owns the", + "treasury and signs the router's token CPIs" + ], "writable": true }, { "name": "router_usdc_treasury", + "docs": ["CHECK: Router USDC treasury ATA, owned by the router config account"], "writable": true }, { "name": "swap_router_program", - "address": "SWPR8Rk3aq3DrDGLdaANq7xCMnXoUFUJWJJmCWxc8Jm" + "docs": ["CHECK: validated by the address constraint above"] }, { "name": "associated_token_program", @@ -427,42 +279,6 @@ } ] }, - { - "name": "initialize_registry", - "docs": [ - "Create the curator record for an approved-asset set, owned by `authority`", - "(not a manager). The set itself lives in per-asset ApprovedAsset accounts." - ], - "discriminator": [189, 181, 20, 17, 174, 57, 249, 59], - "accounts": [ - { - "name": "authority", - "writable": true, - "signer": true - }, - { - "name": "registry", - "writable": true, - "pda": { - "seeds": [ - { - "kind": "const", - "value": [114, 101, 103, 105, 115, 116, 114, 121] - }, - { - "kind": "account", - "path": "authority" - } - ] - } - }, - { - "name": "system_program", - "address": "11111111111111111111111111111111" - } - ], - "args": [] - }, { "name": "initialize_fund", "docs": [ @@ -518,30 +334,7 @@ { "name": "vault_usdc", "docs": ["Vault's USDC token account - fund PDA is the authority"], - "writable": true, - "pda": { - "seeds": [ - { - "kind": "account", - "path": "fund" - }, - { - "kind": "account", - "path": "token_program" - }, - { - "kind": "account", - "path": "usdc_mint" - } - ], - "program": { - "kind": "const", - "value": [ - 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, - 132, 4, 142, 123, 216, 219, 233, 248, 89 - ] - } - } + "writable": true }, { "name": "associated_token_program", @@ -578,6 +371,42 @@ } ] }, + { + "name": "initialize_registry", + "docs": [ + "Create the curator record for an approved-asset set, owned by `authority`", + "(not a manager). The set itself lives in per-asset ApprovedAsset accounts." + ], + "discriminator": [189, 181, 20, 17, 174, 57, 249, 59], + "accounts": [ + { + "name": "authority", + "writable": true, + "signer": true + }, + { + "name": "registry", + "writable": true, + "pda": { + "seeds": [ + { + "kind": "const", + "value": [114, 101, 103, 105, 115, 116, 114, 121] + }, + { + "kind": "account", + "path": "authority" + } + ] + } + }, + { + "name": "system_program", + "address": "11111111111111111111111111111111" + } + ], + "args": [] + }, { "name": "rebalance", "docs": [ @@ -598,20 +427,7 @@ }, { "name": "fund", - "writable": true, - "pda": { - "seeds": [ - { - "kind": "const", - "value": [102, 117, 110, 100] - }, - { - "kind": "account", - "path": "fund.index", - "account": "Fund" - } - ] - } + "writable": true }, { "name": "usdc_mint", @@ -619,42 +435,21 @@ }, { "name": "vault_usdc", - "writable": true, - "pda": { - "seeds": [ - { - "kind": "account", - "path": "fund" - }, - { - "kind": "account", - "path": "token_program" - }, - { - "kind": "account", - "path": "usdc_mint" - } - ], - "program": { - "kind": "const", - "value": [ - 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, - 132, 4, 142, 123, 216, 219, 233, 248, 89 - ] - } - } + "writable": true }, { "name": "router_config", + "docs": ["CHECK: Router config PDA"], "writable": true }, { "name": "router_usdc_treasury", + "docs": ["CHECK: Router USDC treasury ATA, owned by the router config account"], "writable": true }, { "name": "swap_router_program", - "address": "SWPR8Rk3aq3DrDGLdaANq7xCMnXoUFUJWJJmCWxc8Jm" + "docs": ["CHECK: validated by the address constraint above"] }, { "name": "associated_token_program", @@ -691,20 +486,7 @@ }, { "name": "fund", - "writable": true, - "pda": { - "seeds": [ - { - "kind": "const", - "value": [102, 117, 110, 100] - }, - { - "kind": "account", - "path": "fund.index", - "account": "Fund" - } - ] - } + "writable": true }, { "name": "asset_config", @@ -729,20 +511,7 @@ }, { "name": "fund", - "writable": true, - "pda": { - "seeds": [ - { - "kind": "const", - "value": [102, 117, 110, 100] - }, - { - "kind": "account", - "path": "fund.index", - "account": "Fund" - } - ] - } + "writable": true }, { "name": "share_mint", @@ -766,84 +535,15 @@ }, { "name": "user_share_account", - "writable": true, - "pda": { - "seeds": [ - { - "kind": "account", - "path": "user" - }, - { - "kind": "account", - "path": "token_program" - }, - { - "kind": "account", - "path": "share_mint" - } - ], - "program": { - "kind": "const", - "value": [ - 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, - 132, 4, 142, 123, 216, 219, 233, 248, 89 - ] - } - } + "writable": true }, { "name": "user_usdc_account", - "writable": true, - "pda": { - "seeds": [ - { - "kind": "account", - "path": "user" - }, - { - "kind": "account", - "path": "token_program" - }, - { - "kind": "account", - "path": "usdc_mint" - } - ], - "program": { - "kind": "const", - "value": [ - 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, - 132, 4, 142, 123, 216, 219, 233, 248, 89 - ] - } - } + "writable": true }, { "name": "vault_usdc", - "writable": true, - "pda": { - "seeds": [ - { - "kind": "account", - "path": "fund" - }, - { - "kind": "account", - "path": "token_program" - }, - { - "kind": "account", - "path": "usdc_mint" - } - ], - "program": { - "kind": "const", - "value": [ - 140, 151, 37, 143, 78, 36, 137, 241, 187, 61, 16, 41, 20, 142, 13, 131, 11, 90, 19, 153, 218, 255, 16, - 132, 4, 142, 123, 216, 219, 233, 248, 89 - ] - } - } + "writable": true }, { "name": "associated_token_program", @@ -878,13 +578,13 @@ "name": "AssetConfig", "discriminator": [57, 112, 247, 166, 247, 64, 140, 23] }, - { - "name": "Registry", - "discriminator": [47, 174, 110, 246, 184, 182, 252, 218] - }, { "name": "Fund", "discriminator": [62, 128, 183, 208, 91, 31, 212, 209] + }, + { + "name": "Registry", + "discriminator": [47, 174, 110, 246, 184, 182, 252, 218] } ], "errors": [ @@ -1152,33 +852,6 @@ ] } }, - { - "name": "Registry", - "docs": [ - "The curator record at the root of an approved-asset set. This account holds no", - "list: it only names the authority allowed to approve assets under it. The set", - "itself is the collection of `ApprovedAsset` accounts derived from this registry,", - "and an asset counts as approved exactly when its `ApprovedAsset` account exists.", - "", - "The authority is deliberately not a fund manager: the curator vets which", - "real assets (and which official price feed) are safe, and a manager only", - "chooses among them. This is what stops a manager from listing a token they", - "mint themselves, or pairing a real mint with a feed they control." - ], - "type": { - "kind": "struct", - "fields": [ - { - "name": "authority", - "type": "pubkey" - }, - { - "name": "bump", - "type": "u8" - } - ] - } - }, { "name": "Fund", "docs": [ @@ -1298,6 +971,33 @@ } ] } + }, + { + "name": "Registry", + "docs": [ + "The curator record at the root of an approved-asset set. This account holds no", + "list: it only names the authority allowed to approve assets under it. The set", + "itself is the collection of `ApprovedAsset` accounts derived from this registry,", + "and an asset counts as approved exactly when its `ApprovedAsset` account exists.", + "", + "The authority is deliberately not a fund manager: the curator vets which", + "real assets (and which official price feed) are safe, and a manager only", + "chooses among them. This is what stops a manager from listing a token they", + "mint themselves, or pairing a real mint with a feed they control." + ], + "type": { + "kind": "struct", + "fields": [ + { + "name": "authority", + "type": "pubkey" + }, + { + "name": "bump", + "type": "u8" + } + ] + } } ] } diff --git a/finance/managed-fund/anchor/programs/managed-fund/Cargo.toml b/finance/managed-fund/anchor/programs/managed-fund/Cargo.toml index 96dc165cf..fa8e8fd58 100644 --- a/finance/managed-fund/anchor/programs/managed-fund/Cargo.toml +++ b/finance/managed-fund/anchor/programs/managed-fund/Cargo.toml @@ -27,19 +27,14 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = { version = "2.0.0-rc.1", features = ["compat"] } +anchor-lang = { version = "2.0.0-rc.2", features = ["compat"] } # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" +wincode = { version = "0.6", features = ["derive"] } # pinocchio ships only Clock and Rent, so LastRestartSlot is read through # pinocchio's own `get_sysvar` wrapper (see src/last_restart.rs). pinocchio = "0.11" -anchor-spl = "2.0.0-rc.1" +anchor-spl = "2.0.0-rc.2" mock-swap-router = { path = "../mock-swap-router", features = ["cpi"] } [dev-dependencies] @@ -57,12 +52,18 @@ mock-swap-router = { path = "../mock-swap-router", features = ["cpi"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" solana-clock = "3.0.1" # Host-side LastRestartSlot for LiteSVM's set_sysvar, as with Clock above. solana-sysvar = "3" -solana-account = "3.0.0" -solana-kite = "0.4.0" +solana-account = "4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/finance/managed-fund/anchor/programs/managed-fund/tests/managed_fund.rs b/finance/managed-fund/anchor/programs/managed-fund/tests/managed_fund.rs index 7771a4e3c..9ca218cd8 100644 --- a/finance/managed-fund/anchor/programs/managed-fund/tests/managed_fund.rs +++ b/finance/managed-fund/anchor/programs/managed-fund/tests/managed_fund.rs @@ -4,7 +4,7 @@ use { system_program, AccountDeserialize, Address, InstructionData, ToAccountMetas, }, anchor_spl::token::spl_token, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_account::Account as SolanaAccount, // LiteSVM's get_sysvar / set_sysvar want the host-side Clock, not pinocchio's. solana_clock::Clock, @@ -236,9 +236,9 @@ fn setup_with_tsla_decimals(tsla_decimals: u8) -> TestContext { let payer = create_wallet(&mut svm, 100_000_000_000).unwrap(); let manager = create_wallet(&mut svm, 10_000_000_000).unwrap(); - let usdc_mint = create_token_mint(&mut svm, &payer, USDC_DECIMALS, None).unwrap(); - let tsla_mint = create_token_mint(&mut svm, &payer, tsla_decimals, None).unwrap(); - let nvda_mint = create_token_mint(&mut svm, &payer, ASSET_DECIMALS, None).unwrap(); + let usdc_mint = create_token_mint(&mut svm, &payer, USDC_DECIMALS, None, None).unwrap(); + let tsla_mint = create_token_mint(&mut svm, &payer, tsla_decimals, None, None).unwrap(); + let nvda_mint = create_token_mint(&mut svm, &payer, ASSET_DECIMALS, None, None).unwrap(); let (router_config_pda, _) = Address::find_program_address(&[b"router_config"], &router_program_id); @@ -255,7 +255,8 @@ fn setup_with_tsla_decimals(tsla_decimals: u8) -> TestContext { &[], ) .unwrap(); - send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey()).unwrap(); + send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey(), None) + .unwrap(); } let (fund_pda, _) = Address::find_program_address( @@ -302,8 +303,14 @@ fn setup_with_tsla_decimals(tsla_decimals: u8) -> TestContext { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![init_router_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![init_router_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); for (mint, rate, rate_pda) in [ (tsla_mint, TSLA_RATE, tsla_rate_pda), @@ -329,7 +336,8 @@ fn setup_with_tsla_decimals(tsla_decimals: u8) -> TestContext { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey()).unwrap(); + send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey(), None) + .unwrap(); } mint_tokens_to_token_account( @@ -338,6 +346,7 @@ fn setup_with_tsla_decimals(tsla_decimals: u8) -> TestContext { &router_usdc_treasury, 10_000_000_000u64, &payer, + None, ) .unwrap(); @@ -357,6 +366,7 @@ fn setup_with_tsla_decimals(tsla_decimals: u8) -> TestContext { vec![init_registry_ix], &[&payer], &payer.pubkey(), + None, ) .unwrap(); @@ -376,7 +386,8 @@ fn setup_with_tsla_decimals(tsla_decimals: u8) -> TestContext { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey()).unwrap(); + send_transaction_from_instructions(&mut svm, vec![ix], &[&payer], &payer.pubkey(), None) + .unwrap(); } TestContext { @@ -445,6 +456,7 @@ fn init_fund(ctx: &mut TestContext, fee_bps: u16, slippage_bps: u16, router: Add vec![ix], &[&ctx.manager], &ctx.manager.pubkey(), + None, ) .unwrap(); } @@ -480,6 +492,7 @@ fn add_asset( vec![ix], &[&ctx.manager], &ctx.manager.pubkey(), + None, ) } @@ -584,7 +597,8 @@ fn do_deposit( ) -> Address { let remaining = deposit_remaining(ctx); let ix = deposit_instruction(ctx, user, usdc_amount, minimum_shares, remaining); - send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[user], &user.pubkey()).unwrap(); + send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[user], &user.pubkey(), None) + .unwrap(); derive_ata(&user.pubkey(), &ctx.share_mint_pda) } @@ -597,7 +611,8 @@ fn do_deposit_tsla_only( ) -> Address { let remaining = deposit_remaining_tsla(ctx); let ix = deposit_instruction(ctx, user, usdc_amount, minimum_shares, remaining); - send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[user], &user.pubkey()).unwrap(); + send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[user], &user.pubkey(), None) + .unwrap(); derive_ata(&user.pubkey(), &ctx.share_mint_pda) } @@ -624,8 +639,14 @@ fn set_router_rate(ctx: &mut TestContext, mint: Address, rate: u64, rate_pda: Ad } .to_account_metas(None), ); - send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&ctx.payer], &ctx.payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut ctx.svm, + vec![ix], + &[&ctx.payer], + &ctx.payer.pubkey(), + None, + ) + .unwrap(); } /// Move NVDAx's price: rewrite its Pyth feed and update the router rate to match. @@ -656,6 +677,7 @@ fn set_weight( vec![ix], &[&ctx.manager], &ctx.manager.pubkey(), + None, ) } @@ -724,7 +746,8 @@ fn donate_usdc(ctx: &mut TestContext, donor: &Keypair, amount: u64) { amount, ) .unwrap(); - send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[donor], &donor.pubkey()).unwrap(); + send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[donor], &donor.pubkey(), None) + .unwrap(); } /// A holder's position valued in USDC minor units at the test's starting prices @@ -801,7 +824,13 @@ fn try_rebalance( ) -> Result<(), solana_kite::SolanaKiteError> { let stranger = create_wallet(&mut ctx.svm, 1_000_000_000).unwrap(); let ix = rebalance_instruction(ctx, &stranger, sell_index, buy_index); - send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&stranger], &stranger.pubkey()) + send_transaction_from_instructions( + &mut ctx.svm, + vec![ix], + &[&stranger], + &stranger.pubkey(), + None, + ) } fn do_rebalance(ctx: &mut TestContext, sell_index: u8, buy_index: u8) { @@ -878,22 +907,34 @@ fn do_collect_fees(ctx: &mut TestContext) -> Address { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&ctx.payer], &ctx.payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut ctx.svm, + vec![ix], + &[&ctx.payer], + &ctx.payer.pubkey(), + None, + ) + .unwrap(); manager_share } fn fund_user(ctx: &mut TestContext, usdc_amount: u64) -> Keypair { let user = create_wallet(&mut ctx.svm, 10_000_000_000).unwrap(); - let user_usdc = - create_associated_token_account(&mut ctx.svm, &user.pubkey(), &ctx.usdc_mint, &ctx.payer) - .unwrap(); + let user_usdc = create_associated_token_account( + &mut ctx.svm, + &user.pubkey(), + &ctx.usdc_mint, + &ctx.payer, + None, + ) + .unwrap(); mint_tokens_to_token_account( &mut ctx.svm, &ctx.usdc_mint, &user_usdc, usdc_amount, &ctx.payer, + None, ) .unwrap(); user @@ -929,7 +970,8 @@ fn test_add_asset_rejects_unapproved() { init_fund(&mut ctx, FEE_BPS, SLIPPAGE_BPS, router); // A mint that was never approved: its approved_asset PDA does not exist. - let rogue_mint = create_token_mint(&mut ctx.svm, &ctx.payer, ASSET_DECIMALS, None).unwrap(); + let rogue_mint = + create_token_mint(&mut ctx.svm, &ctx.payer, ASSET_DECIMALS, None, None).unwrap(); let (rogue_entry, _) = Address::find_program_address( &[ b"approved_asset", @@ -973,7 +1015,7 @@ fn test_add_asset_rejects_weight_overflow() { /// arbitrary pubkey: callers that never value this asset (e.g. the cap boundary test) /// do not need a real feed account. fn create_and_approve_mint(ctx: &mut TestContext) -> (Address, Address) { - let mint = create_token_mint(&mut ctx.svm, &ctx.payer, ASSET_DECIMALS, None).unwrap(); + let mint = create_token_mint(&mut ctx.svm, &ctx.payer, ASSET_DECIMALS, None, None).unwrap(); let (entry, _) = Address::find_program_address( &[b"approved_asset", ctx.registry_pda.as_ref(), mint.as_ref()], &ctx.fund_program_id, @@ -993,8 +1035,14 @@ fn create_and_approve_mint(ctx: &mut TestContext) -> (Address, Address) { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&ctx.payer], &ctx.payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut ctx.svm, + vec![ix], + &[&ctx.payer], + &ctx.payer.pubkey(), + None, + ) + .unwrap(); (mint, entry) } @@ -1057,6 +1105,7 @@ fn test_initialize_rejects_excessive_fee() { vec![ix], &[&ctx.manager], &ctx.manager.pubkey(), + None, ); assert_program_error( r, @@ -1097,6 +1146,7 @@ fn test_initialize_rejects_excessive_slippage() { vec![ix], &[&ctx.manager], &ctx.manager.pubkey(), + None, ); assert_program_error( r, @@ -1175,7 +1225,8 @@ fn test_deposit_rejects_underallocated() { let user = fund_user(&mut ctx, 10_000_000); let ix = deposit_instruction(&ctx, &user, 10_000_000, 1, deposit_remaining_tsla(&ctx)); - let r = send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&user], &user.pubkey()); + let r = + send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&user], &user.pubkey(), None); assert_program_error( r, FundError::FundNotFullyAllocated, @@ -1212,7 +1263,8 @@ fn test_deposit_rejects_slippage() { let user = fund_user(&mut ctx, 10_000_000); let ix = deposit_instruction(&ctx, &user, 10_000_000, 1, deposit_remaining(&ctx)); - let r = send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&user], &user.pubkey()); + let r = + send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&user], &user.pubkey(), None); assert_router_error( r, RouterError::SlippageExceeded, @@ -1233,7 +1285,8 @@ fn test_deposit_rejects_unregistered_router() { let user = fund_user(&mut ctx, 10_000_000); let ix = deposit_instruction(&ctx, &user, 10_000_000, 1, deposit_remaining(&ctx)); - let r = send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&user], &user.pubkey()); + let r = + send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&user], &user.pubkey(), None); assert_program_error( r, FundError::InvalidSwapRouter, @@ -1275,7 +1328,7 @@ fn test_deposit_rejects_price_from_before_restart() { let ix = deposit_instruction(&ctx, &user, 10_000_000, 1, deposit_remaining(&ctx)); assert_program_error( - send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&user], &user.pubkey()), + send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&user], &user.pubkey(), None), FundError::PricePredatesRestart, "a deposit priced before the restart must fail", ); @@ -1457,10 +1510,22 @@ fn test_withdraw() { // User needs token accounts for each asset paid in kind. let user_usdc = derive_ata(&user.pubkey(), &ctx.usdc_mint); - create_associated_token_account(&mut ctx.svm, &user.pubkey(), &ctx.tsla_mint, &ctx.payer) - .unwrap(); - create_associated_token_account(&mut ctx.svm, &user.pubkey(), &ctx.nvda_mint, &ctx.payer) - .unwrap(); + create_associated_token_account( + &mut ctx.svm, + &user.pubkey(), + &ctx.tsla_mint, + &ctx.payer, + None, + ) + .unwrap(); + create_associated_token_account( + &mut ctx.svm, + &user.pubkey(), + &ctx.nvda_mint, + &ctx.payer, + None, + ) + .unwrap(); let mut metas = managed_fund::accounts::WithdrawAccountConstraints { user: user.pubkey(), @@ -1486,7 +1551,8 @@ fn test_withdraw() { .data(), metas, ); - send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&user], &user.pubkey()).unwrap(); + send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&user], &user.pubkey(), None) + .unwrap(); // Sole holder withdraws everything in kind: all 0.016 TSLAx + 0.03333333 // NVDAx, no USDC. @@ -1511,10 +1577,22 @@ fn test_withdraw_rejects_slippage() { let shares = get_token_account_balance(&ctx.svm, &user_share).unwrap(); let user_usdc = derive_ata(&user.pubkey(), &ctx.usdc_mint); - create_associated_token_account(&mut ctx.svm, &user.pubkey(), &ctx.tsla_mint, &ctx.payer) - .unwrap(); - create_associated_token_account(&mut ctx.svm, &user.pubkey(), &ctx.nvda_mint, &ctx.payer) - .unwrap(); + create_associated_token_account( + &mut ctx.svm, + &user.pubkey(), + &ctx.tsla_mint, + &ctx.payer, + None, + ) + .unwrap(); + create_associated_token_account( + &mut ctx.svm, + &user.pubkey(), + &ctx.nvda_mint, + &ctx.payer, + None, + ) + .unwrap(); let mut metas = managed_fund::accounts::WithdrawAccountConstraints { user: user.pubkey(), @@ -1542,7 +1620,8 @@ fn test_withdraw_rejects_slippage() { .data(), metas, ); - let r = send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&user], &user.pubkey()); + let r = + send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&user], &user.pubkey(), None); assert_program_error( r, FundError::UsdcSlippage, @@ -1560,7 +1639,8 @@ fn test_deposit_rejects_incomplete_assets() { // Only one asset's accounts supplied (5) for a two-asset fund (needs 10). let ix = deposit_instruction(&ctx, &user, amount, 1, deposit_remaining_tsla(&ctx)); - let r = send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&user], &user.pubkey()); + let r = + send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&user], &user.pubkey(), None); assert_program_error( r, FundError::IncompleteAssetAccounts, @@ -1569,10 +1649,22 @@ fn test_deposit_rejects_incomplete_assets() { } fn do_withdraw(ctx: &mut TestContext, user: &Keypair, shares: u64, min_usdc_out: u64) { - create_associated_token_account(&mut ctx.svm, &user.pubkey(), &ctx.tsla_mint, &ctx.payer) - .unwrap(); - create_associated_token_account(&mut ctx.svm, &user.pubkey(), &ctx.nvda_mint, &ctx.payer) - .unwrap(); + create_associated_token_account( + &mut ctx.svm, + &user.pubkey(), + &ctx.tsla_mint, + &ctx.payer, + None, + ) + .unwrap(); + create_associated_token_account( + &mut ctx.svm, + &user.pubkey(), + &ctx.nvda_mint, + &ctx.payer, + None, + ) + .unwrap(); let user_usdc = derive_ata(&user.pubkey(), &ctx.usdc_mint); let user_share = derive_ata(&user.pubkey(), &ctx.share_mint_pda); let mut metas = managed_fund::accounts::WithdrawAccountConstraints { @@ -1598,7 +1690,8 @@ fn do_withdraw(ctx: &mut TestContext, user: &Keypair, shares: u64, min_usdc_out: .data(), metas, ); - send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[user], &user.pubkey()).unwrap(); + send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[user], &user.pubkey(), None) + .unwrap(); } #[test] @@ -1615,7 +1708,8 @@ fn test_set_weight_retire() { let user = fund_user(&mut ctx, 100_000_000); let ix = deposit_instruction(&ctx, &user, 100_000_000, 1, deposit_remaining(&ctx)); - let r = send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&user], &user.pubkey()); + let r = + send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&user], &user.pubkey(), None); assert_program_error( r, FundError::FundNotFullyAllocated, @@ -1677,6 +1771,7 @@ fn test_set_weight_rejects_non_manager() { vec![ix], &[&intruder], &intruder.pubkey(), + None, ); // The manager is bound to the fund's stored `manager` by an Anchor // constraint, so the refusal is Anchor's, not one of the program's errors. @@ -1860,6 +1955,7 @@ fn test_deposit_rejects_leg_that_buys_nothing() { vec![ix], &[&attacker], &attacker.pubkey(), + None, ); let err = format!( "{:?}", @@ -1895,7 +1991,8 @@ fn donate_token( amount, ) .unwrap(); - send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[donor], &donor.pubkey()).unwrap(); + send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[donor], &donor.pubkey(), None) + .unwrap(); } /// A fund sitting at its target weights has nothing to rebalance, in either @@ -1980,7 +2077,7 @@ struct ExtraAsset { } fn create_routable_asset(ctx: &mut TestContext, price: i64, rate: u64) -> ExtraAsset { - let mint = create_token_mint(&mut ctx.svm, &ctx.payer, ASSET_DECIMALS, None).unwrap(); + let mint = create_token_mint(&mut ctx.svm, &ctx.payer, ASSET_DECIMALS, None, None).unwrap(); let ix = spl_token::instruction::set_authority( &spl_token::ID, &mint, @@ -1990,8 +2087,14 @@ fn create_routable_asset(ctx: &mut TestContext, price: i64, rate: u64) -> ExtraA &[], ) .unwrap(); - send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&ctx.payer], &ctx.payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut ctx.svm, + vec![ix], + &[&ctx.payer], + &ctx.payer.pubkey(), + None, + ) + .unwrap(); let (rate_pda, _) = Address::find_program_address(&[b"rate", mint.as_ref()], &ctx.router_program_id); set_router_rate(ctx, mint, rate, rate_pda); @@ -2013,8 +2116,14 @@ fn create_routable_asset(ctx: &mut TestContext, price: i64, rate: u64) -> ExtraA } .to_account_metas(None), ); - send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&ctx.payer], &ctx.payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut ctx.svm, + vec![ix], + &[&ctx.payer], + &ctx.payer.pubkey(), + None, + ) + .unwrap(); let vault = derive_ata(&ctx.fund_pda, &mint); ExtraAsset { mint, @@ -2051,7 +2160,8 @@ fn test_rebalance_refuses_buying_overweight_asset() { )); let alice = fund_user(&mut ctx, 1_000_000_000); let ix = deposit_instruction(&ctx, &alice, 1_000_000_000, 1, remaining.clone()); - send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&alice], &alice.pubkey()).unwrap(); + send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&alice], &alice.pubkey(), None) + .unwrap(); // NVDAx and the third asset both rise 30%. NVDAx is about $520 of $1,180 // against a $472 target; the third asset $260 against $236; TSLAx $400 @@ -2068,6 +2178,7 @@ fn test_rebalance_refuses_buying_overweight_asset() { vec![into_third], &[&stranger], &stranger.pubkey(), + None, ); assert_program_error( r, @@ -2082,6 +2193,7 @@ fn test_rebalance_refuses_buying_overweight_asset() { vec![into_itself], &[&stranger], &stranger.pubkey(), + None, ); assert_program_error( r, @@ -2096,6 +2208,7 @@ fn test_rebalance_refuses_buying_overweight_asset() { vec![into_tsla], &[&stranger], &stranger.pubkey(), + None, ) .unwrap(); assert!(read_fund(&ctx).asset_holdings[0] > 160_000_000); @@ -2119,6 +2232,7 @@ fn test_rebalance_rejects_incomplete_assets() { vec![ix], &[&stranger], &stranger.pubkey(), + None, ); assert_program_error( r, @@ -2231,6 +2345,7 @@ fn test_initialize_rejects_threshold_out_of_range() { vec![ix], &[&ctx.manager], &ctx.manager.pubkey(), + None, ); assert_program_error( r, @@ -2336,7 +2451,7 @@ fn test_wide_confidence_price_rejected() { let bob = fund_user(&mut ctx, 480_000_000); let ix = deposit_instruction(&ctx, &bob, 480_000_000, 1, deposit_remaining(&ctx)); assert_program_error( - send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&bob], &bob.pubkey()), + send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&bob], &bob.pubkey(), None), FundError::OracleConfidenceTooWide, "a deposit priced from a wide-confidence feed must fail", ); @@ -2388,7 +2503,7 @@ fn test_partially_verified_price_rejected() { write_partially_verified_price_feed(&mut ctx.svm, ctx.price_feed_nvda, NVDA_PRICE, 2); let ix = deposit_instruction(&ctx, &user, amount, amount, deposit_remaining(&ctx)); assert_program_error( - send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&user], &user.pubkey()), + send_transaction_from_instructions(&mut ctx.svm, vec![ix], &[&user], &user.pubkey(), None), FundError::PriceNotFullyVerified, "a deposit priced from a partially verified update must fail", ); diff --git a/finance/managed-fund/anchor/programs/mock-swap-router/Cargo.toml b/finance/managed-fund/anchor/programs/mock-swap-router/Cargo.toml index 25f00fd60..b358c81a0 100644 --- a/finance/managed-fund/anchor/programs/mock-swap-router/Cargo.toml +++ b/finance/managed-fund/anchor/programs/mock-swap-router/Cargo.toml @@ -20,22 +20,17 @@ custom-heap = [] custom-panic = [] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-signer = "3.0.0" solana-keypair = "3.0.1" -solana-kite = "0.4.0" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/finance/options/anchor/README.md b/finance/options/anchor/README.md index aff24d745..3fcff330c 100644 --- a/finance/options/anchor/README.md +++ b/finance/options/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/finance/options/anchor/programs/options/Cargo.toml b/finance/options/anchor/programs/options/Cargo.toml index 1735fa77e..d534b3710 100644 --- a/finance/options/anchor/programs/options/Cargo.toml +++ b/finance/options/anchor/programs/options/Cargo.toml @@ -26,16 +26,11 @@ profile = ["anchor-v2-testing/profile"] # party's token account for the asset they are about to be paid in, so a call # holder who has never held the underlying needs no separate setup transaction. # The receiving party is always the payer, so nobody funds another's rent. -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" # Declared only so Cargo feature-unification turns on `no-entrypoint`; without # these the test binary links two `entrypoint` symbols and fails to build. spl-token = { version = "9.0.0", features = ["no-entrypoint"] } @@ -56,17 +51,29 @@ spl-associated-token-account = { version = "8.0.0", features = ["no-entrypoint"] # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" # LiteSVM's `get_sysvar` / `set_sysvar` want the host-side Clock type, not # pinocchio's on-chain one; the tests move `unix_timestamp` past an expiry. solana-clock = "3.0.1" -solana-kite = "0.4.0" +solana-kite = "0.7.0" # The suite sends each instruction through LiteSVM itself rather than through # solana-kite's wrapper, so it can read the transaction's metadata back: the # inner instructions say how many token transfers a handler made. The same # version anchor-v2-testing pins, so one copy is linked. -litesvm = "=0.13.1" +litesvm = "0.18.1" borsh = "1.6.1" +# The suite builds each transaction with solana-kite and sends it through +# LiteSVM itself rather than through solana-kite's sender, so it can read the +# transaction's metadata back: the inner instructions say how many token +# transfers a handler made. This crate names the compute unit limit those +# transactions get; same version solana-kite 0.7 builds against. +solana-compute-budget = "4.3" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/finance/options/anchor/programs/options/tests/test_options.rs b/finance/options/anchor/programs/options/tests/test_options.rs index 88a035db6..1f5027e40 100644 --- a/finance/options/anchor/programs/options/tests/test_options.rs +++ b/finance/options/anchor/programs/options/tests/test_options.rs @@ -3,9 +3,7 @@ use { solana_program::instruction::Instruction, system_program, AccountDeserialize, Address, Error as AnchorError, ErrorCode as AnchorErrorCode, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{ - Keypair, LiteSVM, Message, Signer, VersionedMessage, VersionedTransaction, - }, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, litesvm::types::TransactionMetadata, options::{ errors::OptionsError, @@ -15,10 +13,11 @@ use { // LiteSVM's get_sysvar / set_sysvar want the host-side Clock, not // pinocchio's on-chain one. solana_clock::Clock, + solana_compute_budget::compute_budget_limits::MAX_COMPUTE_UNIT_LIMIT, solana_kite::{ - create_associated_token_account, create_token_mint, create_wallet, - get_token_account_balance, mint_tokens_to_token_account, - send_transaction_from_instructions, + build_transaction_from_instructions, create_associated_token_account, create_token_mint, + create_wallet, get_token_account_balance, get_transaction_config, + mint_tokens_to_token_account, send_transaction_from_instructions, }, }; @@ -169,11 +168,12 @@ impl Venue { let payer = create_wallet(&mut svm, 100_000_000_000).unwrap(); let admin = create_wallet(&mut svm, 100_000_000_000).unwrap(); - let underlying_mint = create_token_mint(&mut svm, &admin, NVDAX_DECIMALS, None).unwrap(); + let underlying_mint = + create_token_mint(&mut svm, &admin, NVDAX_DECIMALS, None, None).unwrap(); let quote_mint = if same_mint { underlying_mint } else { - create_token_mint(&mut svm, &admin, USDC_DECIMALS, None).unwrap() + create_token_mint(&mut svm, &admin, USDC_DECIMALS, None, None).unwrap() }; let market = Address::find_program_address( @@ -207,6 +207,7 @@ impl Venue { vec![initialize_market], &[&admin], &admin.pubkey(), + None, ) .map_err(|error| format!("{error:?}"))?; @@ -299,6 +300,7 @@ impl Venue { &keypair.pubkey(), &self.underlying_mint, &self.payer, + None, ) .unwrap() } else { @@ -309,6 +311,7 @@ impl Venue { &keypair.pubkey(), &self.quote_mint, &self.payer, + None, ) .unwrap(); if underlying > 0 { @@ -318,6 +321,7 @@ impl Venue { &underlying_account, underlying, &self.admin, + None, ) .unwrap(); } @@ -328,6 +332,7 @@ impl Venue { "e_account, quote, &self.admin, + None, ) .unwrap(); } @@ -358,14 +363,14 @@ impl Venue { instruction: Instruction, signer: &Keypair, ) -> Result { - let message = Message::new_with_blockhash( + let transaction = build_transaction_from_instructions( + &self.svm, &[instruction], - Some(&signer.pubkey()), - &self.svm.latest_blockhash(), - ); - let transaction = - VersionedTransaction::try_new(VersionedMessage::Legacy(message), &[signer]) - .expect("the payer signs its own transaction"); + &[signer], + &signer.pubkey(), + get_transaction_config(MAX_COMPUTE_UNIT_LIMIT), + ) + .unwrap(); self.svm .send_transaction(transaction) .map_err(|failed| format!("{:?}", failed.err)) diff --git a/finance/order-book/anchor/README.md b/finance/order-book/anchor/README.md index bf0ce38d7..ec2b6a0b9 100644 --- a/finance/order-book/anchor/README.md +++ b/finance/order-book/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). @@ -1579,7 +1579,7 @@ run first. ### Prerequisites -- Anchor 2.0.0-rc.1 +- Anchor 2.0.0-rc.2 - Solana CLI (`solana -V`) - Rust stable (pinned at the repo root) diff --git a/finance/order-book/anchor/programs/order-book/Cargo.toml b/finance/order-book/anchor/programs/order-book/Cargo.toml index 91fa8c3f4..0fae620a5 100644 --- a/finance/order-book/anchor/programs/order-book/Cargo.toml +++ b/finance/order-book/anchor/programs/order-book/Cargo.toml @@ -22,16 +22,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = { version = "2.0.0-rc.1", features = ["compat"] } +anchor-lang = { version = "2.0.0-rc.2", features = ["compat"] } # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" # Used by the ported Openbook slab - `bytemuck::Pod` / `Zeroable` on every node # variant + `min_const_generics` so `[AnyNode; 1024]` can derive Pod without # hitting bytemuck's default-32 array cap. `static_assertions` keeps the slab @@ -54,10 +49,21 @@ static_assertions = "1.1" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" # Match the test stack used by finance/escrow and the other LiteSVM-based # Anchor examples so contributors can move between them without version drift. -solana-kite = "0.4.0" +solana-kite = "0.7.0" +# The depth tests build transactions with solana-kite and send them through +# LiteSVM themselves to read the compute units each one used, which +# solana-kite's sender does not return. This crate names the compute unit +# limit those transactions get; same version solana-kite 0.7 builds against. +solana-compute-budget = "4.3" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/finance/order-book/anchor/programs/order-book/src/state/slab/ordertree.rs b/finance/order-book/anchor/programs/order-book/src/state/slab/ordertree.rs index c226030f5..07c036052 100644 --- a/finance/order-book/anchor/programs/order-book/src/state/slab/ordertree.rs +++ b/finance/order-book/anchor/programs/order-book/src/state/slab/ordertree.rs @@ -32,14 +32,14 @@ pub struct OrderTreeRoot { const_assert_eq!(std::mem::size_of::(), 8); // These types are internal slab implementation details that don't need a -// rich IDL representation. The default IdlBuild impls (create_type → None, -// insert_types → no-op) satisfy anchor build's IDL generation without -// exposing the raw slab internals to clients. +// rich IDL representation. `IdlAccountType`'s defaults (no type definition, no +// account entry) satisfy anchor build's IDL generation without exposing the +// raw slab internals to clients. #[cfg(feature = "idl-build")] -impl anchor_lang::IdlBuild for OrderTreeRoot {} +impl anchor_lang::IdlAccountType for OrderTreeRoot {} #[cfg(feature = "idl-build")] -impl anchor_lang::IdlBuild for OrderTreeNodes {} +impl anchor_lang::IdlAccountType for OrderTreeNodes {} impl OrderTreeRoot { pub fn node(&self) -> Option { diff --git a/finance/order-book/anchor/programs/order-book/tests/test_order_book.rs b/finance/order-book/anchor/programs/order-book/tests/test_order_book.rs index e32ac4957..1f643da38 100644 --- a/finance/order-book/anchor/programs/order-book/tests/test_order_book.rs +++ b/finance/order-book/anchor/programs/order-book/tests/test_order_book.rs @@ -27,11 +27,12 @@ use { InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, + solana_compute_budget::compute_budget_limits::MAX_COMPUTE_UNIT_LIMIT, solana_kite::{ - create_associated_token_account, create_token_mint, create_wallet, get_sol_balance, - get_token_account_balance, mint_tokens_to_token_account, - send_transaction_from_instructions, + build_transaction_from_instructions, create_associated_token_account, create_token_mint, + create_wallet, get_sol_balance, get_token_account_balance, get_transaction_config, + mint_tokens_to_token_account, send_transaction_from_instructions, }, }; @@ -176,19 +177,23 @@ fn full_setup() -> Scenario { let buyer = create_wallet(&mut svm, 10_000_000_000).unwrap(); let seller = create_wallet(&mut svm, 10_000_000_000).unwrap(); - let base_mint = create_token_mint(&mut svm, &authority, BASE_DECIMALS, None).unwrap(); - let quote_mint = create_token_mint(&mut svm, &authority, QUOTE_DECIMALS, None).unwrap(); + let base_mint = create_token_mint(&mut svm, &authority, BASE_DECIMALS, None, None).unwrap(); + let quote_mint = create_token_mint(&mut svm, &authority, QUOTE_DECIMALS, None, None).unwrap(); // Create and fund every trader's ATAs up-front so individual tests do // not need to worry about mint/ATA side effects, only about order-book state. let buyer_base_ata = - create_associated_token_account(&mut svm, &buyer.pubkey(), &base_mint, &payer).unwrap(); + create_associated_token_account(&mut svm, &buyer.pubkey(), &base_mint, &payer, None) + .unwrap(); let buyer_quote_ata = - create_associated_token_account(&mut svm, &buyer.pubkey(), "e_mint, &payer).unwrap(); + create_associated_token_account(&mut svm, &buyer.pubkey(), "e_mint, &payer, None) + .unwrap(); let seller_base_ata = - create_associated_token_account(&mut svm, &seller.pubkey(), &base_mint, &payer).unwrap(); + create_associated_token_account(&mut svm, &seller.pubkey(), &base_mint, &payer, None) + .unwrap(); let seller_quote_ata = - create_associated_token_account(&mut svm, &seller.pubkey(), "e_mint, &payer).unwrap(); + create_associated_token_account(&mut svm, &seller.pubkey(), "e_mint, &payer, None) + .unwrap(); mint_tokens_to_token_account( &mut svm, @@ -196,6 +201,7 @@ fn full_setup() -> Scenario { &seller_base_ata, TRADER_STARTING_BALANCE, &authority, + None, ) .unwrap(); mint_tokens_to_token_account( @@ -204,6 +210,7 @@ fn full_setup() -> Scenario { &buyer_quote_ata, TRADER_STARTING_BALANCE, &authority, + None, ) .unwrap(); @@ -540,6 +547,7 @@ fn initialize_market_and_users(sc: &mut Scenario) { vec![create_ix, init_ix], &[&sc.authority, &sc.order_book], &sc.authority.pubkey(), + None, ) .unwrap(); @@ -549,6 +557,7 @@ fn initialize_market_and_users(sc: &mut Scenario) { vec![buyer_ix], &[&sc.buyer], &sc.buyer.pubkey(), + None, ) .unwrap(); @@ -558,6 +567,7 @@ fn initialize_market_and_users(sc: &mut Scenario) { vec![seller_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); } @@ -584,6 +594,7 @@ fn initialize_market_sets_market_and_order_book() { vec![create_ix, ix], &[&sc.authority, &sc.order_book], &sc.authority.pubkey(), + None, ) .unwrap(); @@ -633,6 +644,7 @@ fn initialize_market_user_tracks_market_and_owner() { vec![create_ix, init_ix], &[&sc.authority, &sc.order_book], &sc.authority.pubkey(), + None, ) .unwrap(); @@ -642,6 +654,7 @@ fn initialize_market_user_tracks_market_and_owner() { vec![create_ix], &[&sc.buyer], &sc.buyer.pubkey(), + None, ) .unwrap(); @@ -670,8 +683,14 @@ fn place_bid_moves_quote_into_vault() { BID_PRICE, BID_QUANTITY, ); - send_transaction_from_instructions(&mut sc.svm, vec![ix], &[&sc.buyer], &sc.buyer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut sc.svm, + vec![ix], + &[&sc.buyer], + &sc.buyer.pubkey(), + None, + ) + .unwrap(); // A bid locks price * quantity * quote_lot_size raw quote tokens. let locked_quote = BID_PRICE * BID_QUANTITY * QUOTE_LOT_SIZE; @@ -715,8 +734,14 @@ fn place_ask_moves_base_into_vault() { ASK_PRICE, ASK_QUANTITY, ); - send_transaction_from_instructions(&mut sc.svm, vec![ix], &[&sc.seller], &sc.seller.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut sc.svm, + vec![ix], + &[&sc.seller], + &sc.seller.pubkey(), + None, + ) + .unwrap(); // An ask locks quantity * base_lot_size raw base tokens in the base vault. assert_eq!( @@ -782,6 +807,7 @@ fn place_order_rejects_unaligned_tick() { vec![create_ix, init_ix], &[&sc.authority, &sc.order_book], &sc.authority.pubkey(), + None, ) .unwrap(); @@ -791,6 +817,7 @@ fn place_order_rejects_unaligned_tick() { vec![create_ix], &[&sc.buyer], &sc.buyer.pubkey(), + None, ) .unwrap(); @@ -837,6 +864,7 @@ fn place_order_rejects_below_min_order_size() { vec![create_ix, init_ix], &[&sc.authority, &sc.order_book], &sc.authority.pubkey(), + None, ) .unwrap(); @@ -846,6 +874,7 @@ fn place_order_rejects_below_min_order_size() { vec![create_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); @@ -895,6 +924,7 @@ fn cancel_ask_credits_unsettled_base() { vec![place_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); @@ -909,6 +939,7 @@ fn cancel_ask_credits_unsettled_base() { vec![cancel_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); @@ -949,6 +980,7 @@ fn cancel_order_rejects_non_owner() { vec![place_ix], &[&sc.buyer], &sc.buyer.pubkey(), + None, ) .unwrap(); @@ -997,6 +1029,7 @@ fn settle_funds_moves_unsettled_base_to_user() { vec![place_ix, cancel_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); @@ -1012,6 +1045,7 @@ fn settle_funds_moves_unsettled_base_to_user() { vec![settle_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); @@ -1057,6 +1091,7 @@ fn cancel_and_settle_bid_refunds_full_quote() { vec![place_ix, cancel_ix, settle_ix], &[&sc.buyer], &sc.buyer.pubkey(), + None, ) .unwrap(); @@ -1106,6 +1141,7 @@ fn settle_funds_rejects_fee_vault_substituted_for_quote_vault() { vec![place_ix, cancel_ix], &[&sc.buyer], &sc.buyer.pubkey(), + None, ) .unwrap(); @@ -1340,6 +1376,7 @@ fn taker_bid_fully_crosses_best_ask() { vec![maker_ask_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); @@ -1362,6 +1399,7 @@ fn taker_bid_fully_crosses_best_ask() { vec![taker_bid_ix], &[&sc.buyer], &sc.buyer.pubkey(), + None, ) .unwrap(); @@ -1417,6 +1455,7 @@ fn taker_ask_fully_crosses_best_bid() { vec![maker_bid_ix], &[&sc.buyer], &sc.buyer.pubkey(), + None, ) .unwrap(); @@ -1438,6 +1477,7 @@ fn taker_ask_fully_crosses_best_bid() { vec![taker_ask_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); @@ -1483,6 +1523,7 @@ fn taker_partially_fills_resting_order_rest_stays_on_book() { vec![ask_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); @@ -1499,8 +1540,14 @@ fn taker_partially_fills_resting_order_rest_stays_on_book() { TAKER_BID_QUANTITY, &[(MAKER_ASK_ID, sc.seller_market_user)], ); - send_transaction_from_instructions(&mut sc.svm, vec![bid_ix], &[&sc.buyer], &sc.buyer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut sc.svm, + vec![bid_ix], + &[&sc.buyer], + &sc.buyer.pubkey(), + None, + ) + .unwrap(); // Maker order: still PartiallyFilled, filled_quantity == TAKER_BID_QUANTITY. let maker_order = order_pda(&sc.program_id, &sc.market, MAKER_ASK_ID); @@ -1553,6 +1600,7 @@ fn taker_partially_filled_remainder_rests_on_book() { vec![ask_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); @@ -1569,8 +1617,14 @@ fn taker_partially_filled_remainder_rests_on_book() { TAKER_BID_QUANTITY, &[(MAKER_ASK_ID, sc.seller_market_user)], ); - send_transaction_from_instructions(&mut sc.svm, vec![bid_ix], &[&sc.buyer], &sc.buyer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut sc.svm, + vec![bid_ix], + &[&sc.buyer], + &sc.buyer.pubkey(), + None, + ) + .unwrap(); // Maker ask is fully filled. let maker_order = order_pda(&sc.program_id, &sc.market, MAKER_ASK_ID); @@ -1633,6 +1687,7 @@ fn taker_crosses_multiple_resting_orders_best_price_first() { vec![ask_one_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); let ask_two_ix = build_place_order_ix( @@ -1651,6 +1706,7 @@ fn taker_crosses_multiple_resting_orders_best_price_first() { vec![ask_two_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); @@ -1675,6 +1731,7 @@ fn taker_crosses_multiple_resting_orders_best_price_first() { vec![taker_ix], &[&sc.buyer], &sc.buyer.pubkey(), + None, ) .unwrap(); @@ -1725,6 +1782,7 @@ fn resting_orders_at_same_price_fill_by_time_priority() { &second_seller.pubkey(), &sc.base_mint, &sc.payer, + None, ) .unwrap(); let second_seller_quote_ata = create_associated_token_account( @@ -1732,6 +1790,7 @@ fn resting_orders_at_same_price_fill_by_time_priority() { &second_seller.pubkey(), &sc.quote_mint, &sc.payer, + None, ) .unwrap(); mint_tokens_to_token_account( @@ -1740,6 +1799,7 @@ fn resting_orders_at_same_price_fill_by_time_priority() { &second_seller_base_ata, TRADER_STARTING_BALANCE, &sc.authority, + None, ) .unwrap(); let second_seller_market_user = @@ -1750,6 +1810,7 @@ fn resting_orders_at_same_price_fill_by_time_priority() { vec![__ix1], &[&second_seller], &second_seller.pubkey(), + None, ) .unwrap(); @@ -1775,6 +1836,7 @@ fn resting_orders_at_same_price_fill_by_time_priority() { vec![__ix2], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); // Seller 2 second in at the same price. @@ -1794,6 +1856,7 @@ fn resting_orders_at_same_price_fill_by_time_priority() { vec![__ix3], &[&second_seller], &second_seller.pubkey(), + None, ) .unwrap(); @@ -1816,6 +1879,7 @@ fn resting_orders_at_same_price_fill_by_time_priority() { vec![taker_ix], &[&sc.buyer], &sc.buyer.pubkey(), + None, ) .unwrap(); @@ -1861,6 +1925,7 @@ fn taker_bid_gets_price_improvement_from_resting_ask() { vec![__ix4], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); @@ -1883,6 +1948,7 @@ fn taker_bid_gets_price_improvement_from_resting_ask() { vec![taker_ix], &[&sc.buyer], &sc.buyer.pubkey(), + None, ) .unwrap(); @@ -1935,6 +2001,7 @@ fn fee_rounds_up_when_gross_is_not_a_bps_multiple() { vec![maker_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); @@ -1956,6 +2023,7 @@ fn fee_rounds_up_when_gross_is_not_a_bps_multiple() { vec![taker_ix], &[&sc.buyer], &sc.buyer.pubkey(), + None, ) .unwrap(); @@ -1997,6 +2065,7 @@ fn fee_vault_receives_exactly_bps_of_taker_gross() { vec![__ix5], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); @@ -2013,8 +2082,14 @@ fn fee_vault_receives_exactly_bps_of_taker_gross() { QUANTITY, &[(MAKER_ASK_ID, sc.seller_market_user)], ); - send_transaction_from_instructions(&mut sc.svm, vec![__ix6], &[&sc.buyer], &sc.buyer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut sc.svm, + vec![__ix6], + &[&sc.buyer], + &sc.buyer.pubkey(), + None, + ) + .unwrap(); assert_eq!( get_token_account_balance(&sc.svm, &sc.fee_vault).unwrap(), @@ -2034,6 +2109,7 @@ fn authority_can_withdraw_fees_after_match() { &sc.authority.pubkey(), &sc.quote_mint, &sc.payer, + None, ) .unwrap(); @@ -2059,6 +2135,7 @@ fn authority_can_withdraw_fees_after_match() { vec![__ix7], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); @@ -2075,8 +2152,14 @@ fn authority_can_withdraw_fees_after_match() { QUANTITY, &[(MAKER_ASK_ID, sc.seller_market_user)], ); - send_transaction_from_instructions(&mut sc.svm, vec![__ix8], &[&sc.buyer], &sc.buyer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut sc.svm, + vec![__ix8], + &[&sc.buyer], + &sc.buyer.pubkey(), + None, + ) + .unwrap(); assert_eq!( get_token_account_balance(&sc.svm, &sc.fee_vault).unwrap(), @@ -2089,6 +2172,7 @@ fn authority_can_withdraw_fees_after_match() { vec![withdraw_ix], &[&sc.authority], &sc.authority.pubkey(), + None, ) .unwrap(); @@ -2133,6 +2217,7 @@ fn withdraw_fees_rejects_a_non_authority_signer() { vec![ask_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); @@ -2149,8 +2234,14 @@ fn withdraw_fees_rejects_a_non_authority_signer() { QUANTITY, &[(MAKER_ASK_ID, sc.seller_market_user)], ); - send_transaction_from_instructions(&mut sc.svm, vec![bid_ix], &[&sc.buyer], &sc.buyer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut sc.svm, + vec![bid_ix], + &[&sc.buyer], + &sc.buyer.pubkey(), + None, + ) + .unwrap(); assert_eq!( get_token_account_balance(&sc.svm, &sc.fee_vault).unwrap(), EXPECTED_FEE @@ -2210,6 +2301,7 @@ fn settle_funds_after_match_pays_out_both_unsettled_balances() { vec![__ix9], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); const TAKER_BID_ID: u64 = 2; @@ -2225,8 +2317,14 @@ fn settle_funds_after_match_pays_out_both_unsettled_balances() { QUANTITY, &[(MAKER_ASK_ID, sc.seller_market_user)], ); - send_transaction_from_instructions(&mut sc.svm, vec![__ix10], &[&sc.buyer], &sc.buyer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut sc.svm, + vec![__ix10], + &[&sc.buyer], + &sc.buyer.pubkey(), + None, + ) + .unwrap(); // Settle both sides. let __ix11 = build_settle_funds_ix( @@ -2236,8 +2334,14 @@ fn settle_funds_after_match_pays_out_both_unsettled_balances() { sc.buyer_base_ata, sc.buyer_quote_ata, ); - send_transaction_from_instructions(&mut sc.svm, vec![__ix11], &[&sc.buyer], &sc.buyer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut sc.svm, + vec![__ix11], + &[&sc.buyer], + &sc.buyer.pubkey(), + None, + ) + .unwrap(); let __ix12 = build_settle_funds_ix( &sc, &sc.seller.pubkey(), @@ -2250,6 +2354,7 @@ fn settle_funds_after_match_pays_out_both_unsettled_balances() { vec![__ix12], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); @@ -2343,14 +2448,12 @@ fn best_ask_depth(svm: &LiteSVM, order_book: &Address) -> usize { // Send one instruction and return the compute units it used. fn send_and_measure(svm: &mut LiteSVM, instruction: Instruction, signer: &Keypair) -> u64 { - let message = anchor_v2_testing::Message::new_with_blockhash( + let transaction = build_transaction_from_instructions( + svm, &[instruction], - Some(&signer.pubkey()), - &svm.latest_blockhash(), - ); - let transaction = anchor_v2_testing::VersionedTransaction::try_new( - anchor_v2_testing::VersionedMessage::Legacy(message), &[signer], + &signer.pubkey(), + get_transaction_config(MAX_COMPUTE_UNIT_LIMIT), ) .unwrap(); svm.send_transaction(transaction) @@ -2378,18 +2481,29 @@ fn order_bump_search_units(program_id: &Address, market: &Address, order_id: u64 // A fresh seller with base tokens and a market user account. fn add_funded_seller(sc: &mut Scenario) -> (Keypair, Address, Address, Address) { let seller = create_wallet(&mut sc.svm, 10_000_000_000).unwrap(); - let base_ata = - create_associated_token_account(&mut sc.svm, &seller.pubkey(), &sc.base_mint, &sc.payer) - .unwrap(); - let quote_ata = - create_associated_token_account(&mut sc.svm, &seller.pubkey(), &sc.quote_mint, &sc.payer) - .unwrap(); + let base_ata = create_associated_token_account( + &mut sc.svm, + &seller.pubkey(), + &sc.base_mint, + &sc.payer, + None, + ) + .unwrap(); + let quote_ata = create_associated_token_account( + &mut sc.svm, + &seller.pubkey(), + &sc.quote_mint, + &sc.payer, + None, + ) + .unwrap(); mint_tokens_to_token_account( &mut sc.svm, &sc.base_mint, &base_ata, TRADER_STARTING_BALANCE, &sc.authority, + None, ) .unwrap(); let market_user = market_user_pda(&sc.program_id, &sc.market, &seller.pubkey()); @@ -2399,6 +2513,7 @@ fn add_funded_seller(sc: &mut Scenario) -> (Keypair, Address, Address, Address) vec![instruction], &[&seller], &seller.pubkey(), + None, ) .unwrap(); (seller, base_ata, quote_ata, market_user) @@ -2447,6 +2562,7 @@ fn run_probes_at_bottom_of_book(build_chain: bool) -> ProbeCosts { vec![instruction], &[&seller], &seller.pubkey(), + None, ) .unwrap(); next_order_id += 1; @@ -2588,7 +2704,7 @@ fn failure_text( payer: &Address, must_fail: &str, ) -> String { - match send_transaction_from_instructions(svm, instructions, signers, payer) { + match send_transaction_from_instructions(svm, instructions, signers, payer, None) { Ok(_) => panic!("{must_fail}"), Err(error) => format!("{error:?}"), } @@ -2613,23 +2729,40 @@ struct Trader { fn create_trader(sc: &mut Scenario) -> Trader { let keypair = create_wallet(&mut sc.svm, 10_000_000_000).unwrap(); - let base_ata = - create_associated_token_account(&mut sc.svm, &keypair.pubkey(), &sc.base_mint, &sc.payer) - .unwrap(); - let quote_ata = - create_associated_token_account(&mut sc.svm, &keypair.pubkey(), &sc.quote_mint, &sc.payer) - .unwrap(); + let base_ata = create_associated_token_account( + &mut sc.svm, + &keypair.pubkey(), + &sc.base_mint, + &sc.payer, + None, + ) + .unwrap(); + let quote_ata = create_associated_token_account( + &mut sc.svm, + &keypair.pubkey(), + &sc.quote_mint, + &sc.payer, + None, + ) + .unwrap(); mint_tokens_to_token_account( &mut sc.svm, &sc.quote_mint, "e_ata, TRADER_STARTING_BALANCE, &sc.authority, + None, ) .unwrap(); let init_ix = build_initialize_market_user_ix(sc, &keypair.pubkey()); - send_transaction_from_instructions(&mut sc.svm, vec![init_ix], &[&keypair], &keypair.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut sc.svm, + vec![init_ix], + &[&keypair], + &keypair.pubkey(), + None, + ) + .unwrap(); let market_user = market_user_pda(&sc.program_id, &sc.market, &keypair.pubkey()); Trader { keypair, @@ -2665,6 +2798,7 @@ fn fill_bid_side(sc: &mut Scenario) -> Vec { vec![ix], &[&filler.keypair], &filler.keypair.pubkey(), + None, ) .unwrap_or_else(|error| panic!("bid {order_id} should rest: {error:?}")); } @@ -2696,6 +2830,7 @@ fn place_bid( vec![ix], &[&trader.keypair], &trader.keypair.pubkey(), + None, ) .map_err(|error| format!("{error:?}")) } @@ -2824,6 +2959,7 @@ fn evicted_maker_settles_their_refund() { vec![settle_ix], &[&evicted.keypair], &evicted.keypair.pubkey(), + None, ) .unwrap(); @@ -2927,6 +3063,7 @@ fn trader_can_evict_their_own_worst_order() { vec![ix], &[&owner.keypair], &owner.keypair.pubkey(), + None, ) .unwrap(); @@ -2992,7 +3129,7 @@ fn send_market_switch( instruction: Instruction, signer: &Keypair, ) -> Result<(), String> { - send_transaction_from_instructions(svm, vec![instruction], &[signer], &signer.pubkey()) + send_transaction_from_instructions(svm, vec![instruction], &[signer], &signer.pubkey(), None) .map_err(|error| format!("{error:?}")) } @@ -3010,8 +3147,14 @@ fn place_pause_ask(sc: &mut Scenario) -> Result<(), String> { PAUSE_PRICE, PAUSE_QUANTITY, ); - send_transaction_from_instructions(&mut sc.svm, vec![ix], &[&sc.seller], &sc.seller.pubkey()) - .map_err(|error| format!("{error:?}")) + send_transaction_from_instructions( + &mut sc.svm, + vec![ix], + &[&sc.seller], + &sc.seller.pubkey(), + None, + ) + .map_err(|error| format!("{error:?}")) } #[test] @@ -3072,6 +3215,7 @@ fn paused_market_still_cancels_and_settles_a_resting_order() { vec![cancel_ix, settle_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); @@ -3100,6 +3244,7 @@ fn paused_market_still_pays_out_fills_and_withdraws_fees() { &sc.authority.pubkey(), &sc.quote_mint, &sc.payer, + None, ) .unwrap(); @@ -3118,8 +3263,14 @@ fn paused_market_still_pays_out_fills_and_withdraws_fees() { PAUSE_QUANTITY, &[(PAUSE_ASK_ID, sc.seller_market_user)], ); - send_transaction_from_instructions(&mut sc.svm, vec![bid_ix], &[&sc.buyer], &sc.buyer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut sc.svm, + vec![bid_ix], + &[&sc.buyer], + &sc.buyer.pubkey(), + None, + ) + .unwrap(); let expected_fee = fee_ceil(PAUSE_GROSS); assert_eq!( get_token_account_balance(&sc.svm, &sc.fee_vault).unwrap(), @@ -3142,6 +3293,7 @@ fn paused_market_still_pays_out_fills_and_withdraws_fees() { vec![settle_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); assert_eq!( @@ -3156,6 +3308,7 @@ fn paused_market_still_pays_out_fills_and_withdraws_fees() { vec![withdraw_ix], &[&sc.authority], &sc.authority.pubkey(), + None, ) .unwrap(); assert_eq!( @@ -3242,6 +3395,7 @@ fn only_the_market_authority_can_pause_or_resume() { vec![bid_ix], &[&sc.buyer], &sc.buyer.pubkey(), + None, ) .map_err(|error| format!("{error:?}")) .expect_err("a paused market must not take an order"); @@ -3289,6 +3443,7 @@ fn transaction_fee(svm: &mut LiteSVM, wallet: &Keypair) -> u64 { vec![system_instruction::transfer(&address, &address, 0)], &[wallet], &address, + None, ) .unwrap(); before - get_sol_balance(svm, &address) @@ -3312,6 +3467,7 @@ fn place_close_ask(sc: &mut Scenario) { vec![ask_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); } @@ -3332,8 +3488,14 @@ fn cross_close_ask(sc: &mut Scenario, quantity: u64) { quantity, &[(CLOSE_ASK_ID, sc.seller_market_user)], ); - send_transaction_from_instructions(&mut sc.svm, vec![bid_ix], &[&sc.buyer], &sc.buyer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut sc.svm, + vec![bid_ix], + &[&sc.buyer], + &sc.buyer.pubkey(), + None, + ) + .unwrap(); } /// The seller cancels their ask, which credits its locked base to their @@ -3346,6 +3508,7 @@ fn cancel_close_ask(sc: &mut Scenario) { vec![cancel_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); } @@ -3364,6 +3527,7 @@ fn settle_seller(sc: &mut Scenario) { vec![settle_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); } @@ -3381,7 +3545,8 @@ fn assert_close_returns_rent( let fee = transaction_fee(svm, owner); let before = get_sol_balance(svm, &owner.pubkey()); - send_transaction_from_instructions(svm, vec![close_ix], &[owner], &owner.pubkey()).unwrap(); + send_transaction_from_instructions(svm, vec![close_ix], &[owner], &owner.pubkey(), None) + .unwrap(); assert!(!account_is_open(svm, account)); assert_eq!(get_sol_balance(svm, &owner.pubkey()), before + rent - fee); @@ -3530,6 +3695,7 @@ fn close_market_user_returns_rent_when_nothing_is_open_or_owed() { vec![reinit_ix], &[&sc.seller], &sc.seller.pubkey(), + None, ) .unwrap(); assert!(account_is_open(&sc.svm, &sc.seller_market_user)); @@ -3633,6 +3799,7 @@ fn evicted_order_and_its_owners_market_user_close_after_settling() { vec![cancel_ix], &[&evicted.keypair], &evicted.keypair.pubkey(), + None, ) .unwrap(); } @@ -3648,6 +3815,7 @@ fn evicted_order_and_its_owners_market_user_close_after_settling() { vec![settle_ix], &[&evicted.keypair], &evicted.keypair.pubkey(), + None, ) .unwrap(); assert_eq!(read_open_order_count(&sc.svm, &evicted.market_user), 0); diff --git a/finance/perpetual-futures/anchor/README.md b/finance/perpetual-futures/anchor/README.md index 49a58598e..091dd4014 100644 --- a/finance/perpetual-futures/anchor/README.md +++ b/finance/perpetual-futures/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/finance/perpetual-futures/anchor/programs/mock-price-feed/Cargo.toml b/finance/perpetual-futures/anchor/programs/mock-price-feed/Cargo.toml index 9093d6c60..06f131cb9 100644 --- a/finance/perpetual-futures/anchor/programs/mock-price-feed/Cargo.toml +++ b/finance/perpetual-futures/anchor/programs/mock-price-feed/Cargo.toml @@ -20,15 +20,10 @@ custom-heap = [] custom-panic = [] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" +wincode = { version = "0.6", features = ["derive"] } [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/finance/perpetual-futures/anchor/programs/perpetual-futures/Cargo.toml b/finance/perpetual-futures/anchor/programs/perpetual-futures/Cargo.toml index 42ad14526..09a321a50 100644 --- a/finance/perpetual-futures/anchor/programs/perpetual-futures/Cargo.toml +++ b/finance/perpetual-futures/anchor/programs/perpetual-futures/Cargo.toml @@ -25,20 +25,15 @@ profile = ["anchor-v2-testing/profile"] # init-if-needed lets add_liquidity create the provider's liquidity-provider # token account on their first deposit. The provider is the payer, so this does # not let one party fund another's rent. -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } +wincode = { version = "0.6", features = ["derive"] } # `last_restart.rs` reads the LastRestartSlot sysvar through pinocchio's # `get_sysvar` wrapper: pinocchio (and so anchor-lang v2) ships only the # Clock and Rent sysvars as typed accessors. pinocchio = "0.11" -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +anchor-spl = "2.0.0-rc.2" # Not used directly. Declared so Cargo feature unification turns on # `no-entrypoint` for the spl-token that anchor-spl pulls in; without it the # integration-test binary links two `entrypoint` symbols (this program's and @@ -65,9 +60,15 @@ solana-sysvar = "3" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" solana-clock = "3.0.1" -solana-kite = "0.4.0" +solana-kite = "0.7.0" borsh = "1.6.1" # The LiteSVM tests load the compiled mock oracle program; depending on the # crate here lets the tests reuse its instruction-argument types and program ID. diff --git a/finance/perpetual-futures/anchor/programs/perpetual-futures/tests/test_perpetual_futures.rs b/finance/perpetual-futures/anchor/programs/perpetual-futures/tests/test_perpetual_futures.rs index af8d616c3..e058c13e5 100644 --- a/finance/perpetual-futures/anchor/programs/perpetual-futures/tests/test_perpetual_futures.rs +++ b/finance/perpetual-futures/anchor/programs/perpetual-futures/tests/test_perpetual_futures.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, AccountDeserialize, Address, Error as AnchorError, ErrorCode as AnchorErrorCode, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, perpetual_futures::{ errors::PerpError, instructions::{ @@ -161,7 +161,7 @@ impl Market { let payer = create_wallet(&mut svm, 100_000_000_000).unwrap(); let admin = create_wallet(&mut svm, 100_000_000_000).unwrap(); - let collateral_mint = create_token_mint(&mut svm, &admin, DECIMALS, None).unwrap(); + let collateral_mint = create_token_mint(&mut svm, &admin, DECIMALS, None, None).unwrap(); // Create the mock oracle feed as a fresh account owned by the mock // program; the admin is its update authority. @@ -186,6 +186,7 @@ impl Market { vec![initialize_feed], &[&admin, &feed_keypair], &admin.pubkey(), + None, ) .unwrap(); let feed = feed_keypair.pubkey(); @@ -221,6 +222,7 @@ impl Market { vec![initialize_pool], &[&admin], &admin.pubkey(), + None, ) .map_err(|error| format!("{error:?}"))?; @@ -265,6 +267,7 @@ impl Market { vec![set_price], &[&self.admin], &self.admin.pubkey(), + None, ) .unwrap(); } @@ -327,6 +330,7 @@ impl Market { &liquidator.pubkey(), &self.collateral_mint, &self.payer, + None, ) .unwrap(); (liquidator, liquidator_collateral) @@ -359,6 +363,7 @@ impl Market { &trader.pubkey(), &self.collateral_mint, &self.payer, + None, ) .unwrap(); mint_tokens_to_token_account( @@ -367,6 +372,7 @@ impl Market { &token_account, amount, &self.admin, + None, ) .unwrap(); (trader, token_account) @@ -407,6 +413,7 @@ impl Market { vec![instruction], &[provider], &provider.pubkey(), + None, ) .map_err(|error| format!("{error:?}")) } @@ -446,6 +453,7 @@ impl Market { vec![instruction], &[provider], &provider.pubkey(), + None, ) .map_err(|error| format!("{error:?}")) } @@ -500,6 +508,7 @@ impl Market { vec![instruction], &[trader], &trader.pubkey(), + None, ) .map_err(|error| format!("{error:?}")) } @@ -534,6 +543,7 @@ impl Market { vec![instruction], &[trader], &trader.pubkey(), + None, ) .map_err(|error| format!("{error:?}")) } @@ -571,6 +581,7 @@ impl Market { vec![instruction], &[liquidator], &liquidator.pubkey(), + None, ) .map_err(|error| format!("{error:?}")) } @@ -597,6 +608,7 @@ impl Market { vec![instruction], &[authority], &authority.pubkey(), + None, ) .map_err(|error| format!("{error:?}")) } @@ -617,6 +629,7 @@ impl Market { vec![instruction], &[caller], &caller.pubkey(), + None, ) .map_err(|error| format!("{error:?}")) } @@ -1089,8 +1102,11 @@ fn test_stale_price_rejected() { let collateral = 1_000 * ONE_USDC; let (trader, trader_collateral) = market.funded_trader(collateral); - // Move far past the staleness window without refreshing the feed. - market.warp(10_000); + // Move far past the staleness window without refreshing the feed. The warp + // is relative because LiteSVM starts at a recent mainnet slot rather than + // slot 0. + let now = market.current_slot(); + market.warp(now + 10_000); assert_fails_with( market.open_position( &trader, @@ -1403,6 +1419,7 @@ fn test_liquidation_of_underwater_long() { &liquidator.pubkey(), &market.collateral_mint, &market.payer, + None, ) .unwrap(); @@ -1438,6 +1455,7 @@ fn test_healthy_position_cannot_be_liquidated() { &liquidator.pubkey(), &market.collateral_mint, &market.payer, + None, ) .unwrap(); @@ -1470,6 +1488,7 @@ fn test_collect_fees() { &admin.pubkey(), &market.collateral_mint, &market.payer, + None, ) .unwrap(); market.collect_fees(&admin).unwrap(); @@ -1509,6 +1528,7 @@ fn test_collect_fees_requires_authority() { &imposter.pubkey(), &market.collateral_mint, &market.payer, + None, ) .unwrap(); // The `authority` account is bound to `pool.authority` by an `address` diff --git a/finance/prop-amm/anchor/README.md b/finance/prop-amm/anchor/README.md index b4235378e..f9083587e 100644 --- a/finance/prop-amm/anchor/README.md +++ b/finance/prop-amm/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/finance/prop-amm/anchor/programs/mock-price-feed/Cargo.toml b/finance/prop-amm/anchor/programs/mock-price-feed/Cargo.toml index f01220b60..2f880f2d3 100644 --- a/finance/prop-amm/anchor/programs/mock-price-feed/Cargo.toml +++ b/finance/prop-amm/anchor/programs/mock-price-feed/Cargo.toml @@ -25,15 +25,10 @@ custom-heap = [] custom-panic = [] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" +wincode = { version = "0.6", features = ["derive"] } [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/finance/prop-amm/anchor/programs/prop-amm/Cargo.toml b/finance/prop-amm/anchor/programs/prop-amm/Cargo.toml index 448706098..97e6cc47b 100644 --- a/finance/prop-amm/anchor/programs/prop-amm/Cargo.toml +++ b/finance/prop-amm/anchor/programs/prop-amm/Cargo.toml @@ -24,20 +24,15 @@ profile = ["anchor-v2-testing/profile"] [dependencies] # init-if-needed: swap creates the trader's destination token account when it # doesn't exist yet, so a first-time buyer needs no separate setup transaction. -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } +wincode = { version = "0.6", features = ["derive"] } # `last_restart.rs` reads the LastRestartSlot sysvar through pinocchio's # `get_sysvar` wrapper: pinocchio (and so anchor-lang v2) ships only the # Clock and Rent sysvars as typed accessors. pinocchio = "0.11" -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +anchor-spl = "2.0.0-rc.2" # For the LastRestartSlot sysvar (not re-exported by anchor-lang): the oracle # reader rejects prices from before a cluster restart. Same major as the # solana-sysvar anchor-lang itself uses, so only one copy is compiled in. @@ -62,9 +57,15 @@ spl-associated-token-account = { version = "8.0.0", features = ["no-entrypoint"] # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" solana-clock = "3.0.1" -solana-kite = "0.4.0" +solana-kite = "0.7.0" borsh = "1.6.1" # The LiteSVM tests load the compiled mock oracle program; depending on the # crate here lets the tests reuse its instruction-argument types and program ID. diff --git a/finance/prop-amm/anchor/programs/prop-amm/tests/test_prop_amm.rs b/finance/prop-amm/anchor/programs/prop-amm/tests/test_prop_amm.rs index 11be07b4e..393aad1e8 100644 --- a/finance/prop-amm/anchor/programs/prop-amm/tests/test_prop_amm.rs +++ b/finance/prop-amm/anchor/programs/prop-amm/tests/test_prop_amm.rs @@ -4,7 +4,7 @@ use { system_program, AccountDeserialize, Address, Error as AnchorError, ErrorCode as AnchorErrorCode, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, prop_amm::{ errors::PropAmmError, instructions::initialize_market::MarketParameters, @@ -145,8 +145,8 @@ impl Market { let payer = create_wallet(&mut svm, 100_000_000_000).unwrap(); let operator = create_wallet(&mut svm, 100_000_000_000).unwrap(); - let base_mint = create_token_mint(&mut svm, &operator, NVDAX_DECIMALS, None).unwrap(); - let quote_mint = create_token_mint(&mut svm, &operator, USDC_DECIMALS, None).unwrap(); + let base_mint = create_token_mint(&mut svm, &operator, NVDAX_DECIMALS, None, None).unwrap(); + let quote_mint = create_token_mint(&mut svm, &operator, USDC_DECIMALS, None, None).unwrap(); // Create the mock oracle feed as a fresh account owned by the mock // program; the operator is its update authority. @@ -171,6 +171,7 @@ impl Market { vec![initialize_feed], &[&operator, &feed_keypair], &operator.pubkey(), + None, ) .unwrap(); let feed = feed_keypair.pubkey(); @@ -207,22 +208,29 @@ impl Market { vec![initialize_market], &[&operator], &operator.pubkey(), + None, ) .map_err(|error| format!("{error:?}"))?; // Fund the operator's inventory accounts. let operator_base = - create_associated_token_account(&mut svm, &operator.pubkey(), &base_mint, &payer) - .unwrap(); - let operator_quote = - create_associated_token_account(&mut svm, &operator.pubkey(), "e_mint, &payer) + create_associated_token_account(&mut svm, &operator.pubkey(), &base_mint, &payer, None) .unwrap(); + let operator_quote = create_associated_token_account( + &mut svm, + &operator.pubkey(), + "e_mint, + &payer, + None, + ) + .unwrap(); mint_tokens_to_token_account( &mut svm, &base_mint, &operator_base, 10_000 * ONE_NVDAX, &operator, + None, ) .unwrap(); mint_tokens_to_token_account( @@ -231,6 +239,7 @@ impl Market { &operator_quote, 10_000_000 * ONE_USDC, &operator, + None, ) .unwrap(); @@ -282,6 +291,7 @@ impl Market { vec![set_price], &[&self.operator], &self.operator.pubkey(), + None, ) .unwrap(); } @@ -313,6 +323,7 @@ impl Market { &trader.pubkey(), &self.base_mint, &self.payer, + None, ) .unwrap(); let quote_account = create_associated_token_account( @@ -320,6 +331,7 @@ impl Market { &trader.pubkey(), &self.quote_mint, &self.payer, + None, ) .unwrap(); if base > 0 { @@ -329,6 +341,7 @@ impl Market { &base_account, base, &self.operator, + None, ) .unwrap(); } @@ -339,6 +352,7 @@ impl Market { "e_account, quote, &self.operator, + None, ) .unwrap(); } @@ -404,6 +418,7 @@ impl Market { vec![instruction], &[signer], &signer.pubkey(), + None, ) .map(|_| ()) .map_err(|error| format!("{error:?}")) @@ -439,6 +454,7 @@ impl Market { vec![instruction], &[signer], &signer.pubkey(), + None, ) .map(|_| ()) .map_err(|error| format!("{error:?}")) @@ -487,6 +503,7 @@ impl Market { vec![instruction], &[trader], &trader.pubkey(), + None, ) .map(|_| ()) .map_err(|error| format!("{error:?}")) @@ -523,6 +540,7 @@ impl Market { vec![instruction], &[&payer, signer], &payer.pubkey(), + None, ) .map(|_| ()) .map_err(|error| format!("{error:?}")) @@ -566,6 +584,7 @@ impl Market { vec![transfer], &[sender], &sender.pubkey(), + None, ) .expect("a plain token transfer into a vault should succeed"); } @@ -947,9 +966,11 @@ fn test_swap_rejects_slippage() { fn test_swap_rejects_stale_price() { let mut market = Market::default_market(); let (alice, _, _) = market.funded_trader(0, FIVE_NVDAX_AT_THE_ASK); - // The feed was last updated near slot 0; 200 slots later it is stale - // (the bound is 150 slots). - market.warp(200); + // The feed was last updated during setup; 200 slots later it is stale + // (the bound is 150 slots). The warp is relative because LiteSVM starts at + // a recent mainnet slot rather than slot 0. + let now = market.current_slot(); + market.warp(now + 200); assert_fails_with( market.swap(&alice, Direction::BuyBase, FIVE_NVDAX_AT_THE_ASK, 0), PropAmmError::StalePrice, diff --git a/finance/token-swap/README.md b/finance/token-swap/README.md index 303124f2c..cd6225a6c 100644 --- a/finance/token-swap/README.md +++ b/finance/token-swap/README.md @@ -17,7 +17,7 @@ The pool keeps `x * y = K` invariant: if `x` is the reserve of token A and `y` i - **Caller-supplied [slippage](https://www.investopedia.com/terms/s/slippage.asp) floors on every state-changing [instruction](https://solana.com/docs/terminology#instruction):** swaps revert with `SlippageExceeded` if the output falls below `min_output_amount`, deposits revert with `DepositBelowMinimum` if the LP mint amount falls below `minimum_lp_tokens_out`, withdrawals revert with `WithdrawalBelowMinimum` if either side falls below its floor. - **Defence-in-depth invariant check:** every swap re-verifies `effective_pool_a * effective_pool_b` doesn't decrease after the transfers, so a bug in the curve math fails the transaction instead of silently giving the trader too much. - All financial math in `u128` with checked arithmetic, matching how production Solana AMMs (Orca, Raydium, Meteora, Saber) do it. -- Anchor 2.0.0-rc.1 Rust [program](https://solana.com/docs/terminology#program) with LiteSVM integration tests. +- Anchor 2.0.0-rc.2 Rust [program](https://solana.com/docs/terminology#program) with LiteSVM integration tests. ## Why a CPAMM diff --git a/finance/token-swap/anchor/README.md b/finance/token-swap/anchor/README.md index 54ff0ff74..5c53f7943 100644 --- a/finance/token-swap/anchor/README.md +++ b/finance/token-swap/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/finance/token-swap/anchor/programs/token-swap/Cargo.toml b/finance/token-swap/anchor/programs/token-swap/Cargo.toml index 6d4245d3c..99ba1c5cd 100644 --- a/finance/token-swap/anchor/programs/token-swap/Cargo.toml +++ b/finance/token-swap/anchor/programs/token-swap/Cargo.toml @@ -22,16 +22,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = { version = "2.0.0-rc.1", features = ["compat"] } +anchor-lang = { version = "2.0.0-rc.2", features = ["compat"] } # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" # `fixed` removed: all financial math is now u128 + checked_*, matching how # production Solana AMMs (Orca, Raydium, Meteora, Saber) do it. Floats / # fixed-point types are not used for money in this program. @@ -51,8 +46,14 @@ anchor-spl = "2.0.0-rc.1" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/finance/token-swap/anchor/programs/token-swap/tests/test_swap.rs b/finance/token-swap/anchor/programs/token-swap/tests/test_swap.rs index 3fae17a9a..4bc3d969b 100644 --- a/finance/token-swap/anchor/programs/token-swap/tests/test_swap.rs +++ b/finance/token-swap/anchor/programs/token-swap/tests/test_swap.rs @@ -5,7 +5,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{ create_associated_token_account, create_token_mint, create_wallet, get_token_account_balance, mint_tokens_to_token_account, @@ -68,8 +68,8 @@ fn setup() -> (LiteSVM, Address, Keypair) { /// Ensure mint_a < mint_b by pubkey ordering (the program may require this). fn ordered_mints(svm: &mut LiteSVM, authority: &Keypair, decimals: u8) -> (Address, Address) { loop { - let a = create_token_mint(svm, authority, decimals, None).unwrap(); - let b = create_token_mint(svm, authority, decimals, None).unwrap(); + let a = create_token_mint(svm, authority, decimals, None, None).unwrap(); + let b = create_token_mint(svm, authority, decimals, None, None).unwrap(); if a.as_ref() < b.as_ref() { return (a, b); } @@ -156,14 +156,28 @@ fn setup_config_and_mints() -> TestSetup { // Create ATAs for admin and mint tokens let holder_account_a = - create_associated_token_account(&mut svm, &admin.pubkey(), &mint_a, &payer).unwrap(); + create_associated_token_account(&mut svm, &admin.pubkey(), &mint_a, &payer, None).unwrap(); let holder_account_b = - create_associated_token_account(&mut svm, &admin.pubkey(), &mint_b, &payer).unwrap(); + create_associated_token_account(&mut svm, &admin.pubkey(), &mint_b, &payer, None).unwrap(); - mint_tokens_to_token_account(&mut svm, &mint_a, &holder_account_a, minted_amount, &admin) - .unwrap(); - mint_tokens_to_token_account(&mut svm, &mint_b, &holder_account_b, minted_amount, &admin) - .unwrap(); + mint_tokens_to_token_account( + &mut svm, + &mint_a, + &holder_account_a, + minted_amount, + &admin, + None, + ) + .unwrap(); + mint_tokens_to_token_account( + &mut svm, + &mint_b, + &holder_account_b, + minted_amount, + &admin, + None, + ) + .unwrap(); // Create AMM let initialize_config_ix = Instruction::new_with_bytes( @@ -186,6 +200,7 @@ fn setup_config_and_mints() -> TestSetup { vec![initialize_config_ix], &[&payer], &payer.pubkey(), + None, ) .unwrap(); @@ -241,6 +256,7 @@ fn send_initialize_pool(ts: &mut TestSetup, amount_a: u64, amount_b: u64) -> Res vec![ix], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ) .map(|_| ()) .map_err(|e| format!("{e:?}")) @@ -286,6 +302,7 @@ fn test_initialize_config() { vec![initialize_config_ix], &[&payer], &payer.pubkey(), + None, ) .unwrap(); @@ -413,13 +430,15 @@ struct Depositor { fn fund_depositor(ts: &mut TestSetup, amount_a: u64, amount_b: u64) -> Depositor { let wallet = create_wallet(&mut ts.svm, 10_000_000_000).unwrap(); let token_a = - create_associated_token_account(&mut ts.svm, &wallet.pubkey(), &ts.mint_a, &ts.payer) + create_associated_token_account(&mut ts.svm, &wallet.pubkey(), &ts.mint_a, &ts.payer, None) .unwrap(); let token_b = - create_associated_token_account(&mut ts.svm, &wallet.pubkey(), &ts.mint_b, &ts.payer) + create_associated_token_account(&mut ts.svm, &wallet.pubkey(), &ts.mint_b, &ts.payer, None) .unwrap(); - mint_tokens_to_token_account(&mut ts.svm, &ts.mint_a, &token_a, amount_a, &ts.admin).unwrap(); - mint_tokens_to_token_account(&mut ts.svm, &ts.mint_b, &token_b, amount_b, &ts.admin).unwrap(); + mint_tokens_to_token_account(&mut ts.svm, &ts.mint_a, &token_a, amount_a, &ts.admin, None) + .unwrap(); + mint_tokens_to_token_account(&mut ts.svm, &ts.mint_b, &token_b, amount_b, &ts.admin, None) + .unwrap(); let lp_token = derive_ata(&wallet.pubkey(), &ts.liquidity_provider_mint); Depositor { wallet, @@ -468,6 +487,7 @@ fn send_deposit_from( vec![ix], &[&ts.payer, &depositor.wallet], &ts.payer.pubkey(), + None, ) .map(|_| ()) .map_err(|e| format!("{e:?}")) @@ -498,6 +518,7 @@ fn test_pool_creation_cannot_be_front_run() { &ts.holder_account_a, 300 * one, &ts.admin, + None, ) .unwrap(); mint_tokens_to_token_account( @@ -506,6 +527,7 @@ fn test_pool_creation_cannot_be_front_run() { &ts.holder_account_b, 800 * one, &ts.admin, + None, ) .unwrap(); send_initialize_pool(&mut ts, 400 * one, 900 * one).expect("Maria opens the pool"); @@ -561,6 +583,7 @@ fn test_pool_creation_cannot_be_front_run() { &mallory.token_b, 100 * one, &ts.admin, + None, ) .unwrap(); assert_error_code( @@ -608,6 +631,7 @@ fn test_swap_a_to_b() { vec![swap_ix], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ) .unwrap(); @@ -661,6 +685,7 @@ fn test_withdraw_liquidity() { vec![withdraw_ix], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ) .unwrap(); @@ -722,6 +747,7 @@ fn swap_a_to_b(ts: &mut TestSetup, input_amount: u64) { vec![swap_ix], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ) .unwrap(); } @@ -752,6 +778,7 @@ fn test_claim_admin_fees() { vec![claim_ix_first], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ) .unwrap(); @@ -793,6 +820,7 @@ fn test_claim_admin_fees() { vec![claim_ix_second], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ) .unwrap(); @@ -832,6 +860,7 @@ fn test_claim_admin_fees() { vec![claim_ix_again], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ); assert_error_code(result, AmmError::NothingToClaim, "NothingToClaim"); @@ -853,12 +882,22 @@ fn test_claim_admin_fees_rejects_non_admin() { // Create a non-admin actor with their own ATAs and try to claim. let attacker = create_wallet(&mut ts.svm, 100_000_000_000).unwrap(); - let attacker_token_a = - create_associated_token_account(&mut ts.svm, &attacker.pubkey(), &ts.mint_a, &ts.payer) - .unwrap(); - let attacker_token_b = - create_associated_token_account(&mut ts.svm, &attacker.pubkey(), &ts.mint_b, &ts.payer) - .unwrap(); + let attacker_token_a = create_associated_token_account( + &mut ts.svm, + &attacker.pubkey(), + &ts.mint_a, + &ts.payer, + None, + ) + .unwrap(); + let attacker_token_b = create_associated_token_account( + &mut ts.svm, + &attacker.pubkey(), + &ts.mint_b, + &ts.payer, + None, + ) + .unwrap(); let claim_ix = Instruction::new_with_bytes( ts.program_id, @@ -885,6 +924,7 @@ fn test_claim_admin_fees_rejects_non_admin() { vec![claim_ix], &[&ts.payer, &attacker], &ts.payer.pubkey(), + None, ); assert_custom_error(result, 2012, "ConstraintAddress"); } @@ -935,6 +975,7 @@ fn send_deposit(ts: &mut TestSetup, amount_a: u64, amount_b: u64) -> Result<(), vec![ix], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ) .map(|_| ()) .map_err(|e| format!("{e:?}")) @@ -1091,6 +1132,7 @@ fn test_deposit_after_swap_uses_shifted_effective_ratio() { vec![swap_ix], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ) .expect("swap a→b"); @@ -1214,6 +1256,7 @@ fn test_lp_mint_proportional_to_share_of_pool() { vec![withdraw], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ) .expect("withdraw the second deposit's LP"); let pool_a_after = get_token_account_balance(&ts.svm, &ts.pool_a).unwrap(); @@ -1303,8 +1346,24 @@ fn test_donation_cannot_round_a_later_deposit_to_zero() { // The donation: tokens sent straight to the vaults, no LP minted. let donation: u64 = 1_000_000; - mint_tokens_to_token_account(&mut ts.svm, &ts.mint_a, &ts.pool_a, donation, &ts.admin).unwrap(); - mint_tokens_to_token_account(&mut ts.svm, &ts.mint_b, &ts.pool_b, donation, &ts.admin).unwrap(); + mint_tokens_to_token_account( + &mut ts.svm, + &ts.mint_a, + &ts.pool_a, + donation, + &ts.admin, + None, + ) + .unwrap(); + mint_tokens_to_token_account( + &mut ts.svm, + &ts.mint_b, + &ts.pool_b, + donation, + &ts.admin, + None, + ) + .unwrap(); // The victim deposits exactly as much as was donated. Dividing by the // bare supply of 1 would mint 1_000_000 * 1 / 1_000_101 = 0 LP tokens. @@ -1327,6 +1386,7 @@ fn test_donation_cannot_round_a_later_deposit_to_zero() { vec![attacker_exit], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ) .expect("attacker withdraws"); let attacker_a_back = @@ -1355,6 +1415,7 @@ fn test_deposit_after_every_lp_token_is_burned() { vec![withdraw_all], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ) .expect("withdraw everything"); assert_eq!(get_token_account_balance(&ts.svm, &ts.pool_a).unwrap(), 100); @@ -1488,6 +1549,7 @@ fn test_swap_reverts_when_output_below_min() { vec![baseline_ix], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ) .expect("baseline swap should succeed"); let after_b = get_token_account_balance(&ts.svm, &ts.holder_account_b).unwrap(); @@ -1505,6 +1567,7 @@ fn test_swap_reverts_when_output_below_min() { vec![strict_ix], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ); assert_error_code(result, AmmError::SlippageExceeded, "SlippageExceeded"); } @@ -1536,6 +1599,7 @@ fn test_deposit_reverts_when_lp_below_min() { vec![strict_ix], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ); assert_error_code(result, AmmError::DepositBelowMinimum, "DepositBelowMinimum"); @@ -1546,6 +1610,7 @@ fn test_deposit_reverts_when_lp_below_min() { vec![ok_ix], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ) .expect("deposit at exact LP floor should succeed"); } @@ -1567,6 +1632,7 @@ fn test_withdraw_reverts_when_below_min() { vec![strict_ix], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ); assert_error_code( result, @@ -1581,6 +1647,7 @@ fn test_withdraw_reverts_when_below_min() { vec![strict_ix_b], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ); assert_error_code( result_b, @@ -1603,6 +1670,7 @@ fn test_swap_with_zero_min_output_still_succeeds() { vec![ix], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ) .expect("swap with min_output_amount=0 must succeed"); let after_b = get_token_account_balance(&ts.svm, &ts.holder_account_b).unwrap(); @@ -1661,6 +1729,7 @@ fn test_swap_b_to_a_trader_pays_full_input() { vec![swap_ix], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ) .expect("B→A swap should succeed"); @@ -1708,6 +1777,7 @@ fn test_invariant_holds_after_b_to_a_swap() { vec![swap_ix], &[&ts.payer, &ts.admin], &ts.payer.pubkey(), + None, ) .expect("B→A swap should succeed"); diff --git a/tokens/create-token/anchor/README.md b/tokens/create-token/anchor/README.md index 94a1a1a9c..7067f35ae 100644 --- a/tokens/create-token/anchor/README.md +++ b/tokens/create-token/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/create-token/anchor/programs/create-token/Cargo.toml b/tokens/create-token/anchor/programs/create-token/Cargo.toml index 43d5ff765..bb6421195 100644 --- a/tokens/create-token/anchor/programs/create-token/Cargo.toml +++ b/tokens/create-token/anchor/programs/create-token/Cargo.toml @@ -23,16 +23,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = { version = "2.0.0-rc.1", features = ["metadata"] } +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = { version = "2.0.0-rc.2", features = ["metadata"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -49,8 +44,14 @@ anchor-spl = { version = "2.0.0-rc.1", features = ["metadata"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/create-token/anchor/programs/create-token/tests/test_create_token.rs b/tokens/create-token/anchor/programs/create-token/tests/test_create_token.rs index dbd90cc05..97ccdf53b 100644 --- a/tokens/create-token/anchor/programs/create-token/tests/test_create_token.rs +++ b/tokens/create-token/anchor/programs/create-token/tests/test_create_token.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{create_wallet, send_transaction_from_instructions}, }; @@ -81,6 +81,7 @@ fn test_create_spl_token() { vec![instruction], &[&payer, &mint_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -135,6 +136,7 @@ fn test_create_nft() { vec![instruction], &[&payer, &mint_keypair], &payer.pubkey(), + None, ) .unwrap(); diff --git a/tokens/create-token/native/program/Cargo.toml b/tokens/create-token/native/program/Cargo.toml index e34742da3..e8d7cc739 100644 --- a/tokens/create-token/native/program/Cargo.toml +++ b/tokens/create-token/native/program/Cargo.toml @@ -9,11 +9,12 @@ borsh-derive.workspace = true solana-program.workspace = true solana-system-interface = { version = "2.0.0", features = ["bincode"] } spl-token-interface = "2.0.0" -# anchor-spl 2.0.0-rc.1 depends on `=5.1.2-alpha.2`, and a caret range excludes -# pre-releases, so `^5.1.1` here and that exact pin cannot both be satisfied in -# one lockfile. Matching the pin is what lets the anchor and native token +# anchor-spl 2.0.0-rc.2 depends on `=5.1.2-alpha.2`. A range starting at a +# stable release such as `^5.1.1` never matches a pre-release, so it and that +# exact pin cannot both be satisfied in one lockfile. A range starting at the +# pre-release itself can, which is what lets the anchor and native token # examples share a workspace. -mpl-token-metadata = "=5.1.2-alpha.2" +mpl-token-metadata = "5.1.2-alpha.2" # Alias for the (older) solana-program version mpl-token-metadata's instruction # builders return, so we can name that Instruction/Pubkey type when bridging. mpl-solana-program = { package = "solana-program", version = "3.0" } @@ -29,9 +30,9 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" diff --git a/tokens/external-delegate-token-master/anchor/README.md b/tokens/external-delegate-token-master/anchor/README.md index 6129da99b..72c0f4f2e 100644 --- a/tokens/external-delegate-token-master/anchor/README.md +++ b/tokens/external-delegate-token-master/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/external-delegate-token-master/anchor/programs/external-delegate-token-master/Cargo.toml b/tokens/external-delegate-token-master/anchor/programs/external-delegate-token-master/Cargo.toml index 1b501e380..707eb5e46 100644 --- a/tokens/external-delegate-token-master/anchor/programs/external-delegate-token-master/Cargo.toml +++ b/tokens/external-delegate-token-master/anchor/programs/external-delegate-token-master/Cargo.toml @@ -22,16 +22,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" sha3 = "0.10.8" solana-secp256k1-recover = "2.0.0" @@ -50,11 +45,17 @@ solana-secp256k1-recover = "2.0.0" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" # Signs test transfer authorizations with a fixed secp256k1 key so tests can # exercise the Ethereum-signature path end to end. libsecp256k1 = "0.7.2" -solana-kite = "0.4.0" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/external-delegate-token-master/anchor/programs/external-delegate-token-master/tests/test_external_delegate.rs b/tokens/external-delegate-token-master/anchor/programs/external-delegate-token-master/tests/test_external_delegate.rs index fa045bc37..97e172fdf 100644 --- a/tokens/external-delegate-token-master/anchor/programs/external-delegate-token-master/tests/test_external_delegate.rs +++ b/tokens/external-delegate-token-master/anchor/programs/external-delegate-token-master/tests/test_external_delegate.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, borsh::BorshDeserialize, sha3::{Digest, Keccak256}, solana_kite::{ @@ -121,6 +121,7 @@ fn initialize_user_account( vec![init_instruction], &[authority, user_account], &authority.pubkey(), + None, ) .unwrap(); } @@ -147,6 +148,7 @@ fn set_ethereum_address( vec![set_address_instruction], &[authority], &authority.pubkey(), + None, ) .unwrap(); } @@ -181,21 +183,23 @@ fn setup_transfer_fixture() -> TransferFixture { let (user_pda, _bump) = Address::find_program_address(&[user_account.as_ref()], &program_id); - let mint = create_token_mint(&mut svm, &authority, MINT_DECIMALS, None).unwrap(); + let mint = create_token_mint(&mut svm, &authority, MINT_DECIMALS, None, None).unwrap(); let user_pda_token_account = - create_associated_token_account(&mut svm, &user_pda, &mint, &authority).unwrap(); + create_associated_token_account(&mut svm, &user_pda, &mint, &authority, None).unwrap(); mint_tokens_to_token_account( &mut svm, &mint, &user_pda_token_account, MINT_AMOUNT, &authority, + None, ) .unwrap(); let recipient = Keypair::new(); let recipient_token_account = - create_associated_token_account(&mut svm, &recipient.pubkey(), &mint, &authority).unwrap(); + create_associated_token_account(&mut svm, &recipient.pubkey(), &mint, &authority, None) + .unwrap(); TransferFixture { svm, @@ -289,6 +293,7 @@ fn test_transfer_tokens_with_valid_signature_moves_tokens_and_increments_nonce() vec![transfer_instruction], &[&fixture.authority], &authority_pubkey, + None, ) .unwrap(); @@ -332,6 +337,7 @@ fn test_transfer_tokens_replayed_signature_fails() { vec![transfer_instruction.clone()], &[&fixture.authority], &authority_pubkey, + None, ) .unwrap(); @@ -343,6 +349,7 @@ fn test_transfer_tokens_replayed_signature_fails() { vec![transfer_instruction], &[&fixture.authority], &authority_pubkey, + None, ); assert!( replay_result.is_err(), @@ -388,6 +395,7 @@ fn test_transfer_tokens_signature_over_different_amount_fails() { vec![transfer_instruction], &[&fixture.authority], &authority_pubkey, + None, ); assert!( result.is_err(), @@ -415,6 +423,7 @@ fn test_transfer_tokens_signature_over_different_recipient_fails() { &attacker.pubkey(), &fixture.mint, &fixture.authority, + None, ) .unwrap(); @@ -440,6 +449,7 @@ fn test_transfer_tokens_signature_over_different_recipient_fails() { vec![transfer_instruction], &[&fixture.authority], &authority_pubkey, + None, ); assert!( result.is_err(), @@ -480,6 +490,7 @@ fn test_transfer_tokens_wrong_solana_authority_fails() { vec![transfer_instruction], &[&mallory], &mallory_pubkey, + None, ); assert!( result.is_err(), @@ -518,6 +529,7 @@ fn test_authority_transfer() { vec![authority_transfer_instruction], &[&fixture.authority], &fixture.authority.pubkey(), + None, ) .unwrap(); diff --git a/tokens/nft-minter/anchor/README.md b/tokens/nft-minter/anchor/README.md index ddb05b49d..491b5e64c 100644 --- a/tokens/nft-minter/anchor/README.md +++ b/tokens/nft-minter/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/nft-minter/anchor/programs/nft-minter/Cargo.toml b/tokens/nft-minter/anchor/programs/nft-minter/Cargo.toml index b5847a19c..3b7559cdc 100644 --- a/tokens/nft-minter/anchor/programs/nft-minter/Cargo.toml +++ b/tokens/nft-minter/anchor/programs/nft-minter/Cargo.toml @@ -22,16 +22,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = { version = "2.0.0-rc.1", features = ["metadata"] } +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = { version = "2.0.0-rc.2", features = ["metadata"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -48,8 +43,14 @@ anchor-spl = { version = "2.0.0-rc.1", features = ["metadata"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/nft-minter/anchor/programs/nft-minter/tests/test_nft_minter.rs b/tokens/nft-minter/anchor/programs/nft-minter/tests/test_nft_minter.rs index 3c4f30ee4..1774d1eca 100644 --- a/tokens/nft-minter/anchor/programs/nft-minter/tests/test_nft_minter.rs +++ b/tokens/nft-minter/anchor/programs/nft-minter/tests/test_nft_minter.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{create_wallet, get_token_account_balance, send_transaction_from_instructions}, }; @@ -114,6 +114,7 @@ fn test_mint_nft() { vec![instruction], &[&payer, &mint_keypair], &payer.pubkey(), + None, ) .unwrap(); diff --git a/tokens/nft-minter/native/program/Cargo.toml b/tokens/nft-minter/native/program/Cargo.toml index b8e52b803..591bc4194 100644 --- a/tokens/nft-minter/native/program/Cargo.toml +++ b/tokens/nft-minter/native/program/Cargo.toml @@ -10,11 +10,12 @@ solana-program.workspace = true solana-system-interface = { version = "2.0.0", features = ["bincode"] } spl-token-interface = "2.0.0" spl-associated-token-account-interface = "2.0.0" -# anchor-spl 2.0.0-rc.1 depends on `=5.1.2-alpha.2`, and a caret range excludes -# pre-releases, so `^5.1.1` here and that exact pin cannot both be satisfied in -# one lockfile. Matching the pin is what lets the anchor and native token +# anchor-spl 2.0.0-rc.2 depends on `=5.1.2-alpha.2`. A range starting at a +# stable release such as `^5.1.1` never matches a pre-release, so it and that +# exact pin cannot both be satisfied in one lockfile. A range starting at the +# pre-release itself can, which is what lets the anchor and native token # examples share a workspace. -mpl-token-metadata = "=5.1.2-alpha.2" +mpl-token-metadata = "5.1.2-alpha.2" # Alias for the (older) solana-program version mpl-token-metadata's instruction # builders return, so we can name that Instruction/Pubkey type when bridging. mpl-solana-program = { package = "solana-program", version = "3.0" } @@ -30,9 +31,9 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" diff --git a/tokens/nft-operations/anchor/README.md b/tokens/nft-operations/anchor/README.md index d7d8b55ce..0d6cb15df 100644 --- a/tokens/nft-operations/anchor/README.md +++ b/tokens/nft-operations/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/nft-operations/anchor/programs/mint-nft/Cargo.toml b/tokens/nft-operations/anchor/programs/mint-nft/Cargo.toml index 592c97c2f..c08d62982 100644 --- a/tokens/nft-operations/anchor/programs/mint-nft/Cargo.toml +++ b/tokens/nft-operations/anchor/programs/mint-nft/Cargo.toml @@ -22,16 +22,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = { version = "2.0.0-rc.1", features = ["compat"] } +anchor-lang = { version = "2.0.0-rc.2", features = ["compat"] } # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = { version = "2.0.0-rc.1", features = ["metadata"] } +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = { version = "2.0.0-rc.2", features = ["metadata"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -48,8 +43,14 @@ anchor-spl = { version = "2.0.0-rc.1", features = ["metadata"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/nft-operations/anchor/programs/mint-nft/tests/test_nft_operations.rs b/tokens/nft-operations/anchor/programs/mint-nft/tests/test_nft_operations.rs index 4b235b388..d438e9643 100644 --- a/tokens/nft-operations/anchor/programs/mint-nft/tests/test_nft_operations.rs +++ b/tokens/nft-operations/anchor/programs/mint-nft/tests/test_nft_operations.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{create_wallet, get_token_account_balance, send_transaction_from_instructions}, }; @@ -125,6 +125,7 @@ fn test_create_collection() { vec![instruction], &[&payer, &collection_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -193,6 +194,7 @@ fn test_mint_nft_to_collection() { vec![create_collection_ix], &[&payer, &collection_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -232,6 +234,7 @@ fn test_mint_nft_to_collection() { vec![mint_nft_ix], &[&payer, &nft_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -290,6 +293,7 @@ fn test_verify_collection() { vec![create_collection_ix], &[&payer, &collection_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -329,6 +333,7 @@ fn test_verify_collection() { vec![mint_nft_ix], &[&payer, &nft_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -352,7 +357,7 @@ fn test_verify_collection() { .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![verify_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![verify_ix], &[&payer], &payer.pubkey(), None) .unwrap(); // Verify the metadata still exists after verification diff --git a/tokens/pda-mint-authority/anchor/README.md b/tokens/pda-mint-authority/anchor/README.md index 9374d1175..15fe85865 100644 --- a/tokens/pda-mint-authority/anchor/README.md +++ b/tokens/pda-mint-authority/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/pda-mint-authority/anchor/programs/token-minter/Cargo.toml b/tokens/pda-mint-authority/anchor/programs/token-minter/Cargo.toml index b74954f3c..6d0b8372b 100644 --- a/tokens/pda-mint-authority/anchor/programs/token-minter/Cargo.toml +++ b/tokens/pda-mint-authority/anchor/programs/token-minter/Cargo.toml @@ -22,16 +22,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = { version = "2.0.0-rc.1", features = ["metadata"] } +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = { version = "2.0.0-rc.2", features = ["metadata"] } # For `Pack`, which gives the classic mint its `LEN`. anchor-spl re-exports # the state types but not the trait. solana-program-pack = "3" @@ -51,8 +46,14 @@ solana-program-pack = "3" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/pda-mint-authority/anchor/programs/token-minter/tests/test_pda_mint.rs b/tokens/pda-mint-authority/anchor/programs/token-minter/tests/test_pda_mint.rs index e5e39b3a2..b6ab408d6 100644 --- a/tokens/pda-mint-authority/anchor/programs/token-minter/tests/test_pda_mint.rs +++ b/tokens/pda-mint-authority/anchor/programs/token-minter/tests/test_pda_mint.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{create_wallet, get_token_account_balance, send_transaction_from_instructions}, }; @@ -101,7 +101,7 @@ fn test_create_token_and_mint() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![create_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![create_ix], &[&payer], &payer.pubkey(), None) .unwrap(); // Verify mint created @@ -134,7 +134,7 @@ fn test_create_token_and_mint() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![mint_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![mint_ix], &[&payer], &payer.pubkey(), None) .unwrap(); // Verify 100 tokens minted (in minor units) diff --git a/tokens/pda-mint-authority/native/program/Cargo.toml b/tokens/pda-mint-authority/native/program/Cargo.toml index b169e7dc5..3a719fbc0 100644 --- a/tokens/pda-mint-authority/native/program/Cargo.toml +++ b/tokens/pda-mint-authority/native/program/Cargo.toml @@ -10,11 +10,12 @@ solana-program.workspace = true solana-system-interface = { version = "2.0.0", features = ["bincode"] } spl-token-interface = "2.0.0" spl-associated-token-account-interface = "2.0.0" -# anchor-spl 2.0.0-rc.1 depends on `=5.1.2-alpha.2`, and a caret range excludes -# pre-releases, so `^5.1.1` here and that exact pin cannot both be satisfied in -# one lockfile. Matching the pin is what lets the anchor and native token +# anchor-spl 2.0.0-rc.2 depends on `=5.1.2-alpha.2`. A range starting at a +# stable release such as `^5.1.1` never matches a pre-release, so it and that +# exact pin cannot both be satisfied in one lockfile. A range starting at the +# pre-release itself can, which is what lets the anchor and native token # examples share a workspace. -mpl-token-metadata = "=5.1.2-alpha.2" +mpl-token-metadata = "5.1.2-alpha.2" # Alias for the (older) solana-program version mpl-token-metadata's instruction # builders return, so we can name that Instruction/Pubkey type when bridging. mpl-solana-program = { package = "solana-program", version = "3.0" } @@ -30,9 +31,9 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" diff --git a/tokens/token-extensions/basics/anchor/README.md b/tokens/token-extensions/basics/anchor/README.md index 4da7c89f2..9155bb9ef 100644 --- a/tokens/token-extensions/basics/anchor/README.md +++ b/tokens/token-extensions/basics/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/basics/anchor/programs/basics/Cargo.toml b/tokens/token-extensions/basics/anchor/programs/basics/Cargo.toml index 2e2a30265..88f22e994 100644 --- a/tokens/token-extensions/basics/anchor/programs/basics/Cargo.toml +++ b/tokens/token-extensions/basics/anchor/programs/basics/Cargo.toml @@ -22,16 +22,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-spl = "2.0.0-rc.1" -anchor-lang = "2.0.0-rc.1" +anchor-spl = "2.0.0-rc.2" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" +wincode = { version = "0.6", features = ["derive"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -48,8 +43,14 @@ solana-address = ">=2.6, <2.7" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/basics/anchor/programs/basics/tests/test_basics.rs b/tokens/token-extensions/basics/anchor/programs/basics/tests/test_basics.rs index 6c55d7539..691aa9ea4 100644 --- a/tokens/token-extensions/basics/anchor/programs/basics/tests/test_basics.rs +++ b/tokens/token-extensions/basics/anchor/programs/basics/tests/test_basics.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{ assert_token_account_balance, create_wallet, send_transaction_from_instructions, token_extensions::{get_token_extensions_account_address, TOKEN_EXTENSIONS_PROGRAM_ID}, @@ -59,8 +59,14 @@ fn test_create_token_and_mint_and_transfer() { .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![create_token_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![create_token_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); // Verify mint account exists let mint_account = svm.get_account(&mint).expect("Mint account should exist"); @@ -85,8 +91,14 @@ fn test_create_token_and_mint_and_transfer() { .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![create_ata_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![create_ata_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); // Verify ATA exists let ata_account = svm.get_account(&payer_ata).expect("Payer ATA should exist"); @@ -112,8 +124,14 @@ fn test_create_token_and_mint_and_transfer() { .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![mint_token_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![mint_token_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); assert_token_account_balance( &svm, @@ -149,8 +167,14 @@ fn test_create_token_and_mint_and_transfer() { .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![transfer_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![transfer_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); assert_token_account_balance( &svm, diff --git a/tokens/token-extensions/cpi-guard/anchor/README.md b/tokens/token-extensions/cpi-guard/anchor/README.md index 0d06a7d47..80d6ce84b 100644 --- a/tokens/token-extensions/cpi-guard/anchor/README.md +++ b/tokens/token-extensions/cpi-guard/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/cpi-guard/anchor/programs/cpi-guard/Cargo.toml b/tokens/token-extensions/cpi-guard/anchor/programs/cpi-guard/Cargo.toml index ac9ef6141..12f457427 100644 --- a/tokens/token-extensions/cpi-guard/anchor/programs/cpi-guard/Cargo.toml +++ b/tokens/token-extensions/cpi-guard/anchor/programs/cpi-guard/Cargo.toml @@ -22,16 +22,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -48,8 +43,14 @@ anchor-spl = "2.0.0-rc.1" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/cpi-guard/anchor/programs/cpi-guard/tests/test_cpi_guard.rs b/tokens/token-extensions/cpi-guard/anchor/programs/cpi-guard/tests/test_cpi_guard.rs index 00021a4df..fb0b515b9 100644 --- a/tokens/token-extensions/cpi-guard/anchor/programs/cpi-guard/tests/test_cpi_guard.rs +++ b/tokens/token-extensions/cpi-guard/anchor/programs/cpi-guard/tests/test_cpi_guard.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::{AccountMeta, Instruction}, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{ assert_token_account_balance, create_wallet, send_transaction_from_instructions, token_extensions::{ @@ -109,7 +109,7 @@ fn test_cpi_guard_prevents_transfer_then_allows_after_disable() { let token_keypair = Keypair::new(); // Step 1: Create a Token Extensions mint (no extensions needed on the mint itself) - let mint = create_token_extensions_mint(&mut svm, &payer, 2, None, &[]).unwrap(); + let mint = create_token_extensions_mint(&mut svm, &payer, 2, None, &[], None).unwrap(); svm.expire_blockhash(); // Step 2: Create basic token account (needs explicit keypair for reallocate flow) @@ -124,6 +124,7 @@ fn test_cpi_guard_prevents_transfer_then_allows_after_disable() { token_ixs, &[&payer, &token_keypair], &payer.pubkey(), + None, ) .unwrap(); svm.expire_blockhash(); @@ -136,19 +137,32 @@ fn test_cpi_guard_prevents_transfer_then_allows_after_disable() { &payer.pubkey(), &[cpi_guard_extension_type], ); - send_transaction_from_instructions(&mut svm, vec![reallocate_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![reallocate_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 4: Enable CPI Guard let enable_ix = enable_cpi_guard_instruction(&token_keypair.pubkey(), &payer.pubkey()); - send_transaction_from_instructions(&mut svm, vec![enable_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![enable_ix], &[&payer], &payer.pubkey(), None) .unwrap(); svm.expire_blockhash(); // Step 5: Mint 1 token to the token account - mint_tokens_to_token_extensions_account(&mut svm, &mint, &token_keypair.pubkey(), 1, &payer) - .unwrap(); + mint_tokens_to_token_extensions_account( + &mut svm, + &mint, + &token_keypair.pubkey(), + 1, + &payer, + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 6: Try CPI transfer - should fail because CPI Guard is enabled @@ -168,8 +182,13 @@ fn test_cpi_guard_prevents_transfer_then_allows_after_disable() { .to_account_metas(None), ); - let result = - send_transaction_from_instructions(&mut svm, vec![transfer_ix], &[&payer], &payer.pubkey()); + let result = send_transaction_from_instructions( + &mut svm, + vec![transfer_ix], + &[&payer], + &payer.pubkey(), + None, + ); assert!( result.is_err(), "Transfer should fail when CPI Guard is enabled" @@ -178,8 +197,14 @@ fn test_cpi_guard_prevents_transfer_then_allows_after_disable() { // Step 7: Disable CPI Guard let disable_ix = disable_cpi_guard_instruction(&token_keypair.pubkey(), &payer.pubkey()); - send_transaction_from_instructions(&mut svm, vec![disable_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![disable_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 8: Transfer should now succeed @@ -197,8 +222,14 @@ fn test_cpi_guard_prevents_transfer_then_allows_after_disable() { .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![transfer_ix2], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![transfer_ix2], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); assert_token_account_balance( &svm, diff --git a/tokens/token-extensions/default-account-state/anchor/README.md b/tokens/token-extensions/default-account-state/anchor/README.md index f00a1fc59..62d793c31 100644 --- a/tokens/token-extensions/default-account-state/anchor/README.md +++ b/tokens/token-extensions/default-account-state/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/default-account-state/anchor/programs/default-account-state/Cargo.toml b/tokens/token-extensions/default-account-state/anchor/programs/default-account-state/Cargo.toml index f83f54674..88891c364 100644 --- a/tokens/token-extensions/default-account-state/anchor/programs/default-account-state/Cargo.toml +++ b/tokens/token-extensions/default-account-state/anchor/programs/default-account-state/Cargo.toml @@ -22,16 +22,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -48,8 +43,14 @@ anchor-spl = "2.0.0-rc.1" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/default-account-state/anchor/programs/default-account-state/tests/test_default_account_state.rs b/tokens/token-extensions/default-account-state/anchor/programs/default-account-state/tests/test_default_account_state.rs index 7709c4fdb..13e914d24 100644 --- a/tokens/token-extensions/default-account-state/anchor/programs/default-account-state/tests/test_default_account_state.rs +++ b/tokens/token-extensions/default-account-state/anchor/programs/default-account-state/tests/test_default_account_state.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::{AccountMeta, Instruction}, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{ assert_token_account_balance, create_wallet, send_transaction_from_instructions, token_extensions::{mint_tokens_to_token_extensions_account, TOKEN_EXTENSIONS_PROGRAM_ID}, @@ -74,6 +74,7 @@ fn test_default_account_state() { vec![initialize_ix], &[&payer, &mint_keypair], &payer.pubkey(), + None, ) .unwrap(); svm.expire_blockhash(); @@ -95,6 +96,7 @@ fn test_default_account_state() { create_token1_ixs, &[&payer, &token1], &payer.pubkey(), + None, ) .unwrap(); svm.expire_blockhash(); @@ -113,6 +115,7 @@ fn test_default_account_state() { &token1.pubkey(), 1, &payer, + None, ); assert!(result.is_err(), "Minting to a frozen account should fail"); svm.expire_blockhash(); @@ -132,7 +135,7 @@ fn test_default_account_state() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![update_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![update_ix], &[&payer], &payer.pubkey(), None) .unwrap(); svm.expire_blockhash(); @@ -149,6 +152,7 @@ fn test_default_account_state() { create_token2_ixs, &[&payer, &token2], &payer.pubkey(), + None, ) .unwrap(); svm.expire_blockhash(); @@ -167,6 +171,7 @@ fn test_default_account_state() { &token2.pubkey(), 1, &payer, + None, ) .unwrap(); diff --git a/tokens/token-extensions/group/anchor/README.md b/tokens/token-extensions/group/anchor/README.md index e9a82a749..69787998d 100644 --- a/tokens/token-extensions/group/anchor/README.md +++ b/tokens/token-extensions/group/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/group/anchor/programs/group/Cargo.toml b/tokens/token-extensions/group/anchor/programs/group/Cargo.toml index b808ee9ef..7eaea3965 100644 --- a/tokens/token-extensions/group/anchor/programs/group/Cargo.toml +++ b/tokens/token-extensions/group/anchor/programs/group/Cargo.toml @@ -22,16 +22,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -48,8 +43,14 @@ anchor-spl = "2.0.0-rc.1" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/group/anchor/programs/group/tests/test_group.rs b/tokens/token-extensions/group/anchor/programs/group/tests/test_group.rs index fd4c903bf..5dece2dea 100644 --- a/tokens/token-extensions/group/anchor/programs/group/tests/test_group.rs +++ b/tokens/token-extensions/group/anchor/programs/group/tests/test_group.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{LiteSVM, Signer}, + anchor_v2_testing::Signer, solana_kite::{ create_wallet, send_transaction_from_instructions, token_extensions::TOKEN_EXTENSIONS_PROGRAM_ID, @@ -35,8 +35,14 @@ fn test_initialize_group() { .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![instruction], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![instruction], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); // Verify mint was created with group pointer extension let mint_data = svm diff --git a/tokens/token-extensions/immutable-owner/anchor/README.md b/tokens/token-extensions/immutable-owner/anchor/README.md index 1a4b023b0..b3e17a697 100644 --- a/tokens/token-extensions/immutable-owner/anchor/README.md +++ b/tokens/token-extensions/immutable-owner/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/immutable-owner/anchor/programs/immutable-owner/Cargo.toml b/tokens/token-extensions/immutable-owner/anchor/programs/immutable-owner/Cargo.toml index 82d9b5b08..e2f473982 100644 --- a/tokens/token-extensions/immutable-owner/anchor/programs/immutable-owner/Cargo.toml +++ b/tokens/token-extensions/immutable-owner/anchor/programs/immutable-owner/Cargo.toml @@ -22,16 +22,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -48,8 +43,14 @@ anchor-spl = "2.0.0-rc.1" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/immutable-owner/anchor/programs/immutable-owner/tests/test_immutable_owner.rs b/tokens/token-extensions/immutable-owner/anchor/programs/immutable-owner/tests/test_immutable_owner.rs index 365874594..f01c2111a 100644 --- a/tokens/token-extensions/immutable-owner/anchor/programs/immutable-owner/tests/test_immutable_owner.rs +++ b/tokens/token-extensions/immutable-owner/anchor/programs/immutable-owner/tests/test_immutable_owner.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::{AccountMeta, Instruction}, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{ create_wallet, send_transaction_from_instructions, token_extensions::{create_token_extensions_mint, TOKEN_EXTENSIONS_PROGRAM_ID}, @@ -55,7 +55,7 @@ fn test_create_token_account_with_immutable_owner() { let token_keypair = Keypair::new(); // Step 1: Create a Token Extensions mint with 2 decimals (no extensions needed on mint) - let mint = create_token_extensions_mint(&mut svm, &payer, 2, None, &[]).unwrap(); + let mint = create_token_extensions_mint(&mut svm, &payer, 2, None, &[], None).unwrap(); svm.expire_blockhash(); // Step 2: Call program to create token account with ImmutableOwner extension @@ -76,6 +76,7 @@ fn test_create_token_account_with_immutable_owner() { vec![initialize_ix], &[&payer, &token_keypair], &payer.pubkey(), + None, ) .unwrap(); svm.expire_blockhash(); @@ -103,6 +104,7 @@ fn test_create_token_account_with_immutable_owner() { vec![set_authority_ix], &[&payer], &payer.pubkey(), + None, ); assert!( result.is_err(), diff --git a/tokens/token-extensions/interest-bearing/anchor/README.md b/tokens/token-extensions/interest-bearing/anchor/README.md index f371797a8..3ebe6621a 100644 --- a/tokens/token-extensions/interest-bearing/anchor/README.md +++ b/tokens/token-extensions/interest-bearing/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/interest-bearing/anchor/programs/interest-bearing/Cargo.toml b/tokens/token-extensions/interest-bearing/anchor/programs/interest-bearing/Cargo.toml index 96d8dc565..fe4d8a235 100644 --- a/tokens/token-extensions/interest-bearing/anchor/programs/interest-bearing/Cargo.toml +++ b/tokens/token-extensions/interest-bearing/anchor/programs/interest-bearing/Cargo.toml @@ -23,16 +23,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -49,8 +44,14 @@ anchor-spl = "2.0.0-rc.1" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/interest-bearing/anchor/programs/interest-bearing/tests/test_interest_bearing.rs b/tokens/token-extensions/interest-bearing/anchor/programs/interest-bearing/tests/test_interest_bearing.rs index 7eab29093..a9fba54d9 100644 --- a/tokens/token-extensions/interest-bearing/anchor/programs/interest-bearing/tests/test_interest_bearing.rs +++ b/tokens/token-extensions/interest-bearing/anchor/programs/interest-bearing/tests/test_interest_bearing.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{ create_wallet, send_transaction_from_instructions, token_extensions::TOKEN_EXTENSIONS_PROGRAM_ID, @@ -43,6 +43,7 @@ fn test_initialize_and_update_rate() { vec![initialize_ix], &[&payer, &mint_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -66,8 +67,14 @@ fn test_initialize_and_update_rate() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![update_rate_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![update_rate_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); // Verify mint still exists after rate update let mint_account = svm diff --git a/tokens/token-extensions/memo-transfer/anchor/README.md b/tokens/token-extensions/memo-transfer/anchor/README.md index c0cb072cc..98be3685f 100644 --- a/tokens/token-extensions/memo-transfer/anchor/README.md +++ b/tokens/token-extensions/memo-transfer/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/memo-transfer/anchor/programs/memo-transfer/Cargo.toml b/tokens/token-extensions/memo-transfer/anchor/programs/memo-transfer/Cargo.toml index 243e007d4..6b2318b8b 100644 --- a/tokens/token-extensions/memo-transfer/anchor/programs/memo-transfer/Cargo.toml +++ b/tokens/token-extensions/memo-transfer/anchor/programs/memo-transfer/Cargo.toml @@ -22,16 +22,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -48,8 +43,14 @@ anchor-spl = "2.0.0-rc.1" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/memo-transfer/anchor/programs/memo-transfer/tests/test_memo_transfer.rs b/tokens/token-extensions/memo-transfer/anchor/programs/memo-transfer/tests/test_memo_transfer.rs index 7f99ffbd7..5a20f1c85 100644 --- a/tokens/token-extensions/memo-transfer/anchor/programs/memo-transfer/tests/test_memo_transfer.rs +++ b/tokens/token-extensions/memo-transfer/anchor/programs/memo-transfer/tests/test_memo_transfer.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::{AccountMeta, Instruction}, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{ assert_token_account_balance, create_wallet, send_transaction_from_instructions, token_extensions::{ @@ -106,7 +106,7 @@ fn test_memo_transfer() { let token_keypair = Keypair::new(); // Step 1: Create a standard Token Extensions mint (no extensions on the mint) - let mint = create_token_extensions_mint(&mut svm, &payer, 2, None, &[]).unwrap(); + let mint = create_token_extensions_mint(&mut svm, &payer, 2, None, &[], None).unwrap(); svm.expire_blockhash(); // Step 2: Create token account with RequiredMemo extension via program @@ -127,6 +127,7 @@ fn test_memo_transfer() { vec![initialize_ix], &[&payer, &token_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -154,12 +155,20 @@ fn test_memo_transfer() { create_source_ixs, &[&payer, &source_keypair], &payer.pubkey(), + None, ) .unwrap(); svm.expire_blockhash(); - mint_tokens_to_token_extensions_account(&mut svm, &mint, &source_keypair.pubkey(), 100, &payer) - .unwrap(); + mint_tokens_to_token_extensions_account( + &mut svm, + &mint, + &source_keypair.pubkey(), + 100, + &payer, + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 4: Transfer without memo - should fail @@ -169,8 +178,13 @@ fn test_memo_transfer() { &payer.pubkey(), 1, ); - let result = - send_transaction_from_instructions(&mut svm, vec![transfer_ix], &[&payer], &payer.pubkey()); + let result = send_transaction_from_instructions( + &mut svm, + vec![transfer_ix], + &[&payer], + &payer.pubkey(), + None, + ); assert!(result.is_err(), "Transfer without memo should fail"); svm.expire_blockhash(); @@ -187,6 +201,7 @@ fn test_memo_transfer() { vec![memo_ix, transfer_ix], &[&payer], &payer.pubkey(), + None, ) .unwrap(); svm.expire_blockhash(); @@ -209,8 +224,14 @@ fn test_memo_transfer() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![disable_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![disable_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 7: Transfer without memo should now succeed (memo disabled) @@ -226,6 +247,7 @@ fn test_memo_transfer() { create_source2_ixs, &[&payer, &source2_keypair], &payer.pubkey(), + None, ) .unwrap(); svm.expire_blockhash(); @@ -236,6 +258,7 @@ fn test_memo_transfer() { &source2_keypair.pubkey(), 100, &payer, + None, ) .unwrap(); svm.expire_blockhash(); @@ -246,8 +269,14 @@ fn test_memo_transfer() { &payer.pubkey(), 1, ); - send_transaction_from_instructions(&mut svm, vec![transfer_ix2], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![transfer_ix2], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); assert_token_account_balance( &svm, diff --git a/tokens/token-extensions/metadata/anchor/README.md b/tokens/token-extensions/metadata/anchor/README.md index 19d8b6dcd..a0204fc34 100644 --- a/tokens/token-extensions/metadata/anchor/README.md +++ b/tokens/token-extensions/metadata/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/metadata/anchor/programs/metadata/Cargo.toml b/tokens/token-extensions/metadata/anchor/programs/metadata/Cargo.toml index 2582448ed..90c3bca13 100644 --- a/tokens/token-extensions/metadata/anchor/programs/metadata/Cargo.toml +++ b/tokens/token-extensions/metadata/anchor/programs/metadata/Cargo.toml @@ -22,16 +22,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" spl-token-metadata-interface = "0.8.0" spl-type-length-value = "0.9.1" @@ -50,8 +45,14 @@ spl-type-length-value = "0.9.1" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/metadata/anchor/programs/metadata/tests/test_metadata.rs b/tokens/token-extensions/metadata/anchor/programs/metadata/tests/test_metadata.rs index cfc49a81a..8ed27c8d9 100644 --- a/tokens/token-extensions/metadata/anchor/programs/metadata/tests/test_metadata.rs +++ b/tokens/token-extensions/metadata/anchor/programs/metadata/tests/test_metadata.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{ create_wallet, send_transaction_from_instructions, token_extensions::TOKEN_EXTENSIONS_PROGRAM_ID, @@ -50,6 +50,7 @@ fn test_metadata_full_flow() { vec![initialize_ix], &[&payer, &mint_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -79,8 +80,14 @@ fn test_metadata_full_flow() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![update_name_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![update_name_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 3: Add custom field @@ -106,6 +113,7 @@ fn test_metadata_full_flow() { vec![add_custom_field_ix], &[&payer], &payer.pubkey(), + None, ) .unwrap(); svm.expire_blockhash(); @@ -125,8 +133,14 @@ fn test_metadata_full_flow() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![remove_key_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![remove_key_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 5: Update authority to None @@ -147,6 +161,7 @@ fn test_metadata_full_flow() { vec![update_authority_ix], &[&payer], &payer.pubkey(), + None, ) .unwrap(); svm.expire_blockhash(); @@ -161,7 +176,7 @@ fn test_metadata_full_flow() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![emit_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![emit_ix], &[&payer], &payer.pubkey(), None) .unwrap(); // Verify mint still exists after all operations diff --git a/tokens/token-extensions/mint-close-authority/anchor/README.md b/tokens/token-extensions/mint-close-authority/anchor/README.md index 0a98515a4..bbd07afbe 100644 --- a/tokens/token-extensions/mint-close-authority/anchor/README.md +++ b/tokens/token-extensions/mint-close-authority/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/mint-close-authority/anchor/programs/mint-close-authority/Cargo.toml b/tokens/token-extensions/mint-close-authority/anchor/programs/mint-close-authority/Cargo.toml index 0fbe45d93..29ab7358b 100644 --- a/tokens/token-extensions/mint-close-authority/anchor/programs/mint-close-authority/Cargo.toml +++ b/tokens/token-extensions/mint-close-authority/anchor/programs/mint-close-authority/Cargo.toml @@ -19,16 +19,11 @@ idl-build = ["anchor-lang/idl-build"] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -45,8 +40,14 @@ anchor-spl = "2.0.0-rc.1" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/mint-close-authority/anchor/programs/mint-close-authority/tests/test_mint_close_authority.rs b/tokens/token-extensions/mint-close-authority/anchor/programs/mint-close-authority/tests/test_mint_close_authority.rs index f01296be7..529c9efb0 100644 --- a/tokens/token-extensions/mint-close-authority/anchor/programs/mint-close-authority/tests/test_mint_close_authority.rs +++ b/tokens/token-extensions/mint-close-authority/anchor/programs/mint-close-authority/tests/test_mint_close_authority.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{ create_wallet, send_transaction_from_instructions, token_extensions::TOKEN_EXTENSIONS_PROGRAM_ID, @@ -43,6 +43,7 @@ fn test_create_and_close_mint() { vec![initialize_ix], &[&payer, &mint_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -65,7 +66,7 @@ fn test_create_and_close_mint() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![close_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![close_ix], &[&payer], &payer.pubkey(), None) .unwrap(); // Verify mint no longer exists (lamports returned to authority) @@ -91,6 +92,7 @@ fn test_create_and_close_mint() { vec![initialize_ix2], &[&payer, &mint_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -121,8 +123,14 @@ fn test_create_and_close_mint() { ], data: vec![9], // CloseAccount }; - send_transaction_from_instructions(&mut svm, vec![close_direct_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![close_direct_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); // Verify mint is closed again let mint_account = svm.get_account(&mint_keypair.pubkey()); diff --git a/tokens/token-extensions/nft-meta-data-pointer/anchor-example/anchor/README.md b/tokens/token-extensions/nft-meta-data-pointer/anchor-example/anchor/README.md index dda4c04e7..750bbb1e6 100644 --- a/tokens/token-extensions/nft-meta-data-pointer/anchor-example/anchor/README.md +++ b/tokens/token-extensions/nft-meta-data-pointer/anchor-example/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/nft-meta-data-pointer/anchor-example/anchor/programs/extension_nft/Cargo.toml b/tokens/token-extensions/nft-meta-data-pointer/anchor-example/anchor/programs/extension_nft/Cargo.toml index de5055f68..aaf65e17b 100644 --- a/tokens/token-extensions/nft-meta-data-pointer/anchor-example/anchor/programs/extension_nft/Cargo.toml +++ b/tokens/token-extensions/nft-meta-data-pointer/anchor-example/anchor/programs/extension_nft/Cargo.toml @@ -23,16 +23,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = { version = "2.0.0-rc.1", features = ["compat"] } +anchor-lang = { version = "2.0.0-rc.2", features = ["compat"] } # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = { version = "2.0.0-rc.1" } +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = { version = "2.0.0-rc.2" } # session-keys is Anchor v1 only: its `Session` derive requires # `Option>`, which v2 has no equivalent for. The # account layout is read directly in src/session.rs instead. @@ -63,12 +58,18 @@ anchor-spl = { version = "2.0.0-rc.1" } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" # Test-side decode of the player account's borsh payload. borsh = "1.6.1" solana-instruction = "3.0.0" -solana-pubkey = "3.0.0" -solana-kite = "0.4.0" +solana-pubkey = "4.3" +solana-kite = "0.7.0" [lints.rust] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } diff --git a/tokens/token-extensions/nft-meta-data-pointer/anchor-example/anchor/programs/extension_nft/tests/test_extension_nft.rs b/tokens/token-extensions/nft-meta-data-pointer/anchor-example/anchor/programs/extension_nft/tests/test_extension_nft.rs index 083d07108..e31bb0fe2 100644 --- a/tokens/token-extensions/nft-meta-data-pointer/anchor-example/anchor/programs/extension_nft/tests/test_extension_nft.rs +++ b/tokens/token-extensions/nft-meta-data-pointer/anchor-example/anchor/programs/extension_nft/tests/test_extension_nft.rs @@ -23,7 +23,7 @@ use { // `system_program` moved to the crate root in v2, and `Pubkey` is // compat-only: `Address` is the same 32-byte type. anchor_lang::{system_program, Address as Pubkey, InstructionData, ToAccountMetas}, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_instruction::Instruction, solana_kite::{create_wallet, get_pda_and_bump, send_transaction_from_instructions, Seed}, }; @@ -167,6 +167,7 @@ fn test_init_player_mint_and_chop() { vec![init_player_ix(&program_id, &signer)], &[&payer], &signer, + None, ) .expect("init_player should succeed"); @@ -186,6 +187,7 @@ fn test_init_player_mint_and_chop() { vec![mint_nft_ix(&program_id, &signer, &mint.pubkey())], &[&payer, &mint], &signer, + None, ) .expect("mint_nft should succeed"); @@ -217,6 +219,7 @@ fn test_init_player_mint_and_chop() { vec![chop_tree_ix(&program_id, &signer, &mint.pubkey(), 1)], &[&payer], &signer, + None, ) .expect("chop_tree should succeed"); diff --git a/tokens/token-extensions/non-transferable/anchor/README.md b/tokens/token-extensions/non-transferable/anchor/README.md index 6f6fb021e..3175452a9 100644 --- a/tokens/token-extensions/non-transferable/anchor/README.md +++ b/tokens/token-extensions/non-transferable/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/non-transferable/anchor/programs/non-transferable/Cargo.toml b/tokens/token-extensions/non-transferable/anchor/programs/non-transferable/Cargo.toml index 50455c7e8..3b60f39b1 100644 --- a/tokens/token-extensions/non-transferable/anchor/programs/non-transferable/Cargo.toml +++ b/tokens/token-extensions/non-transferable/anchor/programs/non-transferable/Cargo.toml @@ -19,16 +19,11 @@ idl-build = ["anchor-lang/idl-build"] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -45,8 +40,14 @@ anchor-spl = "2.0.0-rc.1" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/non-transferable/anchor/programs/non-transferable/tests/test_non_transferable.rs b/tokens/token-extensions/non-transferable/anchor/programs/non-transferable/tests/test_non_transferable.rs index e2523d1f0..b74682cc1 100644 --- a/tokens/token-extensions/non-transferable/anchor/programs/non-transferable/tests/test_non_transferable.rs +++ b/tokens/token-extensions/non-transferable/anchor/programs/non-transferable/tests/test_non_transferable.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{ create_wallet, send_transaction_from_instructions, token_extensions::{ @@ -47,6 +47,7 @@ fn test_create_non_transferable_mint_and_attempt_transfer() { vec![initialize_ix], &[&payer, &mint_keypair], &payer.pubkey(), + None, ) .unwrap(); svm.expire_blockhash(); @@ -63,9 +64,14 @@ fn test_create_non_transferable_mint_and_attempt_transfer() { // Step 2: Create ATAs for sender and recipient let recipient = Keypair::new(); - let source_ata = - create_token_extensions_account(&mut svm, &payer.pubkey(), &mint_keypair.pubkey(), &payer) - .unwrap(); + let source_ata = create_token_extensions_account( + &mut svm, + &payer.pubkey(), + &mint_keypair.pubkey(), + &payer, + None, + ) + .unwrap(); svm.expire_blockhash(); let dest_ata = create_token_extensions_account( @@ -73,6 +79,7 @@ fn test_create_non_transferable_mint_and_attempt_transfer() { &recipient.pubkey(), &mint_keypair.pubkey(), &payer, + None, ) .unwrap(); svm.expire_blockhash(); @@ -84,6 +91,7 @@ fn test_create_non_transferable_mint_and_attempt_transfer() { &source_ata, 1, &payer, + None, ) .unwrap(); svm.expire_blockhash(); @@ -98,6 +106,7 @@ fn test_create_non_transferable_mint_and_attempt_transfer() { 1, 2, // decimals &[], + None, ); assert!( result.is_err(), diff --git a/tokens/token-extensions/permanent-delegate/anchor/README.md b/tokens/token-extensions/permanent-delegate/anchor/README.md index 30d794c84..92f3ecbf9 100644 --- a/tokens/token-extensions/permanent-delegate/anchor/README.md +++ b/tokens/token-extensions/permanent-delegate/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/permanent-delegate/anchor/programs/permanent-delegate/Cargo.toml b/tokens/token-extensions/permanent-delegate/anchor/programs/permanent-delegate/Cargo.toml index e9e0a12cd..83f3333bc 100644 --- a/tokens/token-extensions/permanent-delegate/anchor/programs/permanent-delegate/Cargo.toml +++ b/tokens/token-extensions/permanent-delegate/anchor/programs/permanent-delegate/Cargo.toml @@ -23,16 +23,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -49,8 +44,14 @@ anchor-spl = "2.0.0-rc.1" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/permanent-delegate/anchor/programs/permanent-delegate/tests/test_permanent_delegate.rs b/tokens/token-extensions/permanent-delegate/anchor/programs/permanent-delegate/tests/test_permanent_delegate.rs index 00288c545..2cad2ce8f 100644 --- a/tokens/token-extensions/permanent-delegate/anchor/programs/permanent-delegate/tests/test_permanent_delegate.rs +++ b/tokens/token-extensions/permanent-delegate/anchor/programs/permanent-delegate/tests/test_permanent_delegate.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::{AccountMeta, Instruction}, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{ assert_token_account_balance, create_wallet, send_transaction_from_instructions, token_extensions::{mint_tokens_to_token_extensions_account, TOKEN_EXTENSIONS_PROGRAM_ID}, @@ -96,6 +96,7 @@ fn test_create_mint_with_permanent_delegate_and_burn() { vec![initialize_ix], &[&payer, &mint_keypair], &payer.pubkey(), + None, ) .unwrap(); svm.expire_blockhash(); @@ -114,6 +115,7 @@ fn test_create_mint_with_permanent_delegate_and_burn() { create_ata_ixs, &[&payer, &token_account], &payer.pubkey(), + None, ) .unwrap(); svm.expire_blockhash(); @@ -125,6 +127,7 @@ fn test_create_mint_with_permanent_delegate_and_burn() { &token_account.pubkey(), 100, &payer, + None, ) .unwrap(); svm.expire_blockhash(); @@ -137,7 +140,7 @@ fn test_create_mint_with_permanent_delegate_and_burn() { 100, 2, // decimals ); - send_transaction_from_instructions(&mut svm, vec![burn_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![burn_ix], &[&payer], &payer.pubkey(), None) .unwrap(); assert_token_account_balance( diff --git a/tokens/token-extensions/transfer-fee/anchor/README.md b/tokens/token-extensions/transfer-fee/anchor/README.md index 9968442f4..84c8eb808 100644 --- a/tokens/token-extensions/transfer-fee/anchor/README.md +++ b/tokens/token-extensions/transfer-fee/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/transfer-fee/anchor/programs/transfer-fee/Cargo.toml b/tokens/token-extensions/transfer-fee/anchor/programs/transfer-fee/Cargo.toml index d2ba792d9..e66a462f0 100644 --- a/tokens/token-extensions/transfer-fee/anchor/programs/transfer-fee/Cargo.toml +++ b/tokens/token-extensions/transfer-fee/anchor/programs/transfer-fee/Cargo.toml @@ -19,16 +19,11 @@ idl-build = ["anchor-lang/idl-build"] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -45,8 +40,14 @@ anchor-spl = "2.0.0-rc.1" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/transfer-fee/anchor/programs/transfer-fee/tests/test_transfer_fee.rs b/tokens/token-extensions/transfer-fee/anchor/programs/transfer-fee/tests/test_transfer_fee.rs index 95b419f03..8f4fd2a19 100644 --- a/tokens/token-extensions/transfer-fee/anchor/programs/transfer-fee/tests/test_transfer_fee.rs +++ b/tokens/token-extensions/transfer-fee/anchor/programs/transfer-fee/tests/test_transfer_fee.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::{AccountMeta, Instruction}, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{ create_wallet, send_transaction_from_instructions, token_extensions::{ @@ -62,13 +62,20 @@ fn test_transfer_fee_full_flow() { vec![initialize_ix], &[&payer, &mint_keypair], &payer.pubkey(), + None, ) .unwrap(); svm.expire_blockhash(); // Step 2: Create sender ATA and mint 300 tokens - create_token_extensions_account(&mut svm, &payer.pubkey(), &mint_keypair.pubkey(), &payer) - .unwrap(); + create_token_extensions_account( + &mut svm, + &payer.pubkey(), + &mint_keypair.pubkey(), + &payer, + None, + ) + .unwrap(); svm.expire_blockhash(); mint_tokens_to_token_extensions_account( @@ -77,6 +84,7 @@ fn test_transfer_fee_full_flow() { &sender_ata, 300, &payer, + None, ) .unwrap(); svm.expire_blockhash(); @@ -97,8 +105,14 @@ fn test_transfer_fee_full_flow() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![transfer_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![transfer_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 4: Transfer 200 tokens (fee = min(1% * 200 = 2, max_fee = 1) = 1, capped by maximumFee) @@ -117,8 +131,14 @@ fn test_transfer_fee_full_flow() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![transfer_ix2], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![transfer_ix2], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 5: Harvest transfer fees from recipient token account to mint @@ -132,8 +152,14 @@ fn test_transfer_fee_full_flow() { metas.push(AccountMeta::new(recipient_ata, false)); metas }); - send_transaction_from_instructions(&mut svm, vec![harvest_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![harvest_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 6: Withdraw harvested fees from mint to sender's token account @@ -148,8 +174,14 @@ fn test_transfer_fee_full_flow() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![withdraw_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![withdraw_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 7: Update transfer fee to 0 @@ -167,6 +199,12 @@ fn test_transfer_fee_full_flow() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![update_fee_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![update_fee_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); } diff --git a/tokens/token-extensions/transfer-hook/account-data-as-seed/anchor/README.md b/tokens/token-extensions/transfer-hook/account-data-as-seed/anchor/README.md index e882b48a0..14e1df427 100644 --- a/tokens/token-extensions/transfer-hook/account-data-as-seed/anchor/README.md +++ b/tokens/token-extensions/transfer-hook/account-data-as-seed/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/transfer-hook/account-data-as-seed/anchor/programs/transfer-hook/Cargo.toml b/tokens/token-extensions/transfer-hook/account-data-as-seed/anchor/programs/transfer-hook/Cargo.toml index e6af421d2..858190af0 100644 --- a/tokens/token-extensions/transfer-hook/account-data-as-seed/anchor/programs/transfer-hook/Cargo.toml +++ b/tokens/token-extensions/transfer-hook/account-data-as-seed/anchor/programs/transfer-hook/Cargo.toml @@ -30,16 +30,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = { version = "2.0.0-rc.1", features = ["compat"] } +anchor-lang = { version = "2.0.0-rc.2", features = ["compat"] } # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" spl-discriminator = "0.4.1" spl-tlv-account-resolution = "0.9.0" spl-transfer-hook-interface = "0.9.0" @@ -59,8 +54,14 @@ spl-transfer-hook-interface = "0.9.0" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/transfer-hook/account-data-as-seed/anchor/programs/transfer-hook/tests/test_transfer_hook.rs b/tokens/token-extensions/transfer-hook/account-data-as-seed/anchor/programs/transfer-hook/tests/test_transfer_hook.rs index 799122e24..396078448 100644 --- a/tokens/token-extensions/transfer-hook/account-data-as-seed/anchor/programs/transfer-hook/tests/test_transfer_hook.rs +++ b/tokens/token-extensions/transfer-hook/account-data-as-seed/anchor/programs/transfer-hook/tests/test_transfer_hook.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, borsh::BorshDeserialize, solana_kite::{ create_wallet, send_transaction_from_instructions, @@ -67,6 +67,7 @@ fn test_transfer_hook_account_data_as_seed() { &[MintExtension::TransferHook { program_id: program_id, }], + None, ) .unwrap(); svm.expire_blockhash(); @@ -76,14 +77,16 @@ fn test_transfer_hook_account_data_as_seed() { // Step 2: Create token accounts and mint tokens let amount: u64 = 100 * 10u64.pow(decimals as u32); let source_ata = - create_token_extensions_account(&mut svm, &payer.pubkey(), &mint, &payer).unwrap(); + create_token_extensions_account(&mut svm, &payer.pubkey(), &mint, &payer, None).unwrap(); svm.expire_blockhash(); let dest_ata = - create_token_extensions_account(&mut svm, &recipient.pubkey(), &mint, &payer).unwrap(); + create_token_extensions_account(&mut svm, &recipient.pubkey(), &mint, &payer, None) + .unwrap(); svm.expire_blockhash(); - mint_tokens_to_token_extensions_account(&mut svm, &mint, &source_ata, amount, &payer).unwrap(); + mint_tokens_to_token_extensions_account(&mut svm, &mint, &source_ata, amount, &payer, None) + .unwrap(); svm.expire_blockhash(); // Step 3: Initialize ExtraAccountMetaList (also creates counter PDA) @@ -101,8 +104,14 @@ fn test_transfer_hook_account_data_as_seed() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![init_extra_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![init_extra_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 4: Transfer with hook @@ -125,6 +134,7 @@ fn test_transfer_hook_account_data_as_seed() { transfer_amount, decimals, &extra_accounts, + None, ) .unwrap(); svm.expire_blockhash(); @@ -152,6 +162,7 @@ fn test_transfer_hook_account_data_as_seed() { vec![direct_hook_ix], &[&payer], &payer.pubkey(), + None, ); assert!( result.is_err(), diff --git a/tokens/token-extensions/transfer-hook/allow-block-list-token/anchor/README.md b/tokens/token-extensions/transfer-hook/allow-block-list-token/anchor/README.md index 9b0bdf8db..c7416a54f 100644 --- a/tokens/token-extensions/transfer-hook/allow-block-list-token/anchor/README.md +++ b/tokens/token-extensions/transfer-hook/allow-block-list-token/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/transfer-hook/allow-block-list-token/anchor/programs/abl-token/Cargo.toml b/tokens/token-extensions/transfer-hook/allow-block-list-token/anchor/programs/abl-token/Cargo.toml index 8b05e9a52..ddfa2fbf8 100644 --- a/tokens/token-extensions/transfer-hook/allow-block-list-token/anchor/programs/abl-token/Cargo.toml +++ b/tokens/token-extensions/transfer-hook/allow-block-list-token/anchor/programs/abl-token/Cargo.toml @@ -28,18 +28,13 @@ profile = ["anchor-v2-testing/profile"] [dependencies] # interface-instructions feature was removed in Anchor 1.0 and does not exist in v2 -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" +wincode = { version = "0.6", features = ["derive"] } # v2's anchor-spl has only `guardrails` (default) and `metadata`; the # Token-2022 modules are unconditional now. -anchor-spl = "2.0.0-rc.1" +anchor-spl = "2.0.0-rc.2" spl-tlv-account-resolution = "0.11.1" spl-transfer-hook-interface = { version = "2.1.0" } @@ -60,8 +55,14 @@ spl-discriminator = "0.5.1" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/transfer-hook/allow-block-list-token/anchor/programs/abl-token/tests/test_abl_token.rs b/tokens/token-extensions/transfer-hook/allow-block-list-token/anchor/programs/abl-token/tests/test_abl_token.rs index a2e3dd260..a185d083f 100644 --- a/tokens/token-extensions/transfer-hook/allow-block-list-token/anchor/programs/abl-token/tests/test_abl_token.rs +++ b/tokens/token-extensions/transfer-hook/allow-block-list-token/anchor/programs/abl-token/tests/test_abl_token.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{ create_wallet, send_transaction_from_instructions, token_extensions::TOKEN_EXTENSIONS_PROGRAM_ID, @@ -44,8 +44,14 @@ fn test_init_config_and_init_mint() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![init_config_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![init_config_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 2: Initialize mint with transfer hook and metadata @@ -81,6 +87,7 @@ fn test_init_config_and_init_mint() { vec![init_mint_ix], &[&payer, &mint_keypair], &payer.pubkey(), + None, ) .unwrap(); } diff --git a/tokens/token-extensions/transfer-hook/counter/anchor/README.md b/tokens/token-extensions/transfer-hook/counter/anchor/README.md index c0ddf681f..13cf565dd 100644 --- a/tokens/token-extensions/transfer-hook/counter/anchor/README.md +++ b/tokens/token-extensions/transfer-hook/counter/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/transfer-hook/counter/anchor/programs/transfer-hook/Cargo.toml b/tokens/token-extensions/transfer-hook/counter/anchor/programs/transfer-hook/Cargo.toml index 2c0f4e854..686d45658 100644 --- a/tokens/token-extensions/transfer-hook/counter/anchor/programs/transfer-hook/Cargo.toml +++ b/tokens/token-extensions/transfer-hook/counter/anchor/programs/transfer-hook/Cargo.toml @@ -30,16 +30,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = { version = "2.0.0-rc.1", features = ["compat"] } +anchor-lang = { version = "2.0.0-rc.2", features = ["compat"] } # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" spl-discriminator = "0.4.1" spl-tlv-account-resolution = "0.9.0" spl-transfer-hook-interface = "0.9.0" @@ -59,8 +54,14 @@ spl-transfer-hook-interface = "0.9.0" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/transfer-hook/counter/anchor/programs/transfer-hook/tests/test_transfer_hook_counter.rs b/tokens/token-extensions/transfer-hook/counter/anchor/programs/transfer-hook/tests/test_transfer_hook_counter.rs index 2b466a986..35958179a 100644 --- a/tokens/token-extensions/transfer-hook/counter/anchor/programs/transfer-hook/tests/test_transfer_hook_counter.rs +++ b/tokens/token-extensions/transfer-hook/counter/anchor/programs/transfer-hook/tests/test_transfer_hook_counter.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, borsh::BorshDeserialize, solana_kite::{ create_wallet, send_transaction_from_instructions, @@ -65,6 +65,7 @@ fn test_transfer_hook_counter() { &[MintExtension::TransferHook { program_id: program_id, }], + None, ) .unwrap(); svm.expire_blockhash(); @@ -76,14 +77,16 @@ fn test_transfer_hook_counter() { let amount: u64 = 100 * 10u64.pow(decimals as u32); let source_ata = - create_token_extensions_account(&mut svm, &payer.pubkey(), &mint, &payer).unwrap(); + create_token_extensions_account(&mut svm, &payer.pubkey(), &mint, &payer, None).unwrap(); svm.expire_blockhash(); let dest_ata = - create_token_extensions_account(&mut svm, &recipient.pubkey(), &mint, &payer).unwrap(); + create_token_extensions_account(&mut svm, &recipient.pubkey(), &mint, &payer, None) + .unwrap(); svm.expire_blockhash(); - mint_tokens_to_token_extensions_account(&mut svm, &mint, &source_ata, amount, &payer).unwrap(); + mint_tokens_to_token_extensions_account(&mut svm, &mint, &source_ata, amount, &payer, None) + .unwrap(); svm.expire_blockhash(); // Step 3: Initialize ExtraAccountMetaList (also creates counter PDA) @@ -101,8 +104,14 @@ fn test_transfer_hook_counter() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![init_extra_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![init_extra_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 4: Transfer with hook (this triggers the counter increment) @@ -125,6 +134,7 @@ fn test_transfer_hook_counter() { transfer_amount, decimals, &extra_accounts, + None, ) .unwrap(); svm.expire_blockhash(); @@ -152,6 +162,7 @@ fn test_transfer_hook_counter() { vec![direct_hook_ix], &[&payer], &payer.pubkey(), + None, ); assert!( result.is_err(), diff --git a/tokens/token-extensions/transfer-hook/hello-world/anchor/README.md b/tokens/token-extensions/transfer-hook/hello-world/anchor/README.md index ce61425f7..c879e0d43 100644 --- a/tokens/token-extensions/transfer-hook/hello-world/anchor/README.md +++ b/tokens/token-extensions/transfer-hook/hello-world/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/transfer-hook/hello-world/anchor/programs/transfer-hook/Cargo.toml b/tokens/token-extensions/transfer-hook/hello-world/anchor/programs/transfer-hook/Cargo.toml index ffbf630d3..0aa6edc56 100644 --- a/tokens/token-extensions/transfer-hook/hello-world/anchor/programs/transfer-hook/Cargo.toml +++ b/tokens/token-extensions/transfer-hook/hello-world/anchor/programs/transfer-hook/Cargo.toml @@ -30,16 +30,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = { version = "2.0.0-rc.1", features = ["compat"] } +anchor-lang = { version = "2.0.0-rc.2", features = ["compat"] } # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" spl-discriminator = "0.4.1" spl-tlv-account-resolution = "0.9.0" spl-transfer-hook-interface = "0.9.0" @@ -59,8 +54,14 @@ spl-transfer-hook-interface = "0.9.0" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/transfer-hook/hello-world/anchor/programs/transfer-hook/tests/test_transfer_hook.rs b/tokens/token-extensions/transfer-hook/hello-world/anchor/programs/transfer-hook/tests/test_transfer_hook.rs index 9990b409a..2cceb7b06 100644 --- a/tokens/token-extensions/transfer-hook/hello-world/anchor/programs/transfer-hook/tests/test_transfer_hook.rs +++ b/tokens/token-extensions/transfer-hook/hello-world/anchor/programs/transfer-hook/tests/test_transfer_hook.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{ create_wallet, send_transaction_from_instructions, token_extensions::{ @@ -62,15 +62,21 @@ fn test_transfer_hook_hello_world() { vec![initialize_ix], &[&payer, &mint_keypair], &payer.pubkey(), + None, ) .unwrap(); svm.expire_blockhash(); // Step 2: Create token accounts and mint tokens let amount: u64 = 100 * 10u64.pow(decimals as u32); - let source_ata = - create_token_extensions_account(&mut svm, &payer.pubkey(), &mint_keypair.pubkey(), &payer) - .unwrap(); + let source_ata = create_token_extensions_account( + &mut svm, + &payer.pubkey(), + &mint_keypair.pubkey(), + &payer, + None, + ) + .unwrap(); svm.expire_blockhash(); let dest_ata = create_token_extensions_account( @@ -78,6 +84,7 @@ fn test_transfer_hook_hello_world() { &recipient.pubkey(), &mint_keypair.pubkey(), &payer, + None, ) .unwrap(); svm.expire_blockhash(); @@ -88,6 +95,7 @@ fn test_transfer_hook_hello_world() { &source_ata, amount, &payer, + None, ) .unwrap(); svm.expire_blockhash(); @@ -106,8 +114,14 @@ fn test_transfer_hook_hello_world() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![init_extra_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![init_extra_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 4: Transfer with transfer hook @@ -126,6 +140,7 @@ fn test_transfer_hook_hello_world() { transfer_amount, decimals, &extra_accounts, + None, ) .unwrap(); svm.expire_blockhash(); @@ -148,6 +163,7 @@ fn test_transfer_hook_hello_world() { vec![direct_hook_ix], &[&payer], &payer.pubkey(), + None, ); assert!( result.is_err(), diff --git a/tokens/token-extensions/transfer-hook/transfer-cost/anchor/README.md b/tokens/token-extensions/transfer-hook/transfer-cost/anchor/README.md index aa5f03a98..0614a42ab 100644 --- a/tokens/token-extensions/transfer-hook/transfer-cost/anchor/README.md +++ b/tokens/token-extensions/transfer-hook/transfer-cost/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/transfer-hook/transfer-cost/anchor/programs/transfer-hook/Cargo.toml b/tokens/token-extensions/transfer-hook/transfer-cost/anchor/programs/transfer-hook/Cargo.toml index 832880446..3fc291653 100644 --- a/tokens/token-extensions/transfer-hook/transfer-cost/anchor/programs/transfer-hook/Cargo.toml +++ b/tokens/token-extensions/transfer-hook/transfer-cost/anchor/programs/transfer-hook/Cargo.toml @@ -30,16 +30,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = { version = "2.0.0-rc.1", features = ["compat"] } +anchor-lang = { version = "2.0.0-rc.2", features = ["compat"] } # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" # SPL crates v3.x-compatible - uses solana-program-error 3.x matching anchor-lang v2 spl-discriminator = "0.5.2" spl-tlv-account-resolution = "0.11.1" @@ -60,8 +55,14 @@ spl-transfer-hook-interface = "2.1.0" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/transfer-hook/transfer-cost/anchor/programs/transfer-hook/tests/test_transfer_hook.rs b/tokens/token-extensions/transfer-hook/transfer-cost/anchor/programs/transfer-hook/tests/test_transfer_hook.rs index 5ebe5774b..62da0eade 100644 --- a/tokens/token-extensions/transfer-hook/transfer-cost/anchor/programs/transfer-hook/tests/test_transfer_hook.rs +++ b/tokens/token-extensions/transfer-hook/transfer-cost/anchor/programs/transfer-hook/tests/test_transfer_hook.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{ create_wallet, send_transaction_from_instructions, token_extensions::{ @@ -38,6 +38,7 @@ fn test_initialize_extra_account_meta_list() { &[MintExtension::TransferHook { program_id: program_id, }], + None, ) .unwrap(); svm.expire_blockhash(); @@ -59,8 +60,14 @@ fn test_initialize_extra_account_meta_list() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![init_extra_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![init_extra_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); // Verify the ExtraAccountMetaList account was created let account = svm.get_account(&extra_account_meta_list); diff --git a/tokens/token-extensions/transfer-hook/transfer-switch/anchor/README.md b/tokens/token-extensions/transfer-hook/transfer-switch/anchor/README.md index 1986271d9..82b71991b 100644 --- a/tokens/token-extensions/transfer-hook/transfer-switch/anchor/README.md +++ b/tokens/token-extensions/transfer-hook/transfer-switch/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/transfer-hook/transfer-switch/anchor/programs/transfer-switch/Cargo.toml b/tokens/token-extensions/transfer-hook/transfer-switch/anchor/programs/transfer-switch/Cargo.toml index fe6a3d6ec..647ba6caf 100644 --- a/tokens/token-extensions/transfer-hook/transfer-switch/anchor/programs/transfer-switch/Cargo.toml +++ b/tokens/token-extensions/transfer-hook/transfer-switch/anchor/programs/transfer-switch/Cargo.toml @@ -26,16 +26,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = { version = "2.0.0-rc.1", features = ["compat"] } +anchor-lang = { version = "2.0.0-rc.2", features = ["compat"] } # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" spl-discriminator = "0.4.1" spl-tlv-account-resolution = "0.9.0" spl-transfer-hook-interface = "0.9.0" @@ -55,8 +50,14 @@ spl-transfer-hook-interface = "0.9.0" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/transfer-hook/transfer-switch/anchor/programs/transfer-switch/tests/test_transfer_switch.rs b/tokens/token-extensions/transfer-hook/transfer-switch/anchor/programs/transfer-switch/tests/test_transfer_switch.rs index 69857d21b..85c425db8 100644 --- a/tokens/token-extensions/transfer-hook/transfer-switch/anchor/programs/transfer-switch/tests/test_transfer_switch.rs +++ b/tokens/token-extensions/transfer-hook/transfer-switch/anchor/programs/transfer-switch/tests/test_transfer_switch.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{ create_wallet, send_transaction_from_instructions, token_extensions::{ @@ -47,6 +47,7 @@ fn test_transfer_switch() { &[MintExtension::TransferHook { program_id: program_id, }], + None, ) .unwrap(); svm.expire_blockhash(); @@ -56,14 +57,16 @@ fn test_transfer_switch() { // Step 2: Create token accounts and mint tokens let amount: u64 = 100 * 10u64.pow(decimals as u32); let source_ata = - create_token_extensions_account(&mut svm, &sender.pubkey(), &mint, &payer).unwrap(); + create_token_extensions_account(&mut svm, &sender.pubkey(), &mint, &payer, None).unwrap(); svm.expire_blockhash(); let dest_ata = - create_token_extensions_account(&mut svm, &recipient.pubkey(), &mint, &payer).unwrap(); + create_token_extensions_account(&mut svm, &recipient.pubkey(), &mint, &payer, None) + .unwrap(); svm.expire_blockhash(); - mint_tokens_to_token_extensions_account(&mut svm, &mint, &source_ata, amount, &payer).unwrap(); + mint_tokens_to_token_extensions_account(&mut svm, &mint, &source_ata, amount, &payer, None) + .unwrap(); svm.expire_blockhash(); // Step 3: Configure admin @@ -83,6 +86,7 @@ fn test_transfer_switch() { vec![configure_admin_ix], &[&payer], &payer.pubkey(), + None, ) .unwrap(); svm.expire_blockhash(); @@ -99,8 +103,14 @@ fn test_transfer_switch() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![init_extra_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![init_extra_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 5: Turn transfers OFF for sender @@ -116,8 +126,14 @@ fn test_transfer_switch() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![switch_off_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![switch_off_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 6: Try transfer - should FAIL (switch is off) @@ -140,6 +156,7 @@ fn test_transfer_switch() { transfer_amount, decimals, &extra_accounts, + None, ); assert!(result.is_err(), "Transfer should fail when switch is off"); svm.expire_blockhash(); @@ -157,8 +174,14 @@ fn test_transfer_switch() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![switch_on_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![switch_on_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 8: Transfer - should SUCCEED (switch is on) @@ -171,6 +194,7 @@ fn test_transfer_switch() { transfer_amount, decimals, &extra_accounts, + None, ) .unwrap(); } diff --git a/tokens/token-extensions/transfer-hook/whitelist/anchor/README.md b/tokens/token-extensions/transfer-hook/whitelist/anchor/README.md index ad01690d8..47f452ebc 100644 --- a/tokens/token-extensions/transfer-hook/whitelist/anchor/README.md +++ b/tokens/token-extensions/transfer-hook/whitelist/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-extensions/transfer-hook/whitelist/anchor/programs/transfer-hook/Cargo.toml b/tokens/token-extensions/transfer-hook/whitelist/anchor/programs/transfer-hook/Cargo.toml index 5d023e8d8..dacf03a65 100644 --- a/tokens/token-extensions/transfer-hook/whitelist/anchor/programs/transfer-hook/Cargo.toml +++ b/tokens/token-extensions/transfer-hook/whitelist/anchor/programs/transfer-hook/Cargo.toml @@ -30,16 +30,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = { version = "2.0.0-rc.1", features = ["compat"] } +anchor-lang = { version = "2.0.0-rc.2", features = ["compat"] } # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = "2.0.0-rc.1" +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = "2.0.0-rc.2" spl-discriminator = "0.4.1" spl-tlv-account-resolution = "0.9.0" spl-transfer-hook-interface = "0.9.0" @@ -59,8 +54,14 @@ spl-transfer-hook-interface = "0.9.0" # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-extensions/transfer-hook/whitelist/anchor/programs/transfer-hook/tests/test_transfer_hook.rs b/tokens/token-extensions/transfer-hook/whitelist/anchor/programs/transfer-hook/tests/test_transfer_hook.rs index 4707cc605..1513ca3a6 100644 --- a/tokens/token-extensions/transfer-hook/whitelist/anchor/programs/transfer-hook/tests/test_transfer_hook.rs +++ b/tokens/token-extensions/transfer-hook/whitelist/anchor/programs/transfer-hook/tests/test_transfer_hook.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{ create_wallet, send_transaction_from_instructions, token_extensions::{ @@ -44,6 +44,7 @@ fn test_whitelist_transfer_hook() { &[MintExtension::TransferHook { program_id: program_id, }], + None, ) .unwrap(); svm.expire_blockhash(); @@ -53,14 +54,16 @@ fn test_whitelist_transfer_hook() { // Step 2: Create token accounts and mint tokens let amount: u64 = 100 * 10u64.pow(decimals as u32); let source_ata = - create_token_extensions_account(&mut svm, &payer.pubkey(), &mint, &payer).unwrap(); + create_token_extensions_account(&mut svm, &payer.pubkey(), &mint, &payer, None).unwrap(); svm.expire_blockhash(); let dest_ata = - create_token_extensions_account(&mut svm, &recipient.pubkey(), &mint, &payer).unwrap(); + create_token_extensions_account(&mut svm, &recipient.pubkey(), &mint, &payer, None) + .unwrap(); svm.expire_blockhash(); - mint_tokens_to_token_extensions_account(&mut svm, &mint, &source_ata, amount, &payer).unwrap(); + mint_tokens_to_token_extensions_account(&mut svm, &mint, &source_ata, amount, &payer, None) + .unwrap(); svm.expire_blockhash(); // Step 3: Initialize ExtraAccountMetaList (also creates whitelist) @@ -76,8 +79,14 @@ fn test_whitelist_transfer_hook() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![init_extra_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![init_extra_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); svm.expire_blockhash(); // Step 4: Add destination token account to whitelist @@ -96,6 +105,7 @@ fn test_whitelist_transfer_hook() { vec![add_to_whitelist_ix], &[&payer], &payer.pubkey(), + None, ) .unwrap(); svm.expire_blockhash(); @@ -120,6 +130,7 @@ fn test_whitelist_transfer_hook() { transfer_amount, decimals, &extra_accounts, + None, ) .unwrap(); } diff --git a/tokens/token-minter/anchor/README.md b/tokens/token-minter/anchor/README.md index ceb7d7711..0298231b2 100644 --- a/tokens/token-minter/anchor/README.md +++ b/tokens/token-minter/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/token-minter/anchor/programs/token-minter/Cargo.toml b/tokens/token-minter/anchor/programs/token-minter/Cargo.toml index d3fd28e73..d304ff4ff 100644 --- a/tokens/token-minter/anchor/programs/token-minter/Cargo.toml +++ b/tokens/token-minter/anchor/programs/token-minter/Cargo.toml @@ -22,16 +22,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = { version = "2.0.0-rc.1", features = ["metadata"] } +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = { version = "2.0.0-rc.2", features = ["metadata"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -48,8 +43,14 @@ anchor-spl = { version = "2.0.0-rc.1", features = ["metadata"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/token-minter/anchor/programs/token-minter/tests/test_token_minter.rs b/tokens/token-minter/anchor/programs/token-minter/tests/test_token_minter.rs index 9d328e5a7..82e05c1b1 100644 --- a/tokens/token-minter/anchor/programs/token-minter/tests/test_token_minter.rs +++ b/tokens/token-minter/anchor/programs/token-minter/tests/test_token_minter.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{create_wallet, get_token_account_balance, send_transaction_from_instructions}, }; @@ -103,6 +103,7 @@ fn test_create_token() { vec![create_ix], &[&payer, &mint_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -150,6 +151,7 @@ fn test_create_and_mint_tokens() { vec![create_ix], &[&payer, &mint_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -174,7 +176,7 @@ fn test_create_and_mint_tokens() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![mint_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![mint_ix], &[&payer], &payer.pubkey(), None) .unwrap(); // Verify 100 tokens minted (in minor units) diff --git a/tokens/token-minter/native/program/Cargo.toml b/tokens/token-minter/native/program/Cargo.toml index 306a21e8b..87fac294a 100644 --- a/tokens/token-minter/native/program/Cargo.toml +++ b/tokens/token-minter/native/program/Cargo.toml @@ -10,11 +10,12 @@ solana-program.workspace = true solana-system-interface = { version = "2.0.0", features = ["bincode"] } spl-token-interface = "2.0.0" spl-associated-token-account-interface = "2.0.0" -# anchor-spl 2.0.0-rc.1 depends on `=5.1.2-alpha.2`, and a caret range excludes -# pre-releases, so `^5.1.1` here and that exact pin cannot both be satisfied in -# one lockfile. Matching the pin is what lets the anchor and native token +# anchor-spl 2.0.0-rc.2 depends on `=5.1.2-alpha.2`. A range starting at a +# stable release such as `^5.1.1` never matches a pre-release, so it and that +# exact pin cannot both be satisfied in one lockfile. A range starting at the +# pre-release itself can, which is what lets the anchor and native token # examples share a workspace. -mpl-token-metadata = "=5.1.2-alpha.2" +mpl-token-metadata = "5.1.2-alpha.2" # Alias for the (older) solana-program version mpl-token-metadata's instruction # builders return, so we can name that Instruction/Pubkey type when bridging. mpl-solana-program = { package = "solana-program", version = "3.0" } @@ -30,9 +31,9 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2" diff --git a/tokens/transfer-tokens/anchor/README.md b/tokens/transfer-tokens/anchor/README.md index 1eb261627..8983a7f61 100644 --- a/tokens/transfer-tokens/anchor/README.md +++ b/tokens/transfer-tokens/anchor/README.md @@ -2,7 +2,7 @@ > [!NOTE] > This is the **Anchor v2** copy of this example. Every `anchor` command on this page -> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.1 --locked` (avm has +> needs the v2 CLI: `cargo install anchor-cli --version 2.0.0-rc.2 --locked` (avm has > no prebuilt binary for this pre-release). The Anchor v1 version of this example is in > [`../anchor-v1`](../anchor-v1/). diff --git a/tokens/transfer-tokens/anchor/programs/transfer-tokens/Cargo.toml b/tokens/transfer-tokens/anchor/programs/transfer-tokens/Cargo.toml index 4207893ea..dfa010507 100644 --- a/tokens/transfer-tokens/anchor/programs/transfer-tokens/Cargo.toml +++ b/tokens/transfer-tokens/anchor/programs/transfer-tokens/Cargo.toml @@ -22,16 +22,11 @@ custom-panic = [] profile = ["anchor-v2-testing/profile"] [dependencies] -anchor-lang = "2.0.0-rc.1" +anchor-lang = "2.0.0-rc.2" # The `#[program]` macro expands to `wincode` paths for instruction-data # (de)serialization, so the crate has to be a direct dependency. -wincode = { version = "0.5", features = ["derive"] } -# anchor-lang 2.0.0-rc.1 is built against wincode 0.5, but solana-address 2.7 -# moved to wincode 0.6. With both in the graph, `Address`'s wincode impls -# belong to the version the account derives are not using and every -# `SchemaRead`/`SchemaWrite` bound fails. 2.6.1 is the last 0.5-line release. -solana-address = ">=2.6, <2.7" -anchor-spl = { version = "2.0.0-rc.1", features = ["metadata"] } +wincode = { version = "0.6", features = ["derive"] } +anchor-spl = { version = "2.0.0-rc.2", features = ["metadata"] } [dev-dependencies] # Anchor v2's own LiteSVM harness. `svm()` is `LiteSVM::new()` until the @@ -48,8 +43,14 @@ anchor-spl = { version = "2.0.0-rc.1", features = ["metadata"] } # development happens, so a later revision can carry breakage as easily as # fixes. When `anchor-v2-testing` reaches crates.io, drop the git source for # an ordinary version. -anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "3e38a121b969d1a77230baeb0056baf5cc9b3c1a" } -solana-kite = "0.4.0" +anchor-v2-testing = { git = "https://github.com/otter-sec/anchor.git", rev = "a20660219882af5f199d56ea3f9326f387f89d8b" } +# LiteSVM 0.18.1 asks for the Agave crates with `^4.3` ranges but does not +# compile against Agave 4.4.0. These two hold the Agave crates at 4.3; the rest +# follow, because Agave pins its own crates to one another exactly. Remove both +# once a LiteSVM release builds against Agave 4.4. +solana-program-runtime = "~4.3" +solana-fee = "~4.3" +solana-kite = "0.7.0" borsh = "1.6.1" [lints.rust] diff --git a/tokens/transfer-tokens/anchor/programs/transfer-tokens/tests/test_transfer_tokens.rs b/tokens/transfer-tokens/anchor/programs/transfer-tokens/tests/test_transfer_tokens.rs index aedc89b7e..77bc5fb81 100644 --- a/tokens/transfer-tokens/anchor/programs/transfer-tokens/tests/test_transfer_tokens.rs +++ b/tokens/transfer-tokens/anchor/programs/transfer-tokens/tests/test_transfer_tokens.rs @@ -3,7 +3,7 @@ use { solana_program::instruction::Instruction, system_program, Address, InstructionData, ToAccountMetas, }, - anchor_v2_testing::{Keypair, LiteSVM, Signer}, + anchor_v2_testing::{litesvm::LiteSVM, Keypair, Signer}, solana_kite::{create_wallet, get_token_account_balance, send_transaction_from_instructions}, }; @@ -104,6 +104,7 @@ fn test_create_mint_and_transfer() { vec![create_ix], &[&payer, &mint_keypair], &payer.pubkey(), + None, ) .unwrap(); @@ -134,7 +135,7 @@ fn test_create_mint_and_transfer() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![mint_ix], &[&payer], &payer.pubkey()) + send_transaction_from_instructions(&mut svm, vec![mint_ix], &[&payer], &payer.pubkey(), None) .unwrap(); // Verify 100 tokens minted (in minor units) @@ -166,8 +167,14 @@ fn test_create_mint_and_transfer() { } .to_account_metas(None), ); - send_transaction_from_instructions(&mut svm, vec![transfer_ix], &[&payer], &payer.pubkey()) - .unwrap(); + send_transaction_from_instructions( + &mut svm, + vec![transfer_ix], + &[&payer], + &payer.pubkey(), + None, + ) + .unwrap(); // Verify: sender 50 tokens, recipient 50 tokens (in minor units) assert_eq!( diff --git a/tokens/transfer-tokens/native/program/Cargo.toml b/tokens/transfer-tokens/native/program/Cargo.toml index 67cc33c09..a39ba2725 100644 --- a/tokens/transfer-tokens/native/program/Cargo.toml +++ b/tokens/transfer-tokens/native/program/Cargo.toml @@ -10,11 +10,12 @@ solana-program.workspace = true solana-system-interface = { version = "2.0.0", features = ["bincode"] } spl-token-interface = "2.0.0" spl-associated-token-account-interface = "2.0.0" -# anchor-spl 2.0.0-rc.1 depends on `=5.1.2-alpha.2`, and a caret range excludes -# pre-releases, so `^5.1.1` here and that exact pin cannot both be satisfied in -# one lockfile. Matching the pin is what lets the anchor and native token +# anchor-spl 2.0.0-rc.2 depends on `=5.1.2-alpha.2`. A range starting at a +# stable release such as `^5.1.1` never matches a pre-release, so it and that +# exact pin cannot both be satisfied in one lockfile. A range starting at the +# pre-release itself can, which is what lets the anchor and native token # examples share a workspace. -mpl-token-metadata = "=5.1.2-alpha.2" +mpl-token-metadata = "5.1.2-alpha.2" # Alias for the (older) solana-program version mpl-token-metadata's instruction # builders return, so we can name that Instruction/Pubkey type when bridging. mpl-solana-program = { package = "solana-program", version = "3.0" } @@ -30,9 +31,9 @@ custom-panic = [] unexpected_cfgs = { level = "warn", check-cfg = ['cfg(target_os, values("solana"))'] } [dev-dependencies] -litesvm = "0.13.1" +litesvm = "0.18.1" solana-instruction = "3.0.0" solana-keypair = "3.0.1" solana-native-token = "3.0.0" -solana-pubkey = "3.0.0" -solana-transaction = "3.0.1" +solana-pubkey = "4.3" +solana-transaction = "4.2"