Skip to content

Conversation

@calintje
Copy link
Contributor

This PR updates the documentation to reflect recent changes in the Rust SDK, ensuring compatibility with Solana SDK v2. The updates clarify dependency management for both the high-level and low-level SDKs, including how to handle potential version conflicts with solana-program and anchor.

  • Updated compatibility notes for Rust SDKs.
  • Provided lockfile patching instructions for Solana SDK v2.
  • Added a note on patch order when resolving dependency conflicts.
  • Ensured consistency across all relevant documentation sections.

Example
Screenshot 2025-02-16 at 05 14 29

Example
Screenshot 2025-02-16 at 05 14 41

### 1. High-Level SDK, compatible with Solana SDK versions `^1.18.0` but `<2.0.0`
### 1. High-Level SDK
#### Compatibility
- Compatible with Solana SDK versions `^1.18.0` but `<3.0.0`. By default, the Rust compiler will install the latest version of Solana SDK `^v2`. This can cause dependcy issues when using older versions. To solve this you can apply a lockfile patch with the following command:
Copy link
Member

Choose a reason for hiding this comment

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

Rust compiler -> cargo

#### Compatibility
- Compatible with Solana SDK versions `^1.18.0` but `<3.0.0`. By default, the Rust compiler will install the latest version of Solana SDK `^v2`. This can cause dependcy issues when using older versions. To solve this you can apply a lockfile patch with the following command:
```bash
cargo update solana-program:<current-version> --precise <required-version>
Copy link
Member

Choose a reason for hiding this comment

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

This one is kinda tricky cause you potentially also need to patch solana-sdk, solana-client, solana-account-decoder, spl-token, spl-memo, spl-token-2022, and spl-associated-token-account

### 3. Low-Level SDK, compatible with Solana SDK versions `^1.16.0` but `<2.0.0`
### 3. Low-Level SDK
#### Compatibility
- Compatible with `anchor v0.29.0`. If you enable the `anchor` feature of `orcah_whirlpools_client` in `cargo.toml` while using a different version of anchor in your project, you may need to apply a lockfile patch to resolve dependency conflicts:
Copy link
Member

Choose a reason for hiding this comment

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

Believe it is 0.26 to 0.29

### 3. Low-Level SDK, compatible with Solana SDK versions `^1.16.0` but `<2.0.0`
### 3. Low-Level SDK
#### Compatibility
- Compatible with `anchor v0.29.0`. If you enable the `anchor` feature of `orcah_whirlpools_client` in `cargo.toml` while using a different version of anchor in your project, you may need to apply a lockfile patch to resolve dependency conflicts:
Copy link
Member

Choose a reason for hiding this comment

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

*orcah

### 3. Low-Level SDK, compatible with Solana SDK versions `^1.16.0` but `<2.0.0`
### 3. Low-Level SDK
#### Compatibility
- Compatible with `anchor v0.29.0`. If you enable the `anchor` feature of `orcah_whirlpools_client` in `cargo.toml` while using a different version of anchor in your project, you may need to apply a lockfile patch to resolve dependency conflicts:
Copy link
Member

Choose a reason for hiding this comment

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

Lockfile patch is to switch to a lower version of anchor

@calintje calintje merged commit 6119f80 into main Feb 17, 2025
6 checks passed
@calintje calintje deleted the calintje/docs-rust-sdk-compatibility-solana-v2 branch February 17, 2025 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants