whirlpools icon indicating copy to clipboard operation
whirlpools copied to clipboard

update anchor and solana

Open DemidovVladimir opened this issue 1 year ago • 2 comments

DemidovVladimir avatar Jun 21 '24 10:06 DemidovVladimir

Hope i get right!

Target911 avatar Jun 23 '24 18:06 Target911

Problems faced during upgrade:

  1. Anchor specific Zero copy does not support tuple structs and unaligned fields: https://solana.stackexchange.com/questions/15043/can-not-use-zero-copy-with-u8-primitive-type
  2. Max stack size is 4 kb and it is strict. So we most likely should refactor alignments in big accounts and make them zero_copy so it will use bytemuck (custom Zeroable and Pod does not work, as it creates wrong IDL) and read from validator directly.
  3. Solana 1.18.17 uses some solana deps which are v2, need to forcefully downgrade at list this one: https://solana.stackexchange.com/questions/14973/error-after-updating-solana-program-to-1-18-17-and-anchor-to-0-30-1
  4. Anchor deprecates AccountInfo, which is heavily used in this program: https://github.com/coral-xyz/anchor/issues/2794
  5. Remaining accounts now have lifetimes and this is a problem, because Account::try_from(account_info) does not live long enough: https://solana.stackexchange.com/questions/13310/how-to-use-lifetime-on-context-correctly
  6. Big Accounts should use zero_copy and AccountLoad, but this program is not using it: https://github.com/solana-developers/anchor-zero-copy-example
  7. Use spl-transfer-hook-interface v0.6.3
  8. cargo update -p [email protected] --precise 1.18.17 (https://github.com/coral-xyz/anchor/issues/3044)
  9. https://solana.stackexchange.com/questions/5489/getting-an-error-of-proc-macro-derive-panicked-message-invariant-violation-com
  10. Lifetimes changes: https://solana.stackexchange.com/questions/11823/anchor-28-to-29-ctx-remaining-accounts-lifetime

DemidovVladimir avatar Jul 01 '24 18:07 DemidovVladimir

Closing this since it is superseded by https://github.com/orca-so/whirlpools/pull/174

wjthieme avatar Aug 07 '24 19:08 wjthieme