Open andreisilviudragnea opened 1 month ago
The problem is likely to be something else because Solana v2 also supports borsh 0.10.3
. The master
branch is currently on v2 and it's working fine.
However, Anchor v0.30 is not compatible with Solana v2 (it was released before Solana v2 is out), and v0.30 also specifies borsh = ">=0.9, <0.11"
version requirement, meaning you could have borsh 0.9
in your Cargo.lock
, which is incompatible with Solana v2. We've removed the borsh 0.9
support recently (https://github.com/coral-xyz/anchor/pull/3199) to make it compatible with Solana v2.
The main problem for the upgrade is we're currently depending on internal borsh
crates, but those crates no longer exist in v1 (bad timing — they've literally removed them just after we started using the internal crates), making us incapable of upgrading to borsh
v1. I'm planning to solve this problem around the time we implement custom serialization, which should either be for v0.32 or v0.33.
Yes, my problem was that I had to use borsh
crate explicitly in a Solana v2.0.x program and use anchor_lang::prelude::*;
imports borsh 0.10.3
, so I had to explicitly add borsh = "1.5.1"
as a dependency and refer to it as ::borsh
instead of borsh
in code to disambiguate from borsh
exported by use anchor_lang::prelude::*;
.
Solana v2.0.x uses
borsh = { version = "1.5.1", features = ["derive", "unstable__schema"] }
, while Anchor still usesborsh = "0.10.3"
.This leads to compile errors when trying to use Anchor with
spl-associated-token-account
types in an Anchor program.