Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Upgrade to Borsh 0.10.3 #1152

Closed
AnderUstarroz opened this issue Jul 24, 2023 · 7 comments
Closed

[Feature]: Upgrade to Borsh 0.10.3 #1152

AnderUstarroz opened this issue Jul 24, 2023 · 7 comments
Labels
enhancement New feature or request

Comments

@AnderUstarroz
Copy link

AnderUstarroz commented Jul 24, 2023

Which package is this feature request for?

All

Feature

Current library (all programs) are incompatible with Borsh 0.10.3. This is stopping developers from using latest Solana & Anchor versions.

  • Solana 1.16.x
  • Anchor 0.28.0

Standard Change?

No

Ideal solution or implementation

Refactor code to meet new Borsh 0.10.3 standards.

Alternative solutions or implementations

No response

Other context

Getting the following compiling errors when using your library on latest Solana 1.16 or Anchor 0.28.0 versions:

error[E0277]: the trait bound `Pubkey: BorshSerialize` is not satisfied
  --> src/system_program.rs:83:10
   |
83 | #[derive(Accounts)]
   |          ^^^^^^^^ the trait `BorshSerialize` is not implemented for `Pubkey`
   |
   = help: the following other types implement trait `BorshSerialize`:
             &T
             ()
             (T0, T1)
             (T0, T1, T2)
             (T0, T1, T2, T3)
             (T0, T1, T2, T3, T4)
             (T0, T1, T2, T3, T4, T5)
             (T0, T1, T2, T3, T4, T5, T6)
           and 81 others
   = help: see issue #48214
   = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
   = note: this error originates in the derive macro `Accounts` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Pubkey: BorshSerialize` is not satisfied
   --> src/system_program.rs:105:10
    |
105 | #[derive(Accounts)]
    |          ^^^^^^^^ the trait `BorshSerialize` is not implemented for `Pubkey`
    |
    = help: the following other types implement trait `BorshSerialize`:
              &T
              ()
              (T0, T1)
              (T0, T1, T2)
              (T0, T1, T2, T3)
              (T0, T1, T2, T3, T4)
              (T0, T1, T2, T3, T4, T5)
              (T0, T1, T2, T3, T4, T5, T6)
            and 81 others
    = help: see issue #48214
    = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
    = note: this error originates in the derive macro `Accounts` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Pubkey: BorshSerialize` is not satisfied
   --> src/system_program.rs:129:10
    |
129 | #[derive(Accounts)]
    |          ^^^^^^^^ the trait `BorshSerialize` is not implemented for `Pubkey`
    |
    = help: the following other types implement trait `BorshSerialize`:
              &T
              ()
              (T0, T1)
              (T0, T1, T2)
              (T0, T1, T2, T3)
              (T0, T1, T2, T3, T4)
              (T0, T1, T2, T3, T4, T5)
              (T0, T1, T2, T3, T4, T5, T6)
            and 81 others
    = help: see issue #48214
    = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
    = note: this error originates in the derive macro `Accounts` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Pubkey: BorshSerialize` is not satisfied
   --> src/system_program.rs:152:10
    |
152 | #[derive(Accounts)]
    |          ^^^^^^^^ the trait `BorshSerialize` is not implemented for `Pubkey`
    |
    = help: the following other types implement trait `BorshSerialize`:
              &T
              ()
              (T0, T1)
              (T0, T1, T2)
              (T0, T1, T2, T3)
              (T0, T1, T2, T3, T4)
              (T0, T1, T2, T3, T4, T5)
              (T0, T1, T2, T3, T4, T5, T6)
            and 81 others
    = help: see issue #48214
    = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
    = note: this error originates in the derive macro `Accounts` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Pubkey: BorshSerialize` is not satisfied
   --> src/system_program.rs:179:10
    |
179 | #[derive(Accounts)]
    |          ^^^^^^^^ the trait `BorshSerialize` is not implemented for `Pubkey`
    |
    = help: the following other types implement trait `BorshSerialize`:
              &T
              ()
              (T0, T1)
              (T0, T1, T2)
              (T0, T1, T2, T3)
              (T0, T1, T2, T3, T4)
              (T0, T1, T2, T3, T4, T5)
              (T0, T1, T2, T3, T4, T5, T6)
            and 81 others
    = help: see issue #48214
    = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
    = note: this error originates in the derive macro `Accounts` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Pubkey: BorshSerialize` is not satisfied
   --> src/system_program.rs:209:10
    |
209 | #[derive(Accounts)]
    |          ^^^^^^^^ the trait `BorshSerialize` is not implemented for `Pubkey`
    |
    = help: the following other types implement trait `BorshSerialize`:
              &T
              ()
              (T0, T1)
              (T0, T1, T2)
              (T0, T1, T2, T3)
              (T0, T1, T2, T3, T4)
              (T0, T1, T2, T3, T4, T5)
              (T0, T1, T2, T3, T4, T5, T6)
            and 81 others
    = help: see issue #48214
    = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
    = note: this error originates in the derive macro `Accounts` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Pubkey: BorshSerialize` is not satisfied
   --> src/system_program.rs:245:10
    |
245 | #[derive(Accounts)]
    |          ^^^^^^^^ the trait `BorshSerialize` is not implemented for `Pubkey`
    |
    = help: the following other types implement trait `BorshSerialize`:
              &T
              ()
              (T0, T1)
              (T0, T1, T2)
              (T0, T1, T2, T3)
              (T0, T1, T2, T3, T4)
              (T0, T1, T2, T3, T4, T5)
              (T0, T1, T2, T3, T4, T5, T6)
            and 81 others
    = help: see issue #48214
    = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
    = note: this error originates in the derive macro `Accounts` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Pubkey: BorshSerialize` is not satisfied
   --> src/system_program.rs:289:10
    |
289 | #[derive(Accounts)]
    |          ^^^^^^^^ the trait `BorshSerialize` is not implemented for `Pubkey`
    |
    = help: the following other types implement trait `BorshSerialize`:
              &T
              ()
              (T0, T1)
              (T0, T1, T2)
              (T0, T1, T2, T3)
              (T0, T1, T2, T3, T4)
              (T0, T1, T2, T3, T4, T5)
              (T0, T1, T2, T3, T4, T5, T6)
            and 81 others
    = help: see issue #48214
    = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
    = note: this error originates in the derive macro `Accounts` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Pubkey: BorshSerialize` is not satisfied
   --> src/system_program.rs:315:10
    |
315 | #[derive(Accounts)]
    |          ^^^^^^^^ the trait `BorshSerialize` is not implemented for `Pubkey`
    |
    = help: the following other types implement trait `BorshSerialize`:
              &T
              ()
              (T0, T1)
              (T0, T1, T2)
              (T0, T1, T2, T3)
              (T0, T1, T2, T3, T4)
              (T0, T1, T2, T3, T4, T5)
              (T0, T1, T2, T3, T4, T5, T6)
            and 81 others
    = help: see issue #48214
    = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
    = note: this error originates in the derive macro `Accounts` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Pubkey: BorshSerialize` is not satisfied
   --> src/system_program.rs:343:10
    |
343 | #[derive(Accounts)]
    |          ^^^^^^^^ the trait `BorshSerialize` is not implemented for `Pubkey`
    |
    = help: the following other types implement trait `BorshSerialize`:
              &T
              ()
              (T0, T1)
              (T0, T1, T2)
              (T0, T1, T2, T3)
              (T0, T1, T2, T3, T4)
              (T0, T1, T2, T3, T4, T5)
              (T0, T1, T2, T3, T4, T5, T6)
            and 81 others
    = help: see issue #48214
    = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
    = note: this error originates in the derive macro `Accounts` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Pubkey: BorshSerialize` is not satisfied
   --> src/system_program.rs:374:10
    |
374 | #[derive(Accounts)]
    |          ^^^^^^^^ the trait `BorshSerialize` is not implemented for `Pubkey`
    |
    = help: the following other types implement trait `BorshSerialize`:
              &T
              ()
              (T0, T1)
              (T0, T1, T2)
              (T0, T1, T2, T3)
              (T0, T1, T2, T3, T4)
              (T0, T1, T2, T3, T4, T5)
              (T0, T1, T2, T3, T4, T5, T6)
            and 81 others
    = help: see issue #48214
    = help: add `#![feature(trivial_bounds)]` to the crate attributes to enable
    = note: this error originates in the derive macro `Accounts` (in Nightly builds, run with -Z macro-backtrace for more info)

For more information about this error, try `rustc --explain E0277`.
error: could not compile `anchor-lang` due to 17 previous errors
@AnderUstarroz AnderUstarroz added the enhancement New feature or request label Jul 24, 2023
@lempiy
Copy link

lempiy commented Jul 24, 2023

Blocked by the same problem with anchor 0.28 and Solana 1.16.5

@peterschwarzdev
Copy link

Blocked by same problem! Hopefully someone will prioritize this? it is slowing down the whole Solana community building products on top of Metaplex 😞

@samuelvanderwaal
Copy link
Contributor

Blocked by same problem! Hopefully someone will prioritize this? it is slowing down the whole Solana community building products on top of Metaplex disappointed

Neither Solana nor Metaplex nor anyone else should be making these kind of breaking changes in minor versions as it causes a lot of dependency issues, as you've observed. Solana is working on fixing some of the issues on their end and once the fixes are merged Metaplex will be able to bump Solana version to 1.16.
(To be clear, Metaplex has also been guilty of making breaking changes in minor versions but we're making an effort to strictly follow SemVer from now on.)

See also this issue I created for more context on some of the dependency issues in the ecosystem.

@joncinque
Copy link
Contributor

joncinque commented Jul 25, 2023

@samuelvanderwaal I noticed your comment on my PR -- are you sure that PR fixes all of your issues? Or are there other types missing? We're only doing Pubkey there, so I want to be sure you don't have to wait for that fix to land in 1.16 only to be blocked by some other missing type

@samuelvanderwaal
Copy link
Contributor

@samuelvanderwaal I noticed your comment on my PR -- are you sure that PR fixes all of your issues? Or are there other types missing? We're only doing Pubkey there, so I want to be sure you don't have to wait for that fix to land in 1.16 only to be blocked by some other missing type

I'll have to investigate; I should have some time to try bumping things this week and see if anything else is missing. Thanks for the heads up!

@febo
Copy link
Contributor

febo commented Aug 1, 2023

@joncinque We are in the process of bumping Solana version to 1.16 on Token Metadata.

@febo
Copy link
Contributor

febo commented Aug 1, 2023

This has been addressed in this PR: metaplex-foundation/mpl-token-metadata#29

A new Token Metadata crate has been published (2.0.0-beta.1), which can be used by clients requiring borsh 0.10.3 and solana 1.16: https://crates.io/crates/mpl-token-metadata/2.0.0-beta.1

@febo febo closed this as completed Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants